From 82b8d79fd601d44a6263db4879b3c049235a9106 Mon Sep 17 00:00:00 2001
From: Karl Heinz Marbaise
Date: Wed, 27 Aug 2014 20:16:35 +0000
Subject: [PATCH 001/153] [maven-release-plugin] prepare for next development
iteration
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1620972 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/pom.xml b/pom.xml
index 03b2d9c3..68aab5c7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -30,7 +30,7 @@ under the License.
maven-deploy-plugin
- 2.8.2
+ 2.8.3-SNAPSHOTmaven-pluginApache Maven Deploy Plugin
@@ -42,9 +42,9 @@ under the License.
- scm:svn:http://svn.apache.org/repos/asf/maven/plugins/tags/maven-deploy-plugin-2.8.2
- scm:svn:https://svn.apache.org/repos/asf/maven/plugins/tags/maven-deploy-plugin-2.8.2
- http://svn.apache.org/viewvc/maven/plugins/tags/maven-deploy-plugin-2.8.2
+ scm:svn:http://svn.apache.org/repos/asf/maven/plugins/trunk/maven-deploy-plugin/
+ scm:svn:https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-deploy-plugin/
+ http://svn.apache.org/viewvc/maven/plugins/trunk/maven-deploy-plugin/JIRA
From 3cbf6a6a578aa5a1aedc50569888fac31b303cd4 Mon Sep 17 00:00:00 2001
From: Karl Heinz Marbaise
Date: Thu, 9 Oct 2014 09:49:32 +0000
Subject: [PATCH 002/153] - Added to all plugins LICENSE file - Added to all
plugins NOTICE file with copyright year 2007-2014
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1630358 13f79535-47bb-0310-9956-ffa450edef68
---
LICENSE | 202 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
NOTICE | 5 ++
2 files changed, 207 insertions(+)
create mode 100644 LICENSE
create mode 100644 NOTICE
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 00000000..d6456956
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/NOTICE b/NOTICE
new file mode 100644
index 00000000..0e827cb7
--- /dev/null
+++ b/NOTICE
@@ -0,0 +1,5 @@
+Apache Maven Deploy Plugin
+Copyright 2007-2014 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
From fa2ee59319c011f3f9aafdf1ee54d726cce5d9b6 Mon Sep 17 00:00:00 2001
From: Karl Heinz Marbaise
Date: Thu, 9 Oct 2014 20:40:31 +0000
Subject: [PATCH 003/153] - Undone the commit r1630358 which means to remove
all LICENSE/NOTICE files until the ASF is clear about what to do.
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1630593 13f79535-47bb-0310-9956-ffa450edef68
---
LICENSE | 202 --------------------------------------------------------
NOTICE | 5 --
2 files changed, 207 deletions(-)
delete mode 100644 LICENSE
delete mode 100644 NOTICE
diff --git a/LICENSE b/LICENSE
deleted file mode 100644
index d6456956..00000000
--- a/LICENSE
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/NOTICE b/NOTICE
deleted file mode 100644
index 0e827cb7..00000000
--- a/NOTICE
+++ /dev/null
@@ -1,5 +0,0 @@
-Apache Maven Deploy Plugin
-Copyright 2007-2014 The Apache Software Foundation
-
-This product includes software developed at
-The Apache Software Foundation (http://www.apache.org/).
From 9503f3a3e76c28930caa23397ef44742c58d0e9d Mon Sep 17 00:00:00 2001
From: Karl Heinz Marbaise
Date: Sat, 18 Oct 2014 19:47:32 +0000
Subject: [PATCH 004/153] [MDEPLOY-188] - Upgrade plexus-utils from 3.0.15 to
3.0.18
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1632832 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 68aab5c7..448cca97 100644
--- a/pom.xml
+++ b/pom.xml
@@ -93,7 +93,7 @@ under the License.
org.codehaus.plexusplexus-utils
- 3.0.15
+ 3.0.18org.apache.maven.plugin-testing
From fbe851ca2484f6d38637025408d0ab737d0685fe Mon Sep 17 00:00:00 2001
From: Karl Heinz Marbaise
Date: Sat, 18 Oct 2014 20:17:34 +0000
Subject: [PATCH 005/153] [MDEPLOY-171] - Removed deprecated marked entries.
artifact, packaging, pomFile, attachedArtifacts fixed unit tests
accordingly.
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1632838 13f79535-47bb-0310-9956-ffa450edef68
---
.../maven/plugin/deploy/DeployMojo.java | 41 ++++--------------
.../plugin/deploy/DeployFileMojoTest.java | 24 ----------
.../maven/plugin/deploy/DeployMojoTest.java | 7 +--
.../unit/basic-deploy-pom/plugin-config.xml | 6 ---
.../unit/basic-deploy-scp/plugin-config.xml | 6 ---
.../unit/basic-deploy-test/plugin-config.xml | Bin 4128 -> 3490 bytes
.../plugin-config.xml | 8 ----
.../plugin-config.xml | 1 -
8 files changed, 9 insertions(+), 84 deletions(-)
diff --git a/src/main/java/org/apache/maven/plugin/deploy/DeployMojo.java b/src/main/java/org/apache/maven/plugin/deploy/DeployMojo.java
index a70b3db6..a12de010 100644
--- a/src/main/java/org/apache/maven/plugin/deploy/DeployMojo.java
+++ b/src/main/java/org/apache/maven/plugin/deploy/DeployMojo.java
@@ -19,6 +19,14 @@
* under the License.
*/
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.ArtifactUtils;
import org.apache.maven.artifact.deployer.ArtifactDeploymentException;
@@ -27,21 +35,12 @@
import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
-import org.apache.maven.plugins.annotations.Component;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.project.MavenProject;
import org.apache.maven.project.artifact.ProjectArtifactMetadata;
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.concurrent.atomic.AtomicInteger;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
/**
* Deploys an artifact to remote repository.
*
@@ -82,24 +81,6 @@ public class DeployMojo
@Parameter( defaultValue = "false", property = "deployAtEnd" )
private boolean deployAtEnd;
- /**
- * @deprecated either use project.getArtifact() or reactorProjects.get(i).getArtifact()
- */
- @Parameter( defaultValue = "${project.artifact}", required = true, readonly = true )
- private Artifact artifact;
-
- /**
- * @deprecated either use project.getPackaging() or reactorProjects.get(i).getPackaging()
- */
- @Parameter( defaultValue = "${project.packaging}", required = true, readonly = true )
- private String packaging;
-
- /**
- * @deprecated either use project.getFile() or reactorProjects.get(i).getFile()
- */
- @Parameter( defaultValue = "${project.file}", required = true, readonly = true )
- private File pomFile;
-
/**
* Specifies an alternative repository to which the project artifacts should be deployed ( other than those
* specified in <distributionManagement> ).
@@ -135,12 +116,6 @@ public class DeployMojo
@Parameter( property = "altReleaseDeploymentRepository" )
private String altReleaseDeploymentRepository;
- /**
- * @deprecated either use project.getAttachedArtifacts() or reactorProjects.get(i).getAttachedArtifacts()
- */
- @Parameter( defaultValue = "${project.attachedArtifacts}", required = true, readonly = true )
- private List attachedArtifacts;
-
/**
* Set this to 'true' to bypass artifact deploy
*
diff --git a/src/test/java/org/apache/maven/plugin/deploy/DeployFileMojoTest.java b/src/test/java/org/apache/maven/plugin/deploy/DeployFileMojoTest.java
index ef62a80b..ccf8775d 100644
--- a/src/test/java/org/apache/maven/plugin/deploy/DeployFileMojoTest.java
+++ b/src/test/java/org/apache/maven/plugin/deploy/DeployFileMojoTest.java
@@ -162,26 +162,6 @@ public void testBasicDeployFile()
assertEquals( 0, getSizeOfExpectedFiles( fileList, expectedFiles ) );
}
- public void testDeployIfPomFileParamIsSet()
- throws Exception
- {
- File testPom = new File( getBasedir(), "target/test-classes/unit/deploy-file-pom-file/plugin-config.xml" );
-
- DeployFileMojo mojo = (DeployFileMojo) lookupMojo( "deploy-file", testPom );
-
- assertNotNull( mojo );
-
- setVariableValueToObject( mojo, "project", projectStub );
-
- File pomFile = ( File ) getVariableValueFromObject( mojo, "pomFile" );
-
- assertNotNull( pomFile );
-
- mojo.execute();
-
- assertTrue( pomFile.exists() );
- }
-
public void testDeployIfClassifierIsSet()
throws Exception
{
@@ -241,16 +221,12 @@ public void testDeployIfArtifactIsNotJar()
String version = (String) getVariableValueFromObject( mojo, "version" );
- String packaging = (String) getVariableValueFromObject( mojo, "packaging" );
-
assertEquals( "org.apache.maven.test", groupId );
assertEquals( "maven-deploy-file-test", artifactId );
assertEquals( "1.0", version );
- assertEquals( "zip", packaging );
-
mojo.execute();
File file = new File( remoteRepo, "deploy-file-artifact-not-jar/" + groupId.replace( '.', '/' ) +
diff --git a/src/test/java/org/apache/maven/plugin/deploy/DeployMojoTest.java b/src/test/java/org/apache/maven/plugin/deploy/DeployMojoTest.java
index 26f76ee2..c2562ce4 100644
--- a/src/test/java/org/apache/maven/plugin/deploy/DeployMojoTest.java
+++ b/src/test/java/org/apache/maven/plugin/deploy/DeployMojoTest.java
@@ -31,7 +31,6 @@
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.repository.ArtifactRepositoryFactory;
import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
-import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.deploy.stubs.ArtifactDeployerStub;
import org.apache.maven.plugin.deploy.stubs.ArtifactRepositoryStub;
@@ -274,17 +273,13 @@ public void testBasicDeployWithPackagingAsPom()
assertNotNull( mojo );
- String packaging = ( String ) getVariableValueFromObject( mojo, "packaging" );
-
- assertEquals( "pom", packaging );
-
MavenProject project = (MavenProject) getVariableValueFromObject( mojo, "project" );
setVariableValueToObject( mojo, "reactorProjects", Collections.singletonList( project ) );
artifact = (DeployArtifactStub) project.getArtifact();
- artifact.setArtifactHandlerExtension( packaging );
+ artifact.setArtifactHandlerExtension( project.getPackaging() );
ArtifactRepositoryStub repo = getRepoStub( mojo );
diff --git a/src/test/resources/unit/basic-deploy-pom/plugin-config.xml b/src/test/resources/unit/basic-deploy-pom/plugin-config.xml
index 798927fa..706ae344 100644
--- a/src/test/resources/unit/basic-deploy-pom/plugin-config.xml
+++ b/src/test/resources/unit/basic-deploy-pom/plugin-config.xml
@@ -23,12 +23,6 @@ under the License.
maven-deploy-plugin
-
- ${basedir}/src/test/resources/unit/basic-deploy-pom/plugin-config.xml
- pom
-
-
-
${localRepository}${basedir}/src/test/resources/unit/basic-deploy-pom/plugin-config.xml
diff --git a/src/test/resources/unit/basic-deploy-scp/plugin-config.xml b/src/test/resources/unit/basic-deploy-scp/plugin-config.xml
index 9fecd38d..0d785501 100644
--- a/src/test/resources/unit/basic-deploy-scp/plugin-config.xml
+++ b/src/test/resources/unit/basic-deploy-scp/plugin-config.xml
@@ -23,12 +23,6 @@ under the License.
maven-deploy-plugin
-
- ${basedir}/src/test/resources/unit/basic-deploy-scp/plugin-config.xml
- jar
-
-
-
${localRepository}${basedir}/src/test/resources/unit/basic-deploy-scp/plugin-config.xml
diff --git a/src/test/resources/unit/basic-deploy-test/plugin-config.xml b/src/test/resources/unit/basic-deploy-test/plugin-config.xml
index 45f82a3778645324ba307c1381596162cf2d0d9d..708190083f1dd6cf0b030567577cc6fe8b87cc3d 100644
GIT binary patch
delta 12
TcmZ3Wut<8tH1^FRTs&+59s&cd
delta 106
zcmZ1^y+C2ZGyIsTx-R
diff --git a/src/test/resources/unit/basic-deploy-with-attached-artifacts/plugin-config.xml b/src/test/resources/unit/basic-deploy-with-attached-artifacts/plugin-config.xml
index 3d54491c..4e234f2d 100644
--- a/src/test/resources/unit/basic-deploy-with-attached-artifacts/plugin-config.xml
+++ b/src/test/resources/unit/basic-deploy-with-attached-artifacts/plugin-config.xml
@@ -23,14 +23,6 @@ under the License.
maven-deploy-plugin
-
- ${basedir}/src/test/resources/unit/basic-deploy-with-attached-artifacts/plugin-config.xml
- jar
-
-
-
-
-
${localRepository}${basedir}/src/test/resources/unit/basic-deploy-with-attached-artifacts/plugin-config.xml
diff --git a/src/test/resources/unit/deploy-file-artifact-not-jar/plugin-config.xml b/src/test/resources/unit/deploy-file-artifact-not-jar/plugin-config.xml
index e193f5c2..5ec690ce 100644
--- a/src/test/resources/unit/deploy-file-artifact-not-jar/plugin-config.xml
+++ b/src/test/resources/unit/deploy-file-artifact-not-jar/plugin-config.xml
@@ -26,7 +26,6 @@ under the License.
org.apache.maven.testmaven-deploy-file-test1.0
- zip${basedir}/src/test/resources/unit/deploy-file-artifact-not-jar/target/deploy-test-file.zipdeploy-testfile://${basedir}/target/remote-repo/deploy-file-artifact-not-jar
From 312793a84cb326cea2c165130203fdf59276f8be Mon Sep 17 00:00:00 2001
From: Kristian Rosenvold
Date: Sun, 19 Oct 2014 07:02:32 +0000
Subject: [PATCH 006/153] Updated to p-u .20
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1632876 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 448cca97..7734a9fb 100644
--- a/pom.xml
+++ b/pom.xml
@@ -93,7 +93,7 @@ under the License.
org.codehaus.plexusplexus-utils
- 3.0.18
+ 3.0.20org.apache.maven.plugin-testing
From 1211506c1495b0f6931faf4c2e9c6e7d9dccef6e Mon Sep 17 00:00:00 2001
From: Karl Heinz Marbaise
Date: Tue, 18 Nov 2014 22:28:56 +0000
Subject: [PATCH 007/153] [MDEPLOY-191] Upgrade to maven-plugins parent version
27 - Cleaned up pom accordingly to let the parent do it's work. - Fixed
checkstyle reported issues.
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1640441 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 35 +------------------
.../plugin/deploy/AbstractDeployMojo.java | 7 ++--
.../maven/plugin/deploy/DeployFileMojo.java | 3 +-
.../maven/plugin/deploy/DeployMojo.java | 19 +++++-----
.../maven/plugin/deploy/DeployRequest.java | 4 +--
5 files changed, 20 insertions(+), 48 deletions(-)
diff --git a/pom.xml b/pom.xml
index 7734a9fb..1f9117b8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.maven.pluginsmaven-plugins
- 25
+ 27../maven-plugins/pom.xml
@@ -59,7 +59,6 @@ under the License.
2.2.1
- 3.2
@@ -87,7 +86,6 @@ under the License.
org.apache.maven.plugin-toolsmaven-plugin-annotations
- ${mavenPluginPluginVersion}provided
@@ -122,37 +120,6 @@ under the License.
-
-
-
-
-
- org.apache.maven.plugins
- maven-plugin-plugin
- ${mavenPluginPluginVersion}
-
- true
-
-
-
- mojo-descriptor
- process-classes
-
- descriptor
-
-
-
- help-goal
-
- helpmojo
-
-
-
-
-
-
-
-
run-its
diff --git a/src/main/java/org/apache/maven/plugin/deploy/AbstractDeployMojo.java b/src/main/java/org/apache/maven/plugin/deploy/AbstractDeployMojo.java
index 33478746..06532d07 100644
--- a/src/main/java/org/apache/maven/plugin/deploy/AbstractDeployMojo.java
+++ b/src/main/java/org/apache/maven/plugin/deploy/AbstractDeployMojo.java
@@ -138,12 +138,12 @@ boolean isUpdateReleaseInfo()
{
return updateReleaseInfo;
}
-
+
int getRetryFailedDeploymentCount()
{
return retryFailedDeploymentCount;
}
-
+
/**
* Deploy an artifact from a particular file.
*
@@ -166,7 +166,8 @@ protected void deploy( File source, Artifact artifact, ArtifactRepository deploy
{
if ( count > 0 )
{
- getLog().info( "Retrying deployment attempt " + ( count + 1 ) + " of " + retryFailedDeploymentCounter );
+ getLog().info( "Retrying deployment attempt " + ( count + 1 ) + " of "
+ + retryFailedDeploymentCounter );
}
getDeployer().deploy( source, artifact, deploymentRepository, localRepository );
exception = null;
diff --git a/src/main/java/org/apache/maven/plugin/deploy/DeployFileMojo.java b/src/main/java/org/apache/maven/plugin/deploy/DeployFileMojo.java
index 719e530b..59468325 100644
--- a/src/main/java/org/apache/maven/plugin/deploy/DeployFileMojo.java
+++ b/src/main/java/org/apache/maven/plugin/deploy/DeployFileMojo.java
@@ -383,7 +383,8 @@ else if ( generatePom )
{
try
{
- deploy( attached.getFile(), attached, deploymentRepository, getLocalRepository(), getRetryFailedDeploymentCount() );
+ deploy( attached.getFile(), attached, deploymentRepository, getLocalRepository(),
+ getRetryFailedDeploymentCount() );
}
catch ( ArtifactDeploymentException e )
{
diff --git a/src/main/java/org/apache/maven/plugin/deploy/DeployMojo.java b/src/main/java/org/apache/maven/plugin/deploy/DeployMojo.java
index a12de010..7cf73378 100644
--- a/src/main/java/org/apache/maven/plugin/deploy/DeployMojo.java
+++ b/src/main/java/org/apache/maven/plugin/deploy/DeployMojo.java
@@ -59,9 +59,9 @@ public class DeployMojo
* When building with multiple threads, reaching the last project doesn't have to mean that all projects are ready
* to be deployed
*/
- private static final AtomicInteger readyProjectsCounter = new AtomicInteger();
+ private static final AtomicInteger READYPROJECTSCOUNTER = new AtomicInteger();
- private static final List deployRequests =
+ private static final List DEPLOYREQUESTS =
Collections.synchronizedList( new ArrayList() );
/**
@@ -74,7 +74,8 @@ public class DeployMojo
/**
* Whether every project should be deployed during its own deploy-phase or at the end of the multimodule build. If
- * set to {@code true} and the build fails, none of the reactor projects is deployed. (experimental)
+ * set to {@code true} and the build fails, none of the reactor projects is deployed.
+ * (experimental)
*
* @since 2.8
*/
@@ -136,8 +137,10 @@ public void execute()
{
failIfOffline();
+ // CHECKSTYLE_OFF: LineLength
DeployRequest currentExecutionDeployRequest =
new DeployRequest().setProject( project ).setUpdateReleaseInfo( isUpdateReleaseInfo() ).setRetryFailedDeploymentCount( getRetryFailedDeploymentCount() ).setAltReleaseDeploymentRepository( altReleaseDeploymentRepository ).setAltSnapshotDeploymentRepository( altSnapshotDeploymentRepository ).setAltDeploymentRepository( altDeploymentRepository );
+ // CHECKSTYLE_ON: LineLength
if ( !deployAtEnd )
{
@@ -145,19 +148,19 @@ public void execute()
}
else
{
- deployRequests.add( currentExecutionDeployRequest );
+ DEPLOYREQUESTS.add( currentExecutionDeployRequest );
addedDeployRequest = true;
}
}
- boolean projectsReady = readyProjectsCounter.incrementAndGet() == reactorProjects.size();
+ boolean projectsReady = READYPROJECTSCOUNTER.incrementAndGet() == reactorProjects.size();
if ( projectsReady )
{
- synchronized ( deployRequests )
+ synchronized ( DEPLOYREQUESTS )
{
- while ( !deployRequests.isEmpty() )
+ while ( !DEPLOYREQUESTS.isEmpty() )
{
- deployProject( deployRequests.remove( 0 ) );
+ deployProject( DEPLOYREQUESTS.remove( 0 ) );
}
}
}
diff --git a/src/main/java/org/apache/maven/plugin/deploy/DeployRequest.java b/src/main/java/org/apache/maven/plugin/deploy/DeployRequest.java
index 02e96858..b5505d92 100644
--- a/src/main/java/org/apache/maven/plugin/deploy/DeployRequest.java
+++ b/src/main/java/org/apache/maven/plugin/deploy/DeployRequest.java
@@ -1,7 +1,5 @@
package org.apache.maven.plugin.deploy;
-import org.apache.maven.project.MavenProject;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -21,6 +19,8 @@
* under the License.
*/
+import org.apache.maven.project.MavenProject;
+
/**
*
* @author Robert Scholte
From a1b15eb70c9d14b6d86ab5985bb71f26c47bee57 Mon Sep 17 00:00:00 2001
From: Karl Heinz Marbaise
Date: Wed, 26 Nov 2014 22:10:07 +0000
Subject: [PATCH 008/153] [MDEPLOY-192] Upgrade maven-plugin-testing-harness to
1.3
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1641951 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 1f9117b8..2626ddbc 100644
--- a/pom.xml
+++ b/pom.xml
@@ -96,7 +96,7 @@ under the License.
org.apache.maven.plugin-testingmaven-plugin-testing-harness
- 1.2
+ 1.3test
From 932eff341b1fe9b6d8dbcf962c3b9778c8fa1cb4 Mon Sep 17 00:00:00 2001
From: Michael Osipov
Date: Sat, 27 Dec 2014 16:55:13 +0000
Subject: [PATCH 009/153] [MDEPLOY-194] Deploy SSH external: copy and paste
failure in POM snippet comment
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1648069 13f79535-47bb-0310-9956-ffa450edef68
---
src/site/apt/examples/deploy-ssh-external.apt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/site/apt/examples/deploy-ssh-external.apt b/src/site/apt/examples/deploy-ssh-external.apt
index 65f3f45d..e424a748 100644
--- a/src/site/apt/examples/deploy-ssh-external.apt
+++ b/src/site/apt/examples/deploy-ssh-external.apt
@@ -45,7 +45,7 @@ Deployment of artifacts in an external SSH command
-
+
org.apache.maven.wagonwagon-ssh-external
From e6152ec54ac7436ab768ad2f2bc5d3c0ed5d6a16 Mon Sep 17 00:00:00 2001
From: Robert Scholte
Date: Sat, 3 Jan 2015 14:49:38 +0000
Subject: [PATCH 010/153] [MDEPLOY-178] Use information provided in pom.xml of
JAR
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1649209 13f79535-47bb-0310-9956-ffa450edef68
---
.../invoker.properties | 18 ++++
.../pom.xml | 46 ++++++++++
.../test.properties | 19 ++++
.../verify.groovy | 29 +++++++
.../maven/plugin/deploy/DeployFileMojo.java | 87 ++++++++++++++++++-
5 files changed, 195 insertions(+), 4 deletions(-)
create mode 100644 src/it/MDEPLOY-178_deployfile-with-embedded-pom/invoker.properties
create mode 100644 src/it/MDEPLOY-178_deployfile-with-embedded-pom/pom.xml
create mode 100644 src/it/MDEPLOY-178_deployfile-with-embedded-pom/test.properties
create mode 100644 src/it/MDEPLOY-178_deployfile-with-embedded-pom/verify.groovy
diff --git a/src/it/MDEPLOY-178_deployfile-with-embedded-pom/invoker.properties b/src/it/MDEPLOY-178_deployfile-with-embedded-pom/invoker.properties
new file mode 100644
index 00000000..dd84d096
--- /dev/null
+++ b/src/it/MDEPLOY-178_deployfile-with-embedded-pom/invoker.properties
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+invoker.goals = package deploy:deploy-file
\ No newline at end of file
diff --git a/src/it/MDEPLOY-178_deployfile-with-embedded-pom/pom.xml b/src/it/MDEPLOY-178_deployfile-with-embedded-pom/pom.xml
new file mode 100644
index 00000000..aa089934
--- /dev/null
+++ b/src/it/MDEPLOY-178_deployfile-with-embedded-pom/pom.xml
@@ -0,0 +1,46 @@
+
+
+
+
+
+ 4.0.0
+
+ org.apache.maven.plugins.deploy.its
+ mdeploy178
+ 1.0
+
+
+ Test to verify that the pom inside the jar in used when deploying the file
+
+
+ https://jira.codehaus.org/browse/MDEPLOY-178
+
+
+
+
+ org.apache.maven.plugins
+ maven-deploy-plugin
+ @project.version@
+
+
+
+
+
diff --git a/src/it/MDEPLOY-178_deployfile-with-embedded-pom/test.properties b/src/it/MDEPLOY-178_deployfile-with-embedded-pom/test.properties
new file mode 100644
index 00000000..992a650f
--- /dev/null
+++ b/src/it/MDEPLOY-178_deployfile-with-embedded-pom/test.properties
@@ -0,0 +1,19 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+file = target/mdeploy178-1.0.jar
+url = file:target/repo
\ No newline at end of file
diff --git a/src/it/MDEPLOY-178_deployfile-with-embedded-pom/verify.groovy b/src/it/MDEPLOY-178_deployfile-with-embedded-pom/verify.groovy
new file mode 100644
index 00000000..2c6701ad
--- /dev/null
+++ b/src/it/MDEPLOY-178_deployfile-with-embedded-pom/verify.groovy
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+assert new File( basedir, "target/repo/org/apache/maven/plugins/deploy/its/mdeploy178/1.0/mdeploy178-1.0.jar" ).exists()
+File deployedPom = new File( basedir, "target/repo/org/apache/maven/plugins/deploy/its/mdeploy178/1.0/mdeploy178-1.0.pom" )
+assert deployedPom.exists()
+
+File buildLog = new File( basedir, 'build.log' )
+assert buildLog.exists()
+assert buildLog.text.contains( "[DEBUG] Using META-INF/maven/org.apache.maven.plugins.deploy.its/mdeploy178/pom.xml as pomFile" )
+
+def pomProject = new XmlSlurper().parse( deployedPom )
+assert "https://jira.codehaus.org/browse/MDEPLOY-178".equals( pomProject.url.text() )
\ No newline at end of file
diff --git a/src/main/java/org/apache/maven/plugin/deploy/DeployFileMojo.java b/src/main/java/org/apache/maven/plugin/deploy/DeployFileMojo.java
index 59468325..db134b42 100644
--- a/src/main/java/org/apache/maven/plugin/deploy/DeployFileMojo.java
+++ b/src/main/java/org/apache/maven/plugin/deploy/DeployFileMojo.java
@@ -21,10 +21,17 @@
import java.io.File;
import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
import java.io.Reader;
import java.io.Writer;
+import java.util.Enumeration;
import java.util.List;
+import java.util.jar.JarEntry;
+import java.util.jar.JarFile;
+import java.util.regex.Pattern;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.deployer.ArtifactDeploymentException;
@@ -202,14 +209,86 @@ public class DeployFileMojo
void initProperties()
throws MojoExecutionException
{
- // Process the supplied POM (if there is one)
if ( pomFile != null )
{
- generatePom = false;
+ processModel( readModel( pomFile ) );
+ }
+ else
+ {
+ boolean foundPom = false;
+
+ JarFile jarFile = null;
+ try
+ {
+ Pattern pomEntry = Pattern.compile( "META-INF/maven/.*/pom\\.xml" );
+
+ jarFile = new JarFile( file );
- Model model = readModel( pomFile );
+ Enumeration jarEntries = jarFile.entries();
+
+ while ( jarEntries.hasMoreElements() )
+ {
+ JarEntry entry = jarEntries.nextElement();
+
+ if ( pomEntry.matcher( entry.getName() ).matches() )
+ {
+ getLog().debug( "Using " + entry.getName() + " as pomFile" );
+
+ foundPom = true;
+
+ InputStream pomInputStream = null;
+ OutputStream pomOutputStream = null;
+
+ try
+ {
+ pomInputStream = jarFile.getInputStream( entry );
+
+ String base = file.getName();
+ if ( base.indexOf( '.' ) > 0 )
+ {
+ base = base.substring( 0, base.lastIndexOf( '.' ) );
+ }
+ pomFile = new File( file.getParentFile(), base + ".pom" );
+
+ pomOutputStream = new FileOutputStream( pomFile );
+
+ IOUtil.copy( pomInputStream, pomOutputStream );
+
+ processModel( readModel( pomFile ) );
+
+ break;
+ }
+ finally
+ {
+ IOUtil.close( pomInputStream );
+ IOUtil.close( pomOutputStream );
+ }
+ }
+ }
- processModel( model );
+ if ( !foundPom )
+ {
+ getLog().info( "pom.xml not found in " + file.getName() );
+ }
+ }
+ catch ( IOException e )
+ {
+ // ignore, artifact not packaged by Maven
+ }
+ finally
+ {
+ if ( jarFile != null )
+ {
+ try
+ {
+ jarFile.close();
+ }
+ catch ( IOException e )
+ {
+ // we did our best
+ }
+ }
+ }
}
if ( packaging == null && file != null )
From aa4b86c83d6ce619cd8c59b26b4b2f8c5c1d855f Mon Sep 17 00:00:00 2001
From: Herve Boutemy
Date: Mon, 30 Mar 2015 22:54:42 +0000
Subject: [PATCH 011/153] changed svnpubsub url from /content to /components
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1670209 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 2626ddbc..2401cf30 100644
--- a/pom.xml
+++ b/pom.xml
@@ -53,7 +53,7 @@ under the License.
apache.website
- scm:svn:https://svn.apache.org/repos/infra/websites/production/maven/content/${maven.site.path}
+ scm:svn:https://svn.apache.org/repos/infra/websites/production/maven/components/${maven.site.path}
From 92d7ed3858f1568eb0fab14e0ce27ba413c7cac0 Mon Sep 17 00:00:00 2001
From: Herve Boutemy
Date: Mon, 6 Apr 2015 01:19:34 +0000
Subject: [PATCH 012/153] moved Jira from Codehaus to Apache
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1671465 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 2401cf30..dc430f62 100644
--- a/pom.xml
+++ b/pom.xml
@@ -48,7 +48,7 @@ under the License.
JIRA
- http://jira.codehaus.org/browse/MDEPLOY
+ https://issues.apache.org/jira/browse/MDEPLOY
From 5ff429c5dac68c8fe8928909d809c0826a53b9be Mon Sep 17 00:00:00 2001
From: Karl Heinz Marbaise
Date: Fri, 19 Jun 2015 22:37:34 +0000
Subject: [PATCH 013/153] [MNGSITE-243] Fixed link to How to use Mirros for
Repositories
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1686511 13f79535-47bb-0310-9956-ffa450edef68
---
src/site/xdoc/download.xml.vm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/site/xdoc/download.xml.vm b/src/site/xdoc/download.xml.vm
index 7186d93a..09d4f421 100644
--- a/src/site/xdoc/download.xml.vm
+++ b/src/site/xdoc/download.xml.vm
@@ -39,7 +39,7 @@ under the License.
- We strongly encourage our users to configure a Maven repository mirror closer to their location, please read How to Use Mirrors for Repositories.
+ We strongly encourage our users to configure a Maven repository mirror closer to their location, please read How to Use Mirrors for Repositories.
From 89980bf81879217ef0f6c71ee4d80eb28d8e05ef Mon Sep 17 00:00:00 2001
From: Robert Scholte
Date: Thu, 24 Sep 2015 21:12:20 +0000
Subject: [PATCH 014/153] Result of mvn versions:update-child-modules
-DallowSnapshots -N
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1705152 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index dc430f62..9911e74f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.maven.pluginsmaven-plugins
- 27
+ 28-SNAPSHOT../maven-plugins/pom.xml
From 9b2c32c5d81f1463b4f14d249cdcd6b1a7d36886 Mon Sep 17 00:00:00 2001
From: Robert Scholte
Date: Sun, 11 Oct 2015 19:00:45 +0000
Subject: [PATCH 015/153] Merge with 3.0-branch
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1708010 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 31 +++-
.../plugin/deploy/AbstractDeployMojo.java | 47 +++---
.../maven/plugin/deploy/DeployFileMojo.java | 96 ++++++++---
.../maven/plugin/deploy/DeployMojo.java | 36 +++-
.../plugin/deploy/DeployFileMojoTest.java | 93 ++++++-----
.../maven/plugin/deploy/DeployMojoTest.java | 157 ++++++++++++------
.../deploy/stubs/ArtifactDeployerStub.java | 23 +--
.../deploy/stubs/ArtifactRepositoryStub.java | 13 +-
.../deploy/stubs/ArtifactRepositoryStub2.java | 10 ++
.../deploy/stubs/DeployArtifactStub.java | 6 +
.../target/deploy-test-file-1.0-SNAPSHOT.jar | 1 -
.../target/deploy-test-file-1.0-SNAPSHOT.pom | 28 ++++
12 files changed, 379 insertions(+), 162 deletions(-)
delete mode 100644 src/test/resources/unit/basic-deploy-pom/target/deploy-test-file-1.0-SNAPSHOT.jar
create mode 100644 src/test/resources/unit/basic-deploy-pom/target/deploy-test-file-1.0-SNAPSHOT.pom
diff --git a/pom.xml b/pom.xml
index 9911e74f..426395bc 100644
--- a/pom.xml
+++ b/pom.xml
@@ -30,7 +30,7 @@ under the License.
maven-deploy-plugin
- 2.8.3-SNAPSHOT
+ 3.0-SNAPSHOTmaven-pluginApache Maven Deploy Plugin
@@ -58,7 +58,9 @@ under the License.
- 2.2.1
+ 3.0
+ 1.6
+ 1.6
@@ -69,7 +71,7 @@ under the License.
org.apache.maven
- maven-project
+ maven-core${mavenVersion}
@@ -82,6 +84,13 @@ under the License.
maven-artifact${mavenVersion}
+
+
+ org.apache.maven.shared
+ maven-artifact-transfer
+ 3.0-SNAPSHOT
+
+
org.apache.maven.plugin-tools
@@ -96,7 +105,13 @@ under the License.
org.apache.maven.plugin-testingmaven-plugin-testing-harness
- 1.3
+ 2.1
+ test
+
+
+ org.apache.maven
+ maven-compat
+ ${mavenVersion}test
@@ -108,7 +123,13 @@ under the License.
junitjunit
- 3.8.2
+ 4.11
+ test
+
+
+ org.sonatype.aether
+ aether-connector-file
+ 1.7test
diff --git a/src/main/java/org/apache/maven/plugin/deploy/AbstractDeployMojo.java b/src/main/java/org/apache/maven/plugin/deploy/AbstractDeployMojo.java
index 06532d07..d8d29f87 100644
--- a/src/main/java/org/apache/maven/plugin/deploy/AbstractDeployMojo.java
+++ b/src/main/java/org/apache/maven/plugin/deploy/AbstractDeployMojo.java
@@ -19,21 +19,23 @@
* under the License.
*/
-import java.io.File;
+import java.util.Collection;
import java.util.Map;
import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.deployer.ArtifactDeployer;
-import org.apache.maven.artifact.deployer.ArtifactDeploymentException;
import org.apache.maven.artifact.factory.ArtifactFactory;
import org.apache.maven.artifact.repository.ArtifactRepository;
-import org.apache.maven.artifact.repository.ArtifactRepositoryFactory;
+import org.apache.maven.artifact.repository.ArtifactRepositoryPolicy;
+import org.apache.maven.artifact.repository.MavenArtifactRepository;
import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
+import org.apache.maven.execution.MavenSession;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.Component;
import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.shared.artifact.deploy.ArtifactDeployer;
+import org.apache.maven.shared.artifact.deploy.ArtifactDeployerException;
/**
* @version $Id$
@@ -52,12 +54,6 @@ public abstract class AbstractDeployMojo
@Component
protected ArtifactFactory artifactFactory;
- /**
- * Component used to create a repository.
- */
- @Component
- ArtifactRepositoryFactory repositoryFactory;
-
/**
* Map that contains the layouts.
*/
@@ -90,6 +86,9 @@ public abstract class AbstractDeployMojo
@Parameter( property = "retryFailedDeploymentCount", defaultValue = "1" )
private int retryFailedDeploymentCount;
+ @Parameter( defaultValue = "${session}", readonly = true, required = true )
+ private MavenSession session;
+
/* Setters and Getters */
public ArtifactDeployer getDeployer()
@@ -146,20 +145,21 @@ int getRetryFailedDeploymentCount()
/**
* Deploy an artifact from a particular file.
- *
- * @param source the file to deploy
- * @param artifact the artifact definition
+ * @param artifacts the artifact definitions
* @param deploymentRepository the repository to deploy to
* @param localRepository the local repository to install into
* @param retryFailedDeploymentCount TODO
- * @throws ArtifactDeploymentException if an error occurred deploying the artifact
+ *
+ * @throws ArtifactDeployerException if an error occurred deploying the artifact
*/
- protected void deploy( File source, Artifact artifact, ArtifactRepository deploymentRepository,
+ protected void deploy( Collection artifacts, ArtifactRepository deploymentRepository,
ArtifactRepository localRepository, int retryFailedDeploymentCount )
- throws ArtifactDeploymentException
+ throws ArtifactDeployerException
{
+
+ // for now retry means redeploy the complete artifacts collection
int retryFailedDeploymentCounter = Math.max( 1, Math.min( 10, retryFailedDeploymentCount ) );
- ArtifactDeploymentException exception = null;
+ ArtifactDeployerException exception = null;
for ( int count = 0; count < retryFailedDeploymentCounter; count++ )
{
try
@@ -169,11 +169,12 @@ protected void deploy( File source, Artifact artifact, ArtifactRepository deploy
getLog().info( "Retrying deployment attempt " + ( count + 1 ) + " of "
+ retryFailedDeploymentCounter );
}
- getDeployer().deploy( source, artifact, deploymentRepository, localRepository );
+
+ getDeployer().deploy( session.getProjectBuildingRequest(), artifacts );
exception = null;
break;
}
- catch ( ArtifactDeploymentException e )
+ catch ( ArtifactDeployerException e )
{
if ( count + 1 < retryFailedDeploymentCounter )
{
@@ -191,4 +192,12 @@ protected void deploy( File source, Artifact artifact, ArtifactRepository deploy
throw exception;
}
}
+
+ protected ArtifactRepository createDeploymentArtifactRepository( String id, String url,
+ ArtifactRepositoryLayout layout,
+ boolean uniqueVersion2 )
+ {
+ return new MavenArtifactRepository( id, url, layout, new ArtifactRepositoryPolicy(),
+ new ArtifactRepositoryPolicy() );
+ }
}
diff --git a/src/main/java/org/apache/maven/plugin/deploy/DeployFileMojo.java b/src/main/java/org/apache/maven/plugin/deploy/DeployFileMojo.java
index db134b42..1b6fd977 100644
--- a/src/main/java/org/apache/maven/plugin/deploy/DeployFileMojo.java
+++ b/src/main/java/org/apache/maven/plugin/deploy/DeployFileMojo.java
@@ -27,6 +27,7 @@
import java.io.OutputStream;
import java.io.Reader;
import java.io.Writer;
+import java.util.ArrayList;
import java.util.Enumeration;
import java.util.List;
import java.util.jar.JarEntry;
@@ -34,14 +35,19 @@
import java.util.regex.Pattern;
import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.deployer.ArtifactDeploymentException;
import org.apache.maven.artifact.metadata.ArtifactMetadata;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
+import org.apache.maven.model.InputLocation;
import org.apache.maven.model.Model;
import org.apache.maven.model.Parent;
+import org.apache.maven.model.building.DefaultModelBuildingRequest;
+import org.apache.maven.model.building.ModelBuildingRequest;
+import org.apache.maven.model.building.ModelProblemCollector;
+import org.apache.maven.model.building.ModelProblem.Severity;
import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
import org.apache.maven.model.io.xpp3.MavenXpp3Writer;
+import org.apache.maven.model.validation.ModelValidator;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.Component;
@@ -50,8 +56,7 @@
import org.apache.maven.project.MavenProject;
import org.apache.maven.project.MavenProjectHelper;
import org.apache.maven.project.artifact.ProjectArtifactMetadata;
-import org.apache.maven.project.validation.ModelValidationResult;
-import org.apache.maven.project.validation.ModelValidator;
+import org.apache.maven.shared.artifact.deploy.ArtifactDeployerException;
import org.codehaus.plexus.util.FileUtils;
import org.codehaus.plexus.util.IOUtil;
import org.codehaus.plexus.util.ReaderFactory;
@@ -145,6 +150,7 @@ public class DeployFileMojo
/**
* The type of remote repository layout to deploy to. Try legacy for a Maven 1.x-style repository layout.
*/
+ @Deprecated
@Parameter( property = "repositoryLayout", defaultValue = "default" )
private String repositoryLayout;
@@ -314,7 +320,7 @@ public void execute()
ArtifactRepositoryLayout layout = getLayout( repositoryLayout );
ArtifactRepository deploymentRepository =
- repositoryFactory.createDeploymentArtifactRepository( repositoryId, url, layout, uniqueVersion );
+ createDeploymentArtifactRepository( repositoryId, url, layout, uniqueVersion );
String protocol = deploymentRepository.getProtocol();
@@ -354,14 +360,13 @@ else if ( generatePom )
project.setArtifact( artifact );
- try
- {
- deploy( file, artifact, deploymentRepository, getLocalRepository(), getRetryFailedDeploymentCount() );
- }
- catch ( ArtifactDeploymentException e )
- {
- throw new MojoExecutionException( e.getMessage(), e );
- }
+ artifact.setFile( file );
+
+ artifact.setRepository( deploymentRepository );
+
+ List deployableArtifacts = new ArrayList();
+
+ deployableArtifacts.add( artifact );
if ( sources != null )
{
@@ -455,23 +460,21 @@ else if ( generatePom )
}
}
- @SuppressWarnings( "unchecked" )
List attachedArtifacts = project.getAttachedArtifacts();
for ( Artifact attached : attachedArtifacts )
{
- try
- {
- deploy( attached.getFile(), attached, deploymentRepository, getLocalRepository(),
- getRetryFailedDeploymentCount() );
- }
- catch ( ArtifactDeploymentException e )
- {
- throw new MojoExecutionException( "Error deploying attached artifact " + attached.getFile() + ": "
- + e.getMessage(), e );
- }
+ deployableArtifacts.add( attached );
}
+ try
+ {
+ deploy( deployableArtifacts, deploymentRepository, getLocalRepository(), getRetryFailedDeploymentCount() );
+ }
+ catch ( ArtifactDeployerException e )
+ {
+ throw new MojoExecutionException( e.getMessage(), e );
+ }
}
/**
@@ -598,12 +601,16 @@ private void validateArtifactInformation()
{
Model model = generateModel();
- ModelValidationResult result = modelValidator.validate( model );
+ ModelBuildingRequest buildingRequest = new DefaultModelBuildingRequest();
- if ( result.getMessageCount() > 0 )
+ DeployModelProblemCollector problemCollector = new DeployModelProblemCollector();
+
+ modelValidator.validateEffectiveModel( model, buildingRequest, problemCollector );
+
+ if ( problemCollector.getMessageCount() > 0 )
{
throw new MojoExecutionException( "The artifact information is incomplete or not valid:\n"
- + result.render( " " ) );
+ + problemCollector.render( " " ) );
}
}
@@ -687,4 +694,41 @@ void setClassifier( String classifier )
{
this.classifier = classifier;
}
+
+ private static class DeployModelProblemCollector implements ModelProblemCollector
+ {
+ /** */
+ private static final String NEWLINE = System.getProperty( "line.separator" );
+
+ /** */
+ private List messages = new ArrayList();
+
+ @Override
+ public void add( Severity severity, String message, InputLocation location, Exception cause )
+ {
+ messages.add( message );
+ }
+
+ public int getMessageCount()
+ {
+ return messages.size();
+ }
+
+ public String render( String indentation )
+ {
+ if ( messages.size() == 0 )
+ {
+ return indentation + "There were no validation errors.";
+ }
+
+ StringBuilder message = new StringBuilder();
+
+ for ( int i = 0; i < messages.size(); i++ )
+ {
+ message.append( indentation + "[" + i + "] " + messages.get( i ).toString() + NEWLINE );
+ }
+
+ return message.toString();
+ }
+ };
}
diff --git a/src/main/java/org/apache/maven/plugin/deploy/DeployMojo.java b/src/main/java/org/apache/maven/plugin/deploy/DeployMojo.java
index 7cf73378..4dd03099 100644
--- a/src/main/java/org/apache/maven/plugin/deploy/DeployMojo.java
+++ b/src/main/java/org/apache/maven/plugin/deploy/DeployMojo.java
@@ -29,7 +29,6 @@
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.ArtifactUtils;
-import org.apache.maven.artifact.deployer.ArtifactDeploymentException;
import org.apache.maven.artifact.metadata.ArtifactMetadata;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
@@ -40,6 +39,7 @@
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.project.MavenProject;
import org.apache.maven.project.artifact.ProjectArtifactMetadata;
+import org.apache.maven.shared.artifact.deploy.ArtifactDeployerException;
/**
* Deploys an artifact to remote repository.
@@ -174,11 +174,12 @@ else if ( addedDeployRequest )
private void deployProject( DeployRequest request )
throws MojoExecutionException, MojoFailureException
{
+ List deployableArtifacts = new ArrayList();
+
Artifact artifact = request.getProject().getArtifact();
String packaging = request.getProject().getPackaging();
File pomFile = request.getProject().getFile();
- @SuppressWarnings( "unchecked" )
List attachedArtifacts = request.getProject().getAttachedArtifacts();
ArtifactRepository repo =
@@ -205,19 +206,25 @@ private void deployProject( DeployRequest request )
ArtifactMetadata metadata = new ProjectArtifactMetadata( artifact, pomFile );
artifact.addMetadata( metadata );
}
+ else
+ {
+ artifact.setFile( pomFile );
+ }
if ( request.isUpdateReleaseInfo() )
{
artifact.setRelease( true );
}
+ artifact.setRepository( repo );
+
int retryFailedDeploymentCount = request.getRetryFailedDeploymentCount();
try
{
if ( isPomArtifact )
{
- deploy( pomFile, artifact, repo, getLocalRepository(), retryFailedDeploymentCount );
+ deployableArtifacts.add( artifact );
}
else
{
@@ -225,7 +232,7 @@ private void deployProject( DeployRequest request )
if ( file != null && file.isFile() )
{
- deploy( file, artifact, repo, getLocalRepository(), retryFailedDeploymentCount );
+ deployableArtifacts.add( artifact );
}
else if ( !attachedArtifacts.isEmpty() )
{
@@ -240,7 +247,7 @@ else if ( !attachedArtifacts.isEmpty() )
pomArtifact.setRelease( true );
}
- deploy( pomFile, pomArtifact, repo, getLocalRepository(), retryFailedDeploymentCount );
+ deployableArtifacts.add( pomArtifact );
// propagate the timestamped version to the main artifact for the attached artifacts to pick it up
artifact.setResolvedVersion( pomArtifact.getVersion() );
@@ -254,10 +261,23 @@ else if ( !attachedArtifacts.isEmpty() )
for ( Artifact attached : attachedArtifacts )
{
- deploy( attached.getFile(), attached, repo, getLocalRepository(), retryFailedDeploymentCount );
+ // This is here when AttachedArtifact is used, like m-sources-plugin:2.0.4
+ try
+ {
+ attached.setRepository( repo );
+ }
+ catch ( UnsupportedOperationException e )
+ {
+ getLog().warn( attached.getId() + " has been attached with deprecated code, "
+ + "try to upgrade the responsible plugin" );
+ }
+
+ deployableArtifacts.add( attached );
}
+
+ deploy( deployableArtifacts, repo, getLocalRepository(), retryFailedDeploymentCount );
}
- catch ( ArtifactDeploymentException e )
+ catch ( ArtifactDeployerException e )
{
throw new MojoExecutionException( e.getMessage(), e );
}
@@ -303,7 +323,7 @@ else if ( !ArtifactUtils.isSnapshot( project.getVersion() ) && altReleaseDeploym
ArtifactRepositoryLayout repoLayout = getLayout( layout );
- repo = repositoryFactory.createDeploymentArtifactRepository( id, url, repoLayout, true );
+ repo = createDeploymentArtifactRepository( id, url, repoLayout, true );
}
}
diff --git a/src/test/java/org/apache/maven/plugin/deploy/DeployFileMojoTest.java b/src/test/java/org/apache/maven/plugin/deploy/DeployFileMojoTest.java
index ccf8775d..e3e4c40e 100644
--- a/src/test/java/org/apache/maven/plugin/deploy/DeployFileMojoTest.java
+++ b/src/test/java/org/apache/maven/plugin/deploy/DeployFileMojoTest.java
@@ -19,14 +19,25 @@
* under the License.
*/
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import org.apache.maven.artifact.Artifact;
+import org.apache.maven.execution.MavenSession;
import org.apache.maven.model.Model;
+import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.testing.AbstractMojoTestCase;
import org.apache.maven.plugin.testing.stubs.MavenProjectStub;
+import org.apache.maven.project.ProjectBuildingRequest;
+import org.apache.maven.repository.internal.MavenRepositorySystemSession;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.sonatype.aether.impl.internal.SimpleLocalRepositoryManager;
/**
* @author Allan Ramirez
@@ -34,6 +45,8 @@
public class DeployFileMojoTest
extends AbstractMojoTestCase
{
+ private String LOCAL_REPO = getBasedir() + "/target/local-repo";
+
private List expectedFiles;
private List fileList;
@@ -42,6 +55,12 @@ public class DeployFileMojoTest
MavenProjectStub projectStub = new MavenProjectStub();
+ @Mock
+ private MavenSession session;
+
+ @InjectMocks
+ private DeployFileMojo mojo;
+
public void setUp()
throws Exception
{
@@ -62,7 +81,7 @@ public void testDeployTestEnvironment()
{
File testPom = new File( getBasedir(), "target/test-classes/unit/deploy-file-test/plugin-config.xml" );
- DeployFileMojo mojo = (DeployFileMojo) lookupMojo( "deploy-file", testPom );
+ AbstractDeployMojo mojo = (AbstractDeployMojo) lookupMojo( "deploy-file", testPom );
assertNotNull( mojo );
}
@@ -72,10 +91,18 @@ public void testBasicDeployFile()
{
File testPom = new File( getBasedir(), "target/test-classes/unit/deploy-file-test/plugin-config.xml" );
- DeployFileMojo mojo = (DeployFileMojo) lookupMojo( "deploy-file", testPom );
+ mojo = (DeployFileMojo) lookupMojo( "deploy-file", testPom );
+ MockitoAnnotations.initMocks( this );
+
assertNotNull( mojo );
+ ProjectBuildingRequest buildingRequest = mock ( ProjectBuildingRequest.class );
+ when( session.getProjectBuildingRequest() ).thenReturn( buildingRequest );
+ MavenRepositorySystemSession repositorySession = new MavenRepositorySystemSession();
+ repositorySession.setLocalRepositoryManager( new SimpleLocalRepositoryManager( LOCAL_REPO ) );
+ when( buildingRequest.getRepositorySession() ).thenReturn( repositorySession );
+
setVariableValueToObject( mojo, "project", projectStub );
String groupId = (String) getVariableValueFromObject( mojo, "groupId" );
@@ -167,9 +194,17 @@ public void testDeployIfClassifierIsSet()
{
File testPom = new File( getBasedir(), "target/test-classes/unit/deploy-file-classifier/plugin-config.xml" );
- DeployFileMojo mojo = (DeployFileMojo) lookupMojo( "deploy-file", testPom );
+ mojo = (DeployFileMojo) lookupMojo( "deploy-file", testPom );
+ MockitoAnnotations.initMocks( this );
+
assertNotNull( mojo );
+
+ ProjectBuildingRequest buildingRequest = mock ( ProjectBuildingRequest.class );
+ when( session.getProjectBuildingRequest() ).thenReturn( buildingRequest );
+ MavenRepositorySystemSession repositorySession = new MavenRepositorySystemSession();
+ repositorySession.setLocalRepositoryManager( new SimpleLocalRepositoryManager( LOCAL_REPO ) );
+ when( buildingRequest.getRepositorySession() ).thenReturn( repositorySession );
setVariableValueToObject( mojo, "project", projectStub );
@@ -209,9 +244,17 @@ public void testDeployIfArtifactIsNotJar()
{
File testPom = new File( getBasedir(), "target/test-classes/unit/deploy-file-artifact-not-jar/plugin-config.xml" );
- DeployFileMojo mojo = (DeployFileMojo) lookupMojo( "deploy-file", testPom );
+ mojo = (DeployFileMojo) lookupMojo( "deploy-file", testPom );
+ MockitoAnnotations.initMocks( this );
+
assertNotNull( mojo );
+
+ ProjectBuildingRequest buildingRequest = mock ( ProjectBuildingRequest.class );
+ when( session.getProjectBuildingRequest() ).thenReturn( buildingRequest );
+ MavenRepositorySystemSession repositorySession = new MavenRepositorySystemSession();
+ repositorySession.setLocalRepositoryManager( new SimpleLocalRepositoryManager( LOCAL_REPO ) );
+ when( buildingRequest.getRepositorySession() ).thenReturn( repositorySession );
setVariableValueToObject( mojo, "project", projectStub );
@@ -241,7 +284,7 @@ public void testDeployIfRepositoryLayoutIsLegacy()
{
File testPom = new File( getBasedir(), "target/test-classes/unit/deploy-file-legacy-repository-layout/plugin-config.xml" );
- DeployFileMojo mojo = (DeployFileMojo) lookupMojo( "deploy-file", testPom );
+ AbstractDeployMojo mojo = (AbstractDeployMojo) lookupMojo( "deploy-file", testPom );
assertNotNull( mojo );
@@ -257,40 +300,16 @@ public void testDeployIfRepositoryLayoutIsLegacy()
assertEquals( "legacy", repositoryLayout );
- mojo.execute();
-
- File artifactFile = new File( remoteRepo, "deploy-file-legacy-repository-layout/" + groupId + "/jars/" + artifactId + "-" + version + ".jar" );
-
- assertTrue( artifactFile.exists() );
-
- //check the remote-repo
- expectedFiles = new ArrayList();
- fileList = new ArrayList();
-
- File repo = new File( remoteRepo, "deploy-file-legacy-repository-layout" );
-
- File[] files = repo.listFiles();
-
- for (File file : files) {
- addFileToList(file, fileList);
+ try
+ {
+ mojo.execute();
+ fail( "legacy is not supported anymore" );
+ }
+ catch ( MojoExecutionException e )
+ {
+ assertEquals( "Invalid repository layout: legacy", e.getMessage() );
}
- expectedFiles.add( "org.apache.maven.test" );
- expectedFiles.add( "jars" );
- expectedFiles.add( "maven-deploy-file-test-1.0.jar" );
- expectedFiles.add( "maven-deploy-file-test-1.0.jar.md5" );
- expectedFiles.add( "maven-deploy-file-test-1.0.jar.sha1" );
- expectedFiles.add( "poms" );
- expectedFiles.add( "maven-deploy-file-test-1.0.pom" );
- expectedFiles.add( "maven-deploy-file-test-1.0.pom.md5" );
- expectedFiles.add( "maven-deploy-file-test-1.0.pom.sha1" );
- expectedFiles.add( "maven-metadata.xml" );
- expectedFiles.add( "maven-metadata.xml.md5" );
- expectedFiles.add( "maven-metadata.xml.sha1" );
-
- assertEquals( expectedFiles.size(), fileList.size() );
-
- assertEquals( 0, getSizeOfExpectedFiles( fileList, expectedFiles ) );
}
private void addFileToList( File file, List fileList )
diff --git a/src/test/java/org/apache/maven/plugin/deploy/DeployMojoTest.java b/src/test/java/org/apache/maven/plugin/deploy/DeployMojoTest.java
index c2562ce4..738e00b6 100644
--- a/src/test/java/org/apache/maven/plugin/deploy/DeployMojoTest.java
+++ b/src/test/java/org/apache/maven/plugin/deploy/DeployMojoTest.java
@@ -20,6 +20,7 @@
*/
import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.when;
import java.io.File;
@@ -28,18 +29,31 @@
import java.util.List;
import java.util.Properties;
+import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.repository.ArtifactRepositoryFactory;
import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
+import org.apache.maven.execution.MavenSession;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.deploy.stubs.ArtifactDeployerStub;
import org.apache.maven.plugin.deploy.stubs.ArtifactRepositoryStub;
-import org.apache.maven.plugin.deploy.stubs.AttachedArtifactStub;
import org.apache.maven.plugin.deploy.stubs.DeployArtifactStub;
import org.apache.maven.plugin.testing.AbstractMojoTestCase;
import org.apache.maven.plugin.testing.stubs.MavenProjectStub;
import org.apache.maven.project.MavenProject;
+import org.apache.maven.project.ProjectBuildingRequest;
+import org.apache.maven.repository.internal.MavenRepositorySystemSession;
+import org.apache.maven.shared.artifact.deploy.ArtifactDeployer;
import org.codehaus.plexus.util.FileUtils;
+import org.junit.Assume;
+import org.junit.Ignore;
+import org.junit.internal.builders.IgnoredBuilder;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.sonatype.aether.RepositorySystemSession;
+import org.sonatype.aether.impl.internal.SimpleLocalRepositoryManager;
+import org.sonatype.aether.repository.LocalRepositoryManager;
/**
* @author Allan Ramirez
@@ -58,7 +72,13 @@ public class DeployMojoTest
DeployArtifactStub artifact;
MavenProjectStub project = new MavenProjectStub();
+
+ @Mock
+ private MavenSession session;
+ @InjectMocks
+ private DeployMojo mojo;
+
public void setUp()
throws Exception
{
@@ -79,6 +99,8 @@ public void setUp()
{
FileUtils.deleteDirectory( remoteRepo );
}
+
+
}
public void tearDown()
@@ -106,13 +128,20 @@ public void testDeployTestEnvironment()
public void testBasicDeploy()
throws Exception
{
- File testPom = new File( getBasedir(),
- "target/test-classes/unit/basic-deploy-test/plugin-config.xml" );
+ File testPom = new File( getBasedir(), "target/test-classes/unit/basic-deploy-test/plugin-config.xml" );
- DeployMojo mojo = ( DeployMojo ) lookupMojo( "deploy", testPom );
+ mojo = ( DeployMojo ) lookupMojo( "deploy", testPom );
+
+ MockitoAnnotations.initMocks( this );
assertNotNull( mojo );
+ ProjectBuildingRequest buildingRequest = mock ( ProjectBuildingRequest.class );
+ when( session.getProjectBuildingRequest() ).thenReturn( buildingRequest );
+ MavenRepositorySystemSession repositorySession = new MavenRepositorySystemSession();
+ repositorySession.setLocalRepositoryManager( new SimpleLocalRepositoryManager( LOCAL_REPO ) );
+ when( buildingRequest.getRepositorySession() ).thenReturn( repositorySession );
+
File file = new File( getBasedir(),
"target/test-classes/unit/basic-deploy-test/target/" +
"deploy-test-file-1.0-SNAPSHOT.jar" );
@@ -155,10 +184,13 @@ public void testBasicDeploy()
expectedFiles.add( "maven-deploy-test" );
expectedFiles.add( "1.0-SNAPSHOT" );
expectedFiles.add( "maven-metadata-deploy-test.xml" );
- expectedFiles.add( "maven-deploy-test-1.0-SNAPSHOT.jar" );
- expectedFiles.add( "maven-deploy-test-1.0-SNAPSHOT.pom" );
+ // expectedFiles.add( "maven-deploy-test-1.0-SNAPSHOT.jar" );
+ // expectedFiles.add( "maven-deploy-test-1.0-SNAPSHOT.pom" );
// as we are in SNAPSHOT the file is here twice
expectedFiles.add( "maven-metadata-deploy-test.xml" );
+ // extra Aether files
+ expectedFiles.add( "resolver-status.properties" );
+ expectedFiles.add( "resolver-status.properties" );
File localRepo = new File( LOCAL_REPO, "" );
@@ -269,10 +301,24 @@ public void testBasicDeployWithPackagingAsPom()
File testPom = new File( getBasedir(),
"target/test-classes/unit/basic-deploy-pom/plugin-config.xml" );
- DeployMojo mojo = ( DeployMojo ) lookupMojo( "deploy", testPom );
+ mojo = ( DeployMojo ) lookupMojo( "deploy", testPom );
+
+ MockitoAnnotations.initMocks( this );
assertNotNull( mojo );
+ ProjectBuildingRequest buildingRequest = mock ( ProjectBuildingRequest.class );
+ when( session.getProjectBuildingRequest() ).thenReturn( buildingRequest );
+ MavenRepositorySystemSession repositorySession = new MavenRepositorySystemSession();
+ repositorySession.setLocalRepositoryManager( new SimpleLocalRepositoryManager( LOCAL_REPO ) );
+ when( buildingRequest.getRepositorySession() ).thenReturn( repositorySession );
+
+ File pomFile = new File( getBasedir(),
+ "target/test-classes/unit/basic-deploy-pom/target/" +
+ "deploy-test-file-1.0-SNAPSHOT.pom" );
+
+ assertTrue( pomFile.exists() );
+
MavenProject project = (MavenProject) getVariableValueFromObject( mojo, "project" );
setVariableValueToObject( mojo, "reactorProjects", Collections.singletonList( project ) );
@@ -281,6 +327,8 @@ public void testBasicDeployWithPackagingAsPom()
artifact.setArtifactHandlerExtension( project.getPackaging() );
+ artifact.setFile( pomFile );
+
ArtifactRepositoryStub repo = getRepoStub( mojo );
repo.setAppendToUrl( "basic-deploy-pom" );
@@ -324,11 +372,18 @@ public void testUpdateReleaseParamSetToTrue()
{
File testPom = new File( getBasedir(),
"target/test-classes/unit/basic-deploy-pom/plugin-config.xml" );
+ mojo = ( DeployMojo ) lookupMojo( "deploy", testPom );
- DeployMojo mojo = ( DeployMojo ) lookupMojo( "deploy", testPom );
+ MockitoAnnotations.initMocks( this );
assertNotNull( mojo );
+ ProjectBuildingRequest buildingRequest = mock ( ProjectBuildingRequest.class );
+ when( session.getProjectBuildingRequest() ).thenReturn( buildingRequest );
+ MavenRepositorySystemSession repositorySession = new MavenRepositorySystemSession();
+ repositorySession.setLocalRepositoryManager( new SimpleLocalRepositoryManager( LOCAL_REPO ) );
+ when( buildingRequest.getRepositorySession() ).thenReturn( repositorySession );
+
boolean updateReleaseInfo = (Boolean) getVariableValueFromObject(mojo, "updateReleaseInfo");
assertTrue( updateReleaseInfo );
@@ -389,9 +444,17 @@ public void testDeployWithAttachedArtifacts()
"target/test-classes/unit/basic-deploy-with-attached-artifacts/" +
"plugin-config.xml" );
- DeployMojo mojo = ( DeployMojo ) lookupMojo( "deploy", testPom );
-
+ mojo = ( DeployMojo ) lookupMojo( "deploy", testPom );
+
+ MockitoAnnotations.initMocks( this );
+
assertNotNull( mojo );
+
+ ProjectBuildingRequest buildingRequest = mock ( ProjectBuildingRequest.class );
+ when( session.getProjectBuildingRequest() ).thenReturn( buildingRequest );
+ MavenRepositorySystemSession repositorySession = new MavenRepositorySystemSession();
+ repositorySession.setLocalRepositoryManager( new SimpleLocalRepositoryManager( LOCAL_REPO ) );
+ when( buildingRequest.getRepositorySession() ).thenReturn( repositorySession );
MavenProject project = (MavenProject) getVariableValueFromObject( mojo, "project" );
@@ -405,28 +468,16 @@ public void testDeployWithAttachedArtifacts()
artifact.setFile( file );
+ for( Artifact attachment :project.getAttachedArtifacts() )
+ {}
+
- @SuppressWarnings( "unchecked" )
- List attachedArtifacts = project.getAttachedArtifacts();
-
ArtifactRepositoryStub repo = getRepoStub( mojo );
repo.setAppendToUrl( "basic-deploy-with-attached-artifacts" );
mojo.execute();
- String packaging = project.getPackaging();
-
- for( AttachedArtifactStub attachedArtifact : attachedArtifacts )
- {
- File deployedArtifact = new File( remoteRepo, "basic-deploy-with-attached-artifacts" + "/" +
- attachedArtifact.getGroupId().replace( '.', '/' ) + "/" +
- attachedArtifact.getArtifactId() + "/" +
- attachedArtifact.getVersion() + "/" + attachedArtifact.getArtifactId() + "-" +
- attachedArtifact.getVersion() + "." + packaging );
- assertTrue( deployedArtifact.exists() );
- }
-
//check the artifacts in remote repository
List expectedFiles = new ArrayList();
List fileList = new ArrayList();
@@ -476,8 +527,8 @@ public void testDeployWithAttachedArtifacts()
assertEquals( 0, getSizeOfExpectedFiles( fileList, expectedFiles ) );
}
-
- public void testBasicDeployWithScpAsProtocol()
+ @Ignore( "SCP is not part of Maven3 distribution. Aether handles transport extensions." )
+ public void _testBasicDeployWithScpAsProtocol()
throws Exception
{
String originalUserHome = System.getProperty( "user.home" );
@@ -496,7 +547,7 @@ public void testBasicDeployWithScpAsProtocol()
File testPom = new File( getBasedir(),
"target/test-classes/unit/basic-deploy-scp/plugin-config.xml" );
- DeployMojo mojo = ( DeployMojo ) lookupMojo( "deploy", testPom );
+ mojo = ( DeployMojo ) lookupMojo( "deploy", testPom );
assertNotNull( mojo );
@@ -543,40 +594,45 @@ public void testBasicDeployWithScpAsProtocol()
FileUtils.deleteDirectory( sshFile );
}
- public void testAltSnapshotDeploymentRepository() throws Exception
+ public void testAltSnapshotDeploymentRepository()
+ throws Exception
{
- DeployMojo mojo = new DeployMojo();
-
+ DeployMojo mojo = spy( new DeployMojo() );
+
ArtifactRepositoryLayout repositoryLayout = mock( ArtifactRepositoryLayout.class );
setVariableValueToObject( mojo, "repositoryLayouts", Collections.singletonMap( "default", repositoryLayout ) );
- ArtifactRepositoryFactory repositoryFactory = mock( ArtifactRepositoryFactory.class );
- ArtifactRepository repository = mock( ArtifactRepository.class);
- when( repositoryFactory.createDeploymentArtifactRepository( "altSnapshotDeploymentRepository", "http://localhost", repositoryLayout, true ) ).thenReturn( repository );
- setVariableValueToObject( mojo, "repositoryFactory", repositoryFactory );
-
+ ArtifactRepository repository = mock( ArtifactRepository.class );
+ when(
+ mojo.createDeploymentArtifactRepository( "altSnapshotDeploymentRepository", "http://localhost",
+ repositoryLayout, true ) ).thenReturn( repository );
+
project.setVersion( "1.0-SNAPSHOT" );
-
- assertEquals( repository, mojo.getDeploymentRepository( project, null, null, "altSnapshotDeploymentRepository::default::http://localhost" ) );
+
+ assertEquals( repository,
+ mojo.getDeploymentRepository( project, null, null,
+ "altSnapshotDeploymentRepository::default::http://localhost" ) );
}
- public void testAltReleaseDeploymentRepository() throws Exception
+ public void testAltReleaseDeploymentRepository()
+ throws Exception
{
- DeployMojo mojo = new DeployMojo();
-
+ DeployMojo mojo = spy( new DeployMojo() );
+
ArtifactRepositoryLayout repositoryLayout = mock( ArtifactRepositoryLayout.class );
setVariableValueToObject( mojo, "repositoryLayouts", Collections.singletonMap( "default", repositoryLayout ) );
- ArtifactRepositoryFactory repositoryFactory = mock( ArtifactRepositoryFactory.class );
- ArtifactRepository repository = mock( ArtifactRepository.class);
- when( repositoryFactory.createDeploymentArtifactRepository( "altReleaseDeploymentRepository", "http://localhost", repositoryLayout, true ) ).thenReturn( repository );
- setVariableValueToObject( mojo, "repositoryFactory", repositoryFactory );
-
+ ArtifactRepository repository = mock( ArtifactRepository.class );
+ when(
+ mojo.createDeploymentArtifactRepository( "altReleaseDeploymentRepository", "http://localhost",
+ repositoryLayout, true ) ).thenReturn( repository );
+
project.setVersion( "1.0" );
-
- assertEquals( repository, mojo.getDeploymentRepository( project, null, "altReleaseDeploymentRepository::default::http://localhost", null ) );
- }
+ assertEquals( repository,
+ mojo.getDeploymentRepository( project, null,
+ "altReleaseDeploymentRepository::default::http://localhost", null ) );
+ }
private void addFileToList( File file, List fileList )
{
@@ -600,6 +656,9 @@ private int getSizeOfExpectedFiles( List fileList, List expected
{
for( String fileName : fileList )
{
+ // translate uniqueVersion to -SNAPSHOT
+ fileName = fileName.replaceFirst( "-\\d{8}\\.\\d{6}-\\d+", "-SNAPSHOT" );
+
if( !expectedFiles.remove( fileName ) )
{
fail( fileName + " is not included in the expected files" );
diff --git a/src/test/java/org/apache/maven/plugin/deploy/stubs/ArtifactDeployerStub.java b/src/test/java/org/apache/maven/plugin/deploy/stubs/ArtifactDeployerStub.java
index 7fbad2f3..5694b5cd 100644
--- a/src/test/java/org/apache/maven/plugin/deploy/stubs/ArtifactDeployerStub.java
+++ b/src/test/java/org/apache/maven/plugin/deploy/stubs/ArtifactDeployerStub.java
@@ -19,29 +19,20 @@
* under the License.
*/
-import java.io.File;
+import java.util.Collection;
import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.deployer.ArtifactDeployer;
-import org.apache.maven.artifact.deployer.ArtifactDeploymentException;
-import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.project.ProjectBuildingRequest;
+import org.apache.maven.shared.artifact.deploy.ArtifactDeployer;
+import org.apache.maven.shared.artifact.deploy.ArtifactDeployerException;
public class ArtifactDeployerStub
implements ArtifactDeployer
{
- public void deploy( String basedir, String finalName, Artifact artifact, ArtifactRepository deploymentRepository,
- ArtifactRepository localRepository )
- throws ArtifactDeploymentException
- {
- String extension = artifact.getArtifactHandler().getExtension();
- File source = new File( basedir, finalName + "." + extension );
- deploy( source, artifact, deploymentRepository, localRepository );
- }
-
- public void deploy( File source, Artifact artifact, ArtifactRepository deploymentRepository,
- ArtifactRepository localRepository )
- throws ArtifactDeploymentException
+ @Override
+ public void deploy( ProjectBuildingRequest request, Collection mavenArtifacts )
+ throws ArtifactDeployerException
{
// does nothing
}
diff --git a/src/test/java/org/apache/maven/plugin/deploy/stubs/ArtifactRepositoryStub.java b/src/test/java/org/apache/maven/plugin/deploy/stubs/ArtifactRepositoryStub.java
index 099ba2b4..51c4c27e 100644
--- a/src/test/java/org/apache/maven/plugin/deploy/stubs/ArtifactRepositoryStub.java
+++ b/src/test/java/org/apache/maven/plugin/deploy/stubs/ArtifactRepositoryStub.java
@@ -25,9 +25,10 @@
import org.apache.maven.artifact.repository.ArtifactRepositoryPolicy;
import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout;
+import org.apache.maven.plugin.testing.stubs.StubArtifactRepository;
public class ArtifactRepositoryStub
- implements ArtifactRepository
+ extends StubArtifactRepository
{
private boolean blacklisted;
@@ -36,6 +37,16 @@ public class ArtifactRepositoryStub
private String url;
private String basedir = System.getProperty( "basedir" );
+
+ public ArtifactRepositoryStub()
+ {
+ super( null );
+ }
+
+ public ArtifactRepositoryStub( String dir )
+ {
+ super( dir );
+ }
public String pathOf( Artifact artifact )
{
diff --git a/src/test/java/org/apache/maven/plugin/deploy/stubs/ArtifactRepositoryStub2.java b/src/test/java/org/apache/maven/plugin/deploy/stubs/ArtifactRepositoryStub2.java
index 2e17e458..3929a70e 100644
--- a/src/test/java/org/apache/maven/plugin/deploy/stubs/ArtifactRepositoryStub2.java
+++ b/src/test/java/org/apache/maven/plugin/deploy/stubs/ArtifactRepositoryStub2.java
@@ -24,6 +24,16 @@ public class ArtifactRepositoryStub2
{
private String protocol;
+ public ArtifactRepositoryStub2()
+ {
+ super();
+ }
+
+ public ArtifactRepositoryStub2( String dir )
+ {
+ super( dir );
+ }
+
public String getUrl()
{
return "file://" + System.getProperty( "basedir" ) + "/target/remote-repo/basic-deploy-scp";
diff --git a/src/test/java/org/apache/maven/plugin/deploy/stubs/DeployArtifactStub.java b/src/test/java/org/apache/maven/plugin/deploy/stubs/DeployArtifactStub.java
index e34c5879..93285046 100644
--- a/src/test/java/org/apache/maven/plugin/deploy/stubs/DeployArtifactStub.java
+++ b/src/test/java/org/apache/maven/plugin/deploy/stubs/DeployArtifactStub.java
@@ -61,6 +61,12 @@ public String getBaseVersion()
return getVersion();
}
+ @Override
+ public String getType()
+ {
+ return "jar";
+ }
+
public void setFile( File file )
{
this.file = file;
diff --git a/src/test/resources/unit/basic-deploy-pom/target/deploy-test-file-1.0-SNAPSHOT.jar b/src/test/resources/unit/basic-deploy-pom/target/deploy-test-file-1.0-SNAPSHOT.jar
deleted file mode 100644
index 6f5f2f81..00000000
--- a/src/test/resources/unit/basic-deploy-pom/target/deploy-test-file-1.0-SNAPSHOT.jar
+++ /dev/null
@@ -1 +0,0 @@
-This is not an actual jar
\ No newline at end of file
diff --git a/src/test/resources/unit/basic-deploy-pom/target/deploy-test-file-1.0-SNAPSHOT.pom b/src/test/resources/unit/basic-deploy-pom/target/deploy-test-file-1.0-SNAPSHOT.pom
new file mode 100644
index 00000000..095ea0f2
--- /dev/null
+++ b/src/test/resources/unit/basic-deploy-pom/target/deploy-test-file-1.0-SNAPSHOT.pom
@@ -0,0 +1,28 @@
+
+
+
+
+ 4.0.0
+ org.apache.maven.test
+ maven-deploy-file-test
+ 1.0
+ pom
+
+
\ No newline at end of file
From 8527ac1a3bbcd7b1bbe8c4ee58e30d51a0f48c5e Mon Sep 17 00:00:00 2001
From: Robert Scholte
Date: Sun, 18 Oct 2015 11:07:33 +0000
Subject: [PATCH 016/153] Replace localRepository with RepositoryManager, push
down to deploy-file since deploy doesn't use it
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1709260 13f79535-47bb-0310-9956-ffa450edef68
---
.../plugin/deploy/AbstractDeployMojo.java | 22 +++++-------------
.../maven/plugin/deploy/DeployFileMojo.java | 20 +++++++++-------
.../maven/plugin/deploy/DeployMojo.java | 5 ++--
.../unit/basic-deploy-pom/plugin-config.xml | 1 -
.../unit/basic-deploy-scp/plugin-config.xml | 1 -
.../unit/basic-deploy-test/plugin-config.xml | Bin 3490 -> 3360 bytes
.../plugin-config.xml | 3 +--
.../plugin-config.xml | 1 -
.../deploy-file-classifier/plugin-config.xml | 1 -
.../plugin-config.xml | 1 -
.../deploy-file-pom-file/plugin-config.xml | Bin 3502 -> 3372 bytes
.../unit/deploy-file-test/plugin-config.xml | 1 -
12 files changed, 21 insertions(+), 35 deletions(-)
diff --git a/src/main/java/org/apache/maven/plugin/deploy/AbstractDeployMojo.java b/src/main/java/org/apache/maven/plugin/deploy/AbstractDeployMojo.java
index d8d29f87..29ca1a58 100644
--- a/src/main/java/org/apache/maven/plugin/deploy/AbstractDeployMojo.java
+++ b/src/main/java/org/apache/maven/plugin/deploy/AbstractDeployMojo.java
@@ -60,11 +60,6 @@ public abstract class AbstractDeployMojo
@Component( role = ArtifactRepositoryLayout.class )
private Map repositoryLayouts;
- /**
- */
- @Parameter( defaultValue = "${localRepository}", required = true, readonly = true )
- private ArtifactRepository localRepository;
-
/**
* Flag whether Maven is currently in online/offline mode.
*/
@@ -101,16 +96,6 @@ public void setDeployer( ArtifactDeployer deployer )
this.deployer = deployer;
}
- public ArtifactRepository getLocalRepository()
- {
- return localRepository;
- }
-
- public void setLocalRepository( ArtifactRepository localRepository )
- {
- this.localRepository = localRepository;
- }
-
void failIfOffline()
throws MojoFailureException
{
@@ -153,7 +138,7 @@ int getRetryFailedDeploymentCount()
* @throws ArtifactDeployerException if an error occurred deploying the artifact
*/
protected void deploy( Collection artifacts, ArtifactRepository deploymentRepository,
- ArtifactRepository localRepository, int retryFailedDeploymentCount )
+ int retryFailedDeploymentCount )
throws ArtifactDeployerException
{
@@ -200,4 +185,9 @@ protected ArtifactRepository createDeploymentArtifactRepository( String id, Stri
return new MavenArtifactRepository( id, url, layout, new ArtifactRepositoryPolicy(),
new ArtifactRepositoryPolicy() );
}
+
+ protected final MavenSession getSession()
+ {
+ return session;
+ }
}
diff --git a/src/main/java/org/apache/maven/plugin/deploy/DeployFileMojo.java b/src/main/java/org/apache/maven/plugin/deploy/DeployFileMojo.java
index 1b6fd977..ff3552fa 100644
--- a/src/main/java/org/apache/maven/plugin/deploy/DeployFileMojo.java
+++ b/src/main/java/org/apache/maven/plugin/deploy/DeployFileMojo.java
@@ -35,7 +35,6 @@
import java.util.regex.Pattern;
import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.metadata.ArtifactMetadata;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
import org.apache.maven.model.InputLocation;
@@ -43,8 +42,8 @@
import org.apache.maven.model.Parent;
import org.apache.maven.model.building.DefaultModelBuildingRequest;
import org.apache.maven.model.building.ModelBuildingRequest;
-import org.apache.maven.model.building.ModelProblemCollector;
import org.apache.maven.model.building.ModelProblem.Severity;
+import org.apache.maven.model.building.ModelProblemCollector;
import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
import org.apache.maven.model.io.xpp3.MavenXpp3Writer;
import org.apache.maven.model.validation.ModelValidator;
@@ -57,6 +56,7 @@
import org.apache.maven.project.MavenProjectHelper;
import org.apache.maven.project.artifact.ProjectArtifactMetadata;
import org.apache.maven.shared.artifact.deploy.ArtifactDeployerException;
+import org.apache.maven.shared.artifact.repository.RepositoryManager;
import org.codehaus.plexus.util.FileUtils;
import org.codehaus.plexus.util.IOUtil;
import org.codehaus.plexus.util.ReaderFactory;
@@ -211,7 +211,10 @@ public class DeployFileMojo
*/
@Parameter( property = "files" )
private String files;
-
+
+ @Component
+ private RepositoryManager repoManager;
+
void initProperties()
throws MojoExecutionException
{
@@ -343,12 +346,12 @@ public void execute()
{
if ( pomFile != null )
{
- ArtifactMetadata metadata = new ProjectArtifactMetadata( artifact, pomFile );
+ ProjectArtifactMetadata metadata = new ProjectArtifactMetadata( artifact, pomFile );
artifact.addMetadata( metadata );
}
else if ( generatePom )
{
- ArtifactMetadata metadata = new ProjectArtifactMetadata( artifact, generatePomFile() );
+ ProjectArtifactMetadata metadata = new ProjectArtifactMetadata( artifact, generatePomFile() );
artifact.addMetadata( metadata );
}
}
@@ -469,7 +472,7 @@ else if ( generatePom )
try
{
- deploy( deployableArtifacts, deploymentRepository, getLocalRepository(), getRetryFailedDeploymentCount() );
+ deploy( deployableArtifacts, deploymentRepository, getRetryFailedDeploymentCount() );
}
catch ( ArtifactDeployerException e )
{
@@ -486,8 +489,8 @@ else if ( generatePom )
*/
private File getLocalRepoFile( Artifact artifact )
{
- String path = getLocalRepository().pathOf( artifact );
- return new File( getLocalRepository().getBasedir(), path );
+ String path = repoManager.getPathForLocalArtifact( getSession().getProjectBuildingRequest(), artifact );
+ return new File( repoManager.getLocalRepositoryBasedir( getSession().getProjectBuildingRequest() ), path );
}
/**
@@ -731,4 +734,5 @@ public String render( String indentation )
return message.toString();
}
};
+
}
diff --git a/src/main/java/org/apache/maven/plugin/deploy/DeployMojo.java b/src/main/java/org/apache/maven/plugin/deploy/DeployMojo.java
index 4dd03099..c797488a 100644
--- a/src/main/java/org/apache/maven/plugin/deploy/DeployMojo.java
+++ b/src/main/java/org/apache/maven/plugin/deploy/DeployMojo.java
@@ -29,7 +29,6 @@
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.ArtifactUtils;
-import org.apache.maven.artifact.metadata.ArtifactMetadata;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
import org.apache.maven.plugin.MojoExecutionException;
@@ -203,7 +202,7 @@ private void deployProject( DeployRequest request )
boolean isPomArtifact = "pom".equals( packaging );
if ( !isPomArtifact )
{
- ArtifactMetadata metadata = new ProjectArtifactMetadata( artifact, pomFile );
+ ProjectArtifactMetadata metadata = new ProjectArtifactMetadata( artifact, pomFile );
artifact.addMetadata( metadata );
}
else
@@ -275,7 +274,7 @@ else if ( !attachedArtifacts.isEmpty() )
deployableArtifacts.add( attached );
}
- deploy( deployableArtifacts, repo, getLocalRepository(), retryFailedDeploymentCount );
+ deploy( deployableArtifacts, repo, retryFailedDeploymentCount );
}
catch ( ArtifactDeployerException e )
{
diff --git a/src/test/resources/unit/basic-deploy-pom/plugin-config.xml b/src/test/resources/unit/basic-deploy-pom/plugin-config.xml
index 706ae344..cd39b18c 100644
--- a/src/test/resources/unit/basic-deploy-pom/plugin-config.xml
+++ b/src/test/resources/unit/basic-deploy-pom/plugin-config.xml
@@ -23,7 +23,6 @@ under the License.
maven-deploy-plugin
- ${localRepository}${basedir}/src/test/resources/unit/basic-deploy-pom/plugin-config.xmlpom
diff --git a/src/test/resources/unit/basic-deploy-scp/plugin-config.xml b/src/test/resources/unit/basic-deploy-scp/plugin-config.xml
index 0d785501..93f18565 100644
--- a/src/test/resources/unit/basic-deploy-scp/plugin-config.xml
+++ b/src/test/resources/unit/basic-deploy-scp/plugin-config.xml
@@ -23,7 +23,6 @@ under the License.
maven-deploy-plugin
- ${localRepository}${basedir}/src/test/resources/unit/basic-deploy-scp/plugin-config.xmljar
diff --git a/src/test/resources/unit/basic-deploy-test/plugin-config.xml b/src/test/resources/unit/basic-deploy-test/plugin-config.xml
index 708190083f1dd6cf0b030567577cc6fe8b87cc3d..85cd2f03aa35b5fd079ccea78570cd3a1a8f1325 100644
GIT binary patch
delta 12
TcmZ1^y+CTiH1^FB99^sc9?JwL
delta 98
zcmZ1=wMcryH1@z8hJ1!(hD3%Oh9HJih5{h3m?4v)1V|S#R5I8xs4!FmpkH1;l50C1ZY?EnA(
diff --git a/src/test/resources/unit/basic-deploy-with-attached-artifacts/plugin-config.xml b/src/test/resources/unit/basic-deploy-with-attached-artifacts/plugin-config.xml
index 4e234f2d..b2e730cc 100644
--- a/src/test/resources/unit/basic-deploy-with-attached-artifacts/plugin-config.xml
+++ b/src/test/resources/unit/basic-deploy-with-attached-artifacts/plugin-config.xml
@@ -23,8 +23,7 @@ under the License.
maven-deploy-plugin
- ${localRepository}
-
+ ${basedir}/src/test/resources/unit/basic-deploy-with-attached-artifacts/plugin-config.xmljar
diff --git a/src/test/resources/unit/deploy-file-artifact-not-jar/plugin-config.xml b/src/test/resources/unit/deploy-file-artifact-not-jar/plugin-config.xml
index 5ec690ce..f9b092e2 100644
--- a/src/test/resources/unit/deploy-file-artifact-not-jar/plugin-config.xml
+++ b/src/test/resources/unit/deploy-file-artifact-not-jar/plugin-config.xml
@@ -30,7 +30,6 @@ under the License.
deploy-testfile://${basedir}/target/remote-repo/deploy-file-artifact-not-jartrue
- ${localRepository}defaulttrue
diff --git a/src/test/resources/unit/deploy-file-classifier/plugin-config.xml b/src/test/resources/unit/deploy-file-classifier/plugin-config.xml
index a633e12a..7929357d 100644
--- a/src/test/resources/unit/deploy-file-classifier/plugin-config.xml
+++ b/src/test/resources/unit/deploy-file-classifier/plugin-config.xml
@@ -31,7 +31,6 @@ under the License.
deploy-testfile://${basedir}/target/remote-repo/deploy-file-classifiertrue
- ${localRepository}bindefaulttrue
diff --git a/src/test/resources/unit/deploy-file-legacy-repository-layout/plugin-config.xml b/src/test/resources/unit/deploy-file-legacy-repository-layout/plugin-config.xml
index ed5e519d..d59b015e 100644
--- a/src/test/resources/unit/deploy-file-legacy-repository-layout/plugin-config.xml
+++ b/src/test/resources/unit/deploy-file-legacy-repository-layout/plugin-config.xml
@@ -31,7 +31,6 @@ under the License.
deploy-testfile://${basedir}/target/remote-repo/deploy-file-legacy-repository-layouttrue
- ${localRepository}legacytrue
diff --git a/src/test/resources/unit/deploy-file-pom-file/plugin-config.xml b/src/test/resources/unit/deploy-file-pom-file/plugin-config.xml
index f8ed5438ab9d5e9d5bf865e569252b153309d1da..d1e9b0e52c7c848338b8223e2546c22064199a15 100644
GIT binary patch
delta 12
TcmZ1{y+&$74EN@H+!q)DA^rsv
delta 76
zcmZ1@wN83N3^#WULq0CL(t?z9$`T{1{H>CAP-fvmcfQWA6<0vBX*h1G29mz
E0kfile://${basedir}/target/remote-repo/deploy-file-test
POM was created from deploy:deploy-filetrue
- ${localRepository}defaulttrue
From 1eed50a987552f9a89ab33de0550535ffc92181a Mon Sep 17 00:00:00 2001
From: Robert Scholte
Date: Sun, 18 Oct 2015 12:50:46 +0000
Subject: [PATCH 017/153] MDEPLOY-202: deploy-file goal insists on deploying
source file for previous deploy-file execution
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1709276 13f79535-47bb-0310-9956-ffa450edef68
---
.../org.eclipse.equinox.common.source_1.0.jar | Bin 0 -> 361 bytes
.../lib/org.eclipse.equinox.common_1.0.jar | Bin 0 -> 361 bytes
.../lib/org.eclipse.osgi.source_1.0.jar | Bin 0 -> 361 bytes
.../lib/org.eclipse.osgi_1.0.jar | Bin 0 -> 361 bytes
.../pom.xml | 100 ++++++++++++++++++
.../classes/org.eclipse.equinox.common.pom | 20 ++++
.../target/classes/org.eclipse.osgi.pom | 20 ++++
.../verify.groovy | 22 ++++
.../plugin/deploy/AbstractDeployMojo.java | 2 +-
.../maven/plugin/deploy/DeployFileMojo.java | 14 ++-
.../deploy/stubs/ArtifactDeployerStub.java | 8 ++
11 files changed, 183 insertions(+), 3 deletions(-)
create mode 100644 src/it/MDEPLOY-202_deployfile-with-multiple-executions/lib/org.eclipse.equinox.common.source_1.0.jar
create mode 100644 src/it/MDEPLOY-202_deployfile-with-multiple-executions/lib/org.eclipse.equinox.common_1.0.jar
create mode 100644 src/it/MDEPLOY-202_deployfile-with-multiple-executions/lib/org.eclipse.osgi.source_1.0.jar
create mode 100644 src/it/MDEPLOY-202_deployfile-with-multiple-executions/lib/org.eclipse.osgi_1.0.jar
create mode 100644 src/it/MDEPLOY-202_deployfile-with-multiple-executions/pom.xml
create mode 100644 src/it/MDEPLOY-202_deployfile-with-multiple-executions/target/classes/org.eclipse.equinox.common.pom
create mode 100644 src/it/MDEPLOY-202_deployfile-with-multiple-executions/target/classes/org.eclipse.osgi.pom
create mode 100644 src/it/MDEPLOY-202_deployfile-with-multiple-executions/verify.groovy
diff --git a/src/it/MDEPLOY-202_deployfile-with-multiple-executions/lib/org.eclipse.equinox.common.source_1.0.jar b/src/it/MDEPLOY-202_deployfile-with-multiple-executions/lib/org.eclipse.equinox.common.source_1.0.jar
new file mode 100644
index 0000000000000000000000000000000000000000..2fa3a2422d76a214014c943ea7981069f62c8b81
GIT binary patch
literal 361
zcmWIWW@h1H0D<$FLGEA%l;8x?zOEsTx}JV+`T;;?A`Bcrcn(dO2(mI?M?X(D*WeI6
zU$@V`XHNTg>*`(P_14uocjo-&AcHH$51tn3c%3_;w4vmq^oO<4?t2L6tk_bO#B02L&G}>SOIZDY=qsUuWvdO0Hv7ZdGjp
zb2WFxY2H*gt>bX*V-X`mfHylw+zr=^LZE{>fH=ULkx7IZx8HzDfIxuZts{s=@+n9g
l!mr3ig8T{tOB&UIOt>~Ap9grevVl}F0bwPOz6Ihi004LRR@(po
literal 0
HcmV?d00001
diff --git a/src/it/MDEPLOY-202_deployfile-with-multiple-executions/lib/org.eclipse.equinox.common_1.0.jar b/src/it/MDEPLOY-202_deployfile-with-multiple-executions/lib/org.eclipse.equinox.common_1.0.jar
new file mode 100644
index 0000000000000000000000000000000000000000..2fa3a2422d76a214014c943ea7981069f62c8b81
GIT binary patch
literal 361
zcmWIWW@h1H0D<$FLGEA%l;8x?zOEsTx}JV+`T;;?A`Bcrcn(dO2(mI?M?X(D*WeI6
zU$@V`XHNTg>*`(P_14uocjo-&AcHH$51tn3c%3_;w4vmq^oO<4?t2L6tk_bO#B02L&G}>SOIZDY=qsUuWvdO0Hv7ZdGjp
zb2WFxY2H*gt>bX*V-X`mfHylw+zr=^LZE{>fH=ULkx7IZx8HzDfIxuZts{s=@+n9g
l!mr3ig8T{tOB&UIOt>~Ap9grevVl}F0bwPOz6Ihi004LRR@(po
literal 0
HcmV?d00001
diff --git a/src/it/MDEPLOY-202_deployfile-with-multiple-executions/lib/org.eclipse.osgi.source_1.0.jar b/src/it/MDEPLOY-202_deployfile-with-multiple-executions/lib/org.eclipse.osgi.source_1.0.jar
new file mode 100644
index 0000000000000000000000000000000000000000..2fa3a2422d76a214014c943ea7981069f62c8b81
GIT binary patch
literal 361
zcmWIWW@h1H0D<$FLGEA%l;8x?zOEsTx}JV+`T;;?A`Bcrcn(dO2(mI?M?X(D*WeI6
zU$@V`XHNTg>*`(P_14uocjo-&AcHH$51tn3c%3_;w4vmq^oO<4?t2L6tk_bO#B02L&G}>SOIZDY=qsUuWvdO0Hv7ZdGjp
zb2WFxY2H*gt>bX*V-X`mfHylw+zr=^LZE{>fH=ULkx7IZx8HzDfIxuZts{s=@+n9g
l!mr3ig8T{tOB&UIOt>~Ap9grevVl}F0bwPOz6Ihi004LRR@(po
literal 0
HcmV?d00001
diff --git a/src/it/MDEPLOY-202_deployfile-with-multiple-executions/lib/org.eclipse.osgi_1.0.jar b/src/it/MDEPLOY-202_deployfile-with-multiple-executions/lib/org.eclipse.osgi_1.0.jar
new file mode 100644
index 0000000000000000000000000000000000000000..2fa3a2422d76a214014c943ea7981069f62c8b81
GIT binary patch
literal 361
zcmWIWW@h1H0D<$FLGEA%l;8x?zOEsTx}JV+`T;;?A`Bcrcn(dO2(mI?M?X(D*WeI6
zU$@V`XHNTg>*`(P_14uocjo-&AcHH$51tn3c%3_;w4vmq^oO<4?t2L6tk_bO#B02L&G}>SOIZDY=qsUuWvdO0Hv7ZdGjp
zb2WFxY2H*gt>bX*V-X`mfHylw+zr=^LZE{>fH=ULkx7IZx8HzDfIxuZts{s=@+n9g
l!mr3ig8T{tOB&UIOt>~Ap9grevVl}F0bwPOz6Ihi004LRR@(po
literal 0
HcmV?d00001
diff --git a/src/it/MDEPLOY-202_deployfile-with-multiple-executions/pom.xml b/src/it/MDEPLOY-202_deployfile-with-multiple-executions/pom.xml
new file mode 100644
index 00000000..d52e4485
--- /dev/null
+++ b/src/it/MDEPLOY-202_deployfile-with-multiple-executions/pom.xml
@@ -0,0 +1,100 @@
+
+
+
+
+
+ 4.0.0
+
+ org.apache.maven.its.mdeploy-170
+ configperproject
+ 1.0
+ pom
+
+
+ Tests file deployment with multiple execution blocks
+
+
+ https://issues.apache.org/jira/browse/MDEPLOY-202
+
+
+ true
+
+ lib
+ 1.0
+ 1.0
+
+
+
+
+ it
+ file:///${basedir}/target/repo
+ false
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-deploy-plugin
+ @project.version@
+
+ file:target/repo
+
+
+
+
+
+
+
+ deploy-equinox-snapshots
+
+ true
+
+
+
+
+ org.apache.maven.plugins
+ maven-deploy-plugin
+
+
+ deploy-osgi
+
+ deploy-file
+
+ deploy
+
+ ${downloaded}/org.eclipse.osgi_${org.eclipse.osgi}.jar
+ ${downloaded}/org.eclipse.osgi.source_${org.eclipse.osgi}.jar
+ ${project.build.outputDirectory}/org.eclipse.osgi.pom
+
+
+
+ deploy-equinox-common
+
+ deploy-file
+
+ deploy
+
+ ${downloaded}/org.eclipse.equinox.common_${org.eclipse.equinox.common}.jar
+ ${downloaded}/org.eclipse.equinox.common.source_${org.eclipse.equinox.common}.jar
+ ${project.build.outputDirectory}/org.eclipse.equinox.common.pom
+
+
+
+
+
+
+
+
+
diff --git a/src/it/MDEPLOY-202_deployfile-with-multiple-executions/target/classes/org.eclipse.equinox.common.pom b/src/it/MDEPLOY-202_deployfile-with-multiple-executions/target/classes/org.eclipse.equinox.common.pom
new file mode 100644
index 00000000..f3fbaf91
--- /dev/null
+++ b/src/it/MDEPLOY-202_deployfile-with-multiple-executions/target/classes/org.eclipse.equinox.common.pom
@@ -0,0 +1,20 @@
+
+
+
+
+
+ 4.0.0
+ org.apache.maven.plugins.deploy.it
+ org.eclipse.equinox.common
+ 1.0
+
\ No newline at end of file
diff --git a/src/it/MDEPLOY-202_deployfile-with-multiple-executions/target/classes/org.eclipse.osgi.pom b/src/it/MDEPLOY-202_deployfile-with-multiple-executions/target/classes/org.eclipse.osgi.pom
new file mode 100644
index 00000000..a5054d4b
--- /dev/null
+++ b/src/it/MDEPLOY-202_deployfile-with-multiple-executions/target/classes/org.eclipse.osgi.pom
@@ -0,0 +1,20 @@
+
+
+
+
+
+ 4.0.0
+ org.apache.maven.plugins.deploy.it
+ org.eclipse.osgi
+ 1.0
+
\ No newline at end of file
diff --git a/src/it/MDEPLOY-202_deployfile-with-multiple-executions/verify.groovy b/src/it/MDEPLOY-202_deployfile-with-multiple-executions/verify.groovy
new file mode 100644
index 00000000..119b9387
--- /dev/null
+++ b/src/it/MDEPLOY-202_deployfile-with-multiple-executions/verify.groovy
@@ -0,0 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+def buildLog = new File ( basedir, "build.log")
+
+assert 1 == buildLog.text.count( 'Uploading: file:target/repo/org/apache/maven/plugins/deploy/it/org.eclipse.osgi/1.0/org.eclipse.osgi-1.0-sources.jar')
\ No newline at end of file
diff --git a/src/main/java/org/apache/maven/plugin/deploy/AbstractDeployMojo.java b/src/main/java/org/apache/maven/plugin/deploy/AbstractDeployMojo.java
index 29ca1a58..c1b93a4e 100644
--- a/src/main/java/org/apache/maven/plugin/deploy/AbstractDeployMojo.java
+++ b/src/main/java/org/apache/maven/plugin/deploy/AbstractDeployMojo.java
@@ -155,7 +155,7 @@ protected void deploy( Collection artifacts, ArtifactRepository deploy
+ retryFailedDeploymentCounter );
}
- getDeployer().deploy( session.getProjectBuildingRequest(), artifacts );
+ getDeployer().deploy( session.getProjectBuildingRequest(), deploymentRepository, artifacts );
exception = null;
break;
}
diff --git a/src/main/java/org/apache/maven/plugin/deploy/DeployFileMojo.java b/src/main/java/org/apache/maven/plugin/deploy/DeployFileMojo.java
index ff3552fa..2afb7ba5 100644
--- a/src/main/java/org/apache/maven/plugin/deploy/DeployFileMojo.java
+++ b/src/main/java/org/apache/maven/plugin/deploy/DeployFileMojo.java
@@ -373,12 +373,22 @@ else if ( generatePom )
if ( sources != null )
{
- projectHelper.attachArtifact( project, "jar", "sources", sources );
+ Artifact sourcesArtifact =
+ artifactFactory.createArtifactWithClassifier( groupId, artifactId, version, "jar", "sources" );
+
+ sourcesArtifact.setFile( sources );
+
+ deployableArtifacts.add( sourcesArtifact );
}
if ( javadoc != null )
{
- projectHelper.attachArtifact( project, "jar", "javadoc", javadoc );
+ Artifact javadocArtifact =
+ artifactFactory.createArtifactWithClassifier( groupId, artifactId, version, "jar", "javadoc" );
+
+ javadocArtifact.setFile( javadoc );
+
+ deployableArtifacts.add( javadocArtifact );
}
if ( files != null )
diff --git a/src/test/java/org/apache/maven/plugin/deploy/stubs/ArtifactDeployerStub.java b/src/test/java/org/apache/maven/plugin/deploy/stubs/ArtifactDeployerStub.java
index 5694b5cd..32c43454 100644
--- a/src/test/java/org/apache/maven/plugin/deploy/stubs/ArtifactDeployerStub.java
+++ b/src/test/java/org/apache/maven/plugin/deploy/stubs/ArtifactDeployerStub.java
@@ -22,6 +22,7 @@
import java.util.Collection;
import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.project.ProjectBuildingRequest;
import org.apache.maven.shared.artifact.deploy.ArtifactDeployer;
import org.apache.maven.shared.artifact.deploy.ArtifactDeployerException;
@@ -36,4 +37,11 @@ public void deploy( ProjectBuildingRequest request, Collection mavenAr
{
// does nothing
}
+
+ @Override
+ public void deploy( ProjectBuildingRequest arg0, ArtifactRepository arg1, Collection arg2 )
+ throws ArtifactDeployerException
+ {
+ // does nothing
+ }
}
From e83820242a2124d694a6429676a8b0eb22149ba2 Mon Sep 17 00:00:00 2001
From: Robert Scholte
Date: Mon, 19 Oct 2015 19:25:45 +0000
Subject: [PATCH 018/153] use released version of parent-28
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1709467 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 426395bc..02d62dbf 100644
--- a/pom.xml
+++ b/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.maven.pluginsmaven-plugins
- 28-SNAPSHOT
+ 28../maven-plugins/pom.xml
From 24105c57dfed4b55c242a5bc644cbfcd7fdb3b03 Mon Sep 17 00:00:00 2001
From: Robert Scholte
Date: Mon, 19 Oct 2015 20:27:27 +0000
Subject: [PATCH 019/153] [MDEPLOY-203] Rename package to
org.apache.maven.plugins
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1709475 13f79535-47bb-0310-9956-ffa450edef68
---
.../deploy/AbstractDeployMojo.java | 2 +-
.../deploy/DeployFileMojo.java | 2 +-
.../deploy/DeployMojo.java | 2 +-
.../deploy/DeployRequest.java | 2 +-
.../deploy/DeployFileMojoTest.java | 2 +-
.../deploy/DeployFileMojoUnitTest.java | 2 +-
.../deploy/DeployMojoTest.java | 8 ++++----
.../deploy/stubs/ArtifactDeployerStub.java | 2 +-
.../deploy/stubs/ArtifactRepositoryStub.java | 2 +-
.../deploy/stubs/ArtifactRepositoryStub2.java | 2 +-
.../deploy/stubs/AttachedArtifactStub.java | 2 +-
.../deploy/stubs/DeployArtifactStub.java | 2 +-
.../deploy/stubs/MavenProjectStub.java | 2 +-
.../unit/basic-deploy-pom/plugin-config.xml | 6 +++---
.../unit/basic-deploy-scp/plugin-config.xml | 8 ++++----
.../unit/basic-deploy-test/plugin-config.xml | Bin 3360 -> 3366 bytes
.../plugin-config.xml | 8 ++++----
17 files changed, 27 insertions(+), 27 deletions(-)
rename src/main/java/org/apache/maven/{plugin => plugins}/deploy/AbstractDeployMojo.java (99%)
rename src/main/java/org/apache/maven/{plugin => plugins}/deploy/DeployFileMojo.java (99%)
rename src/main/java/org/apache/maven/{plugin => plugins}/deploy/DeployMojo.java (99%)
rename src/main/java/org/apache/maven/{plugin => plugins}/deploy/DeployRequest.java (95%)
rename src/test/java/org/apache/maven/{plugin => plugins}/deploy/DeployFileMojoTest.java (99%)
rename src/test/java/org/apache/maven/{plugin => plugins}/deploy/DeployFileMojoUnitTest.java (99%)
rename src/test/java/org/apache/maven/{plugin => plugins}/deploy/DeployMojoTest.java (99%)
rename src/test/java/org/apache/maven/{plugin => plugins}/deploy/stubs/ArtifactDeployerStub.java (97%)
rename src/test/java/org/apache/maven/{plugin => plugins}/deploy/stubs/ArtifactRepositoryStub.java (98%)
rename src/test/java/org/apache/maven/{plugin => plugins}/deploy/stubs/ArtifactRepositoryStub2.java (97%)
rename src/test/java/org/apache/maven/{plugin => plugins}/deploy/stubs/AttachedArtifactStub.java (96%)
rename src/test/java/org/apache/maven/{plugin => plugins}/deploy/stubs/DeployArtifactStub.java (98%)
rename src/test/java/org/apache/maven/{plugin => plugins}/deploy/stubs/MavenProjectStub.java (96%)
diff --git a/src/main/java/org/apache/maven/plugin/deploy/AbstractDeployMojo.java b/src/main/java/org/apache/maven/plugins/deploy/AbstractDeployMojo.java
similarity index 99%
rename from src/main/java/org/apache/maven/plugin/deploy/AbstractDeployMojo.java
rename to src/main/java/org/apache/maven/plugins/deploy/AbstractDeployMojo.java
index c1b93a4e..e54c7781 100644
--- a/src/main/java/org/apache/maven/plugin/deploy/AbstractDeployMojo.java
+++ b/src/main/java/org/apache/maven/plugins/deploy/AbstractDeployMojo.java
@@ -1,4 +1,4 @@
-package org.apache.maven.plugin.deploy;
+package org.apache.maven.plugins.deploy;
/*
* Licensed to the Apache Software Foundation (ASF) under one
diff --git a/src/main/java/org/apache/maven/plugin/deploy/DeployFileMojo.java b/src/main/java/org/apache/maven/plugins/deploy/DeployFileMojo.java
similarity index 99%
rename from src/main/java/org/apache/maven/plugin/deploy/DeployFileMojo.java
rename to src/main/java/org/apache/maven/plugins/deploy/DeployFileMojo.java
index 2afb7ba5..30552c28 100644
--- a/src/main/java/org/apache/maven/plugin/deploy/DeployFileMojo.java
+++ b/src/main/java/org/apache/maven/plugins/deploy/DeployFileMojo.java
@@ -1,4 +1,4 @@
-package org.apache.maven.plugin.deploy;
+package org.apache.maven.plugins.deploy;
/*
* Licensed to the Apache Software Foundation (ASF) under one
diff --git a/src/main/java/org/apache/maven/plugin/deploy/DeployMojo.java b/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java
similarity index 99%
rename from src/main/java/org/apache/maven/plugin/deploy/DeployMojo.java
rename to src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java
index c797488a..115a235a 100644
--- a/src/main/java/org/apache/maven/plugin/deploy/DeployMojo.java
+++ b/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java
@@ -1,4 +1,4 @@
-package org.apache.maven.plugin.deploy;
+package org.apache.maven.plugins.deploy;
/*
* Licensed to the Apache Software Foundation (ASF) under one
diff --git a/src/main/java/org/apache/maven/plugin/deploy/DeployRequest.java b/src/main/java/org/apache/maven/plugins/deploy/DeployRequest.java
similarity index 95%
rename from src/main/java/org/apache/maven/plugin/deploy/DeployRequest.java
rename to src/main/java/org/apache/maven/plugins/deploy/DeployRequest.java
index b5505d92..cdb99f7e 100644
--- a/src/main/java/org/apache/maven/plugin/deploy/DeployRequest.java
+++ b/src/main/java/org/apache/maven/plugins/deploy/DeployRequest.java
@@ -1,4 +1,4 @@
-package org.apache.maven.plugin.deploy;
+package org.apache.maven.plugins.deploy;
/*
* Licensed to the Apache Software Foundation (ASF) under one
diff --git a/src/test/java/org/apache/maven/plugin/deploy/DeployFileMojoTest.java b/src/test/java/org/apache/maven/plugins/deploy/DeployFileMojoTest.java
similarity index 99%
rename from src/test/java/org/apache/maven/plugin/deploy/DeployFileMojoTest.java
rename to src/test/java/org/apache/maven/plugins/deploy/DeployFileMojoTest.java
index e3e4c40e..9979513d 100644
--- a/src/test/java/org/apache/maven/plugin/deploy/DeployFileMojoTest.java
+++ b/src/test/java/org/apache/maven/plugins/deploy/DeployFileMojoTest.java
@@ -1,4 +1,4 @@
-package org.apache.maven.plugin.deploy;
+package org.apache.maven.plugins.deploy;
/*
* Licensed to the Apache Software Foundation (ASF) under one
diff --git a/src/test/java/org/apache/maven/plugin/deploy/DeployFileMojoUnitTest.java b/src/test/java/org/apache/maven/plugins/deploy/DeployFileMojoUnitTest.java
similarity index 99%
rename from src/test/java/org/apache/maven/plugin/deploy/DeployFileMojoUnitTest.java
rename to src/test/java/org/apache/maven/plugins/deploy/DeployFileMojoUnitTest.java
index b0cfd857..4418853d 100644
--- a/src/test/java/org/apache/maven/plugin/deploy/DeployFileMojoUnitTest.java
+++ b/src/test/java/org/apache/maven/plugins/deploy/DeployFileMojoUnitTest.java
@@ -1,4 +1,4 @@
-package org.apache.maven.plugin.deploy;
+package org.apache.maven.plugins.deploy;
/*
* Licensed to the Apache Software Foundation (ASF) under one
diff --git a/src/test/java/org/apache/maven/plugin/deploy/DeployMojoTest.java b/src/test/java/org/apache/maven/plugins/deploy/DeployMojoTest.java
similarity index 99%
rename from src/test/java/org/apache/maven/plugin/deploy/DeployMojoTest.java
rename to src/test/java/org/apache/maven/plugins/deploy/DeployMojoTest.java
index 738e00b6..54b2c924 100644
--- a/src/test/java/org/apache/maven/plugin/deploy/DeployMojoTest.java
+++ b/src/test/java/org/apache/maven/plugins/deploy/DeployMojoTest.java
@@ -1,4 +1,4 @@
-package org.apache.maven.plugin.deploy;
+package org.apache.maven.plugins.deploy;
/*
* Licensed to the Apache Software Foundation (ASF) under one
@@ -35,9 +35,9 @@
import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
import org.apache.maven.execution.MavenSession;
import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.deploy.stubs.ArtifactDeployerStub;
-import org.apache.maven.plugin.deploy.stubs.ArtifactRepositoryStub;
-import org.apache.maven.plugin.deploy.stubs.DeployArtifactStub;
+import org.apache.maven.plugins.deploy.stubs.ArtifactDeployerStub;
+import org.apache.maven.plugins.deploy.stubs.ArtifactRepositoryStub;
+import org.apache.maven.plugins.deploy.stubs.DeployArtifactStub;
import org.apache.maven.plugin.testing.AbstractMojoTestCase;
import org.apache.maven.plugin.testing.stubs.MavenProjectStub;
import org.apache.maven.project.MavenProject;
diff --git a/src/test/java/org/apache/maven/plugin/deploy/stubs/ArtifactDeployerStub.java b/src/test/java/org/apache/maven/plugins/deploy/stubs/ArtifactDeployerStub.java
similarity index 97%
rename from src/test/java/org/apache/maven/plugin/deploy/stubs/ArtifactDeployerStub.java
rename to src/test/java/org/apache/maven/plugins/deploy/stubs/ArtifactDeployerStub.java
index 32c43454..518e36be 100644
--- a/src/test/java/org/apache/maven/plugin/deploy/stubs/ArtifactDeployerStub.java
+++ b/src/test/java/org/apache/maven/plugins/deploy/stubs/ArtifactDeployerStub.java
@@ -1,4 +1,4 @@
-package org.apache.maven.plugin.deploy.stubs;
+package org.apache.maven.plugins.deploy.stubs;
/*
* Licensed to the Apache Software Foundation (ASF) under one
diff --git a/src/test/java/org/apache/maven/plugin/deploy/stubs/ArtifactRepositoryStub.java b/src/test/java/org/apache/maven/plugins/deploy/stubs/ArtifactRepositoryStub.java
similarity index 98%
rename from src/test/java/org/apache/maven/plugin/deploy/stubs/ArtifactRepositoryStub.java
rename to src/test/java/org/apache/maven/plugins/deploy/stubs/ArtifactRepositoryStub.java
index 51c4c27e..0b94ebed 100644
--- a/src/test/java/org/apache/maven/plugin/deploy/stubs/ArtifactRepositoryStub.java
+++ b/src/test/java/org/apache/maven/plugins/deploy/stubs/ArtifactRepositoryStub.java
@@ -1,4 +1,4 @@
-package org.apache.maven.plugin.deploy.stubs;
+package org.apache.maven.plugins.deploy.stubs;
/*
* Licensed to the Apache Software Foundation (ASF) under one
diff --git a/src/test/java/org/apache/maven/plugin/deploy/stubs/ArtifactRepositoryStub2.java b/src/test/java/org/apache/maven/plugins/deploy/stubs/ArtifactRepositoryStub2.java
similarity index 97%
rename from src/test/java/org/apache/maven/plugin/deploy/stubs/ArtifactRepositoryStub2.java
rename to src/test/java/org/apache/maven/plugins/deploy/stubs/ArtifactRepositoryStub2.java
index 3929a70e..0e3338fc 100644
--- a/src/test/java/org/apache/maven/plugin/deploy/stubs/ArtifactRepositoryStub2.java
+++ b/src/test/java/org/apache/maven/plugins/deploy/stubs/ArtifactRepositoryStub2.java
@@ -1,4 +1,4 @@
-package org.apache.maven.plugin.deploy.stubs;
+package org.apache.maven.plugins.deploy.stubs;
/*
* Licensed to the Apache Software Foundation (ASF) under one
diff --git a/src/test/java/org/apache/maven/plugin/deploy/stubs/AttachedArtifactStub.java b/src/test/java/org/apache/maven/plugins/deploy/stubs/AttachedArtifactStub.java
similarity index 96%
rename from src/test/java/org/apache/maven/plugin/deploy/stubs/AttachedArtifactStub.java
rename to src/test/java/org/apache/maven/plugins/deploy/stubs/AttachedArtifactStub.java
index b500fff1..0419a85c 100644
--- a/src/test/java/org/apache/maven/plugin/deploy/stubs/AttachedArtifactStub.java
+++ b/src/test/java/org/apache/maven/plugins/deploy/stubs/AttachedArtifactStub.java
@@ -1,4 +1,4 @@
-package org.apache.maven.plugin.deploy.stubs;
+package org.apache.maven.plugins.deploy.stubs;
/*
* Licensed to the Apache Software Foundation (ASF) under one
diff --git a/src/test/java/org/apache/maven/plugin/deploy/stubs/DeployArtifactStub.java b/src/test/java/org/apache/maven/plugins/deploy/stubs/DeployArtifactStub.java
similarity index 98%
rename from src/test/java/org/apache/maven/plugin/deploy/stubs/DeployArtifactStub.java
rename to src/test/java/org/apache/maven/plugins/deploy/stubs/DeployArtifactStub.java
index 93285046..24f31d58 100644
--- a/src/test/java/org/apache/maven/plugin/deploy/stubs/DeployArtifactStub.java
+++ b/src/test/java/org/apache/maven/plugins/deploy/stubs/DeployArtifactStub.java
@@ -1,4 +1,4 @@
-package org.apache.maven.plugin.deploy.stubs;
+package org.apache.maven.plugins.deploy.stubs;
/*
* Licensed to the Apache Software Foundation (ASF) under one
diff --git a/src/test/java/org/apache/maven/plugin/deploy/stubs/MavenProjectStub.java b/src/test/java/org/apache/maven/plugins/deploy/stubs/MavenProjectStub.java
similarity index 96%
rename from src/test/java/org/apache/maven/plugin/deploy/stubs/MavenProjectStub.java
rename to src/test/java/org/apache/maven/plugins/deploy/stubs/MavenProjectStub.java
index 3c8531f2..91709a36 100644
--- a/src/test/java/org/apache/maven/plugin/deploy/stubs/MavenProjectStub.java
+++ b/src/test/java/org/apache/maven/plugins/deploy/stubs/MavenProjectStub.java
@@ -1,4 +1,4 @@
-package org.apache.maven.plugin.deploy.stubs;
+package org.apache.maven.plugins.deploy.stubs;
/*
* Licensed to the Apache Software Foundation (ASF) under one
diff --git a/src/test/resources/unit/basic-deploy-pom/plugin-config.xml b/src/test/resources/unit/basic-deploy-pom/plugin-config.xml
index cd39b18c..1f5ae632 100644
--- a/src/test/resources/unit/basic-deploy-pom/plugin-config.xml
+++ b/src/test/resources/unit/basic-deploy-pom/plugin-config.xml
@@ -23,12 +23,12 @@ under the License.
maven-deploy-plugin
-
+ ${basedir}/src/test/resources/unit/basic-deploy-pom/plugin-config.xmlpom
-
+
-
+ ${basedir}
diff --git a/src/test/resources/unit/basic-deploy-scp/plugin-config.xml b/src/test/resources/unit/basic-deploy-scp/plugin-config.xml
index 93f18565..ffb387ad 100644
--- a/src/test/resources/unit/basic-deploy-scp/plugin-config.xml
+++ b/src/test/resources/unit/basic-deploy-scp/plugin-config.xml
@@ -23,15 +23,15 @@ under the License.
maven-deploy-plugin
-
+ ${basedir}/src/test/resources/unit/basic-deploy-scp/plugin-config.xmljar
-
+
-
+ false
-
+
diff --git a/src/test/resources/unit/basic-deploy-test/plugin-config.xml b/src/test/resources/unit/basic-deploy-test/plugin-config.xml
index 85cd2f03aa35b5fd079ccea78570cd3a1a8f1325..ae6eeaf21c833221d84a50b5eca9872782c72d74 100644
GIT binary patch
delta 36
mcmZ1=wM=Tm7k0+t$maven-deploy-plugin
-
+ ${basedir}/src/test/resources/unit/basic-deploy-with-attached-artifacts/plugin-config.xmljar
-
+
-
+
-
+ ${basedir}
From ddee82bb3523a467ea03123d397719fc79f5d7cb Mon Sep 17 00:00:00 2001
From: Herve Boutemy
Date: Tue, 17 Nov 2015 20:21:30 +0000
Subject: [PATCH 020/153] [MPOM-95] updated parent pom location
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1714875 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 02d62dbf..08d01f06 100644
--- a/pom.xml
+++ b/pom.xml
@@ -26,7 +26,7 @@ under the License.
org.apache.maven.pluginsmaven-plugins28
- ../maven-plugins/pom.xml
+ ../../pom/maven/maven-plugins/pom.xmlmaven-deploy-plugin
From b2c2b5a7c1b3449f639969605376bde690d8519c Mon Sep 17 00:00:00 2001
From: Robert Scholte
Date: Sun, 27 Dec 2015 20:13:37 +0000
Subject: [PATCH 021/153] Adjust package of RepositoryManager
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1721839 13f79535-47bb-0310-9956-ffa450edef68
---
.../java/org/apache/maven/plugins/deploy/DeployFileMojo.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/main/java/org/apache/maven/plugins/deploy/DeployFileMojo.java b/src/main/java/org/apache/maven/plugins/deploy/DeployFileMojo.java
index 30552c28..5a630a0b 100644
--- a/src/main/java/org/apache/maven/plugins/deploy/DeployFileMojo.java
+++ b/src/main/java/org/apache/maven/plugins/deploy/DeployFileMojo.java
@@ -56,7 +56,7 @@
import org.apache.maven.project.MavenProjectHelper;
import org.apache.maven.project.artifact.ProjectArtifactMetadata;
import org.apache.maven.shared.artifact.deploy.ArtifactDeployerException;
-import org.apache.maven.shared.artifact.repository.RepositoryManager;
+import org.apache.maven.shared.repository.RepositoryManager;
import org.codehaus.plexus.util.FileUtils;
import org.codehaus.plexus.util.IOUtil;
import org.codehaus.plexus.util.ReaderFactory;
From 0d61f9d2cf309f0f74d188a0493d2eb2522bde8b Mon Sep 17 00:00:00 2001
From: Robert Scholte
Date: Tue, 12 Jan 2016 21:20:47 +0000
Subject: [PATCH 022/153] [MDEPLOY-205] MavenProject with only attachments must
have packaging "pom"
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1724326 13f79535-47bb-0310-9956-ffa450edef68
---
src/it/mdeploy-45-test/pom.xml | 38 ++++++++---
src/it/no-main-artifact-1/invoker.properties | 17 +++++
src/it/no-main-artifact-1/pom.xml | 1 +
.../{verify.bsh => verify.groovy} | 63 +++++++------------
src/it/no-main-artifact-2/invoker.properties | 17 +++++
.../{verify.bsh => verify.groovy} | 63 +++++++------------
src/it/no-main-artifact-snapshot/pom.xml | 28 +++++++--
.../maven/plugins/deploy/DeployFileMojo.java | 4 ++
.../maven/plugins/deploy/DeployMojo.java | 21 ++-----
9 files changed, 141 insertions(+), 111 deletions(-)
create mode 100644 src/it/no-main-artifact-1/invoker.properties
rename src/it/no-main-artifact-1/{verify.bsh => verify.groovy} (59%)
create mode 100644 src/it/no-main-artifact-2/invoker.properties
rename src/it/no-main-artifact-2/{verify.bsh => verify.groovy} (59%)
diff --git a/src/it/mdeploy-45-test/pom.xml b/src/it/mdeploy-45-test/pom.xml
index 4cd030ed..c30df9e6 100644
--- a/src/it/mdeploy-45-test/pom.xml
+++ b/src/it/mdeploy-45-test/pom.xml
@@ -25,11 +25,12 @@ under the License.
org.apache.maven.its.deploy.45test0.1
- war
+
+ pomMDEPLOY-45sample web project with classified artifact output
- http://jira.codehaus.org/browse/MDEPLOY-45
+ https://issues.apache.org/jira/browse/MDEPLOY-45mdp45
@@ -51,21 +52,42 @@ under the License.
- maven-deploy-plugin
- @project.version@
-
-
- mine::default::file://${basedir}/target
-
+ org.apache.maven.plugins
+ maven-resources-plugin
+ 2.5
+
+
+
+ resources
+
+
+
+ org.apache.maven.pluginsmaven-war-plugin2.0.2
+
+
+
+ war
+
+
+ ${mdp45.artifact.classifier}
+
+ org.apache.maven.plugins
+ maven-deploy-plugin
+ @project.version@
+
+
+ mine::default::file://${basedir}/target
+
+
diff --git a/src/it/no-main-artifact-1/invoker.properties b/src/it/no-main-artifact-1/invoker.properties
new file mode 100644
index 00000000..e497ae44
--- /dev/null
+++ b/src/it/no-main-artifact-1/invoker.properties
@@ -0,0 +1,17 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+invoker.buildResult=failure
\ No newline at end of file
diff --git a/src/it/no-main-artifact-1/pom.xml b/src/it/no-main-artifact-1/pom.xml
index 2f30111c..a9a7c2bb 100644
--- a/src/it/no-main-artifact-1/pom.xml
+++ b/src/it/no-main-artifact-1/pom.xml
@@ -25,6 +25,7 @@ under the License.
org.apache.maven.its.deploy.nma1test1.0
+
jar
diff --git a/src/it/no-main-artifact-1/verify.bsh b/src/it/no-main-artifact-1/verify.groovy
similarity index 59%
rename from src/it/no-main-artifact-1/verify.bsh
rename to src/it/no-main-artifact-1/verify.groovy
index c6d7a377..9442aa7d 100644
--- a/src/it/no-main-artifact-1/verify.bsh
+++ b/src/it/no-main-artifact-1/verify.groovy
@@ -1,40 +1,23 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import java.io.*;
-import java.util.*;
-
-String[] paths =
-{
- "org/apache/maven/its/deploy/nma1/test/maven-metadata.xml",
- "org/apache/maven/its/deploy/nma1/test/1.0/test-1.0.pom",
- "org/apache/maven/its/deploy/nma1/test/1.0/test-1.0-it.jar",
-};
-
-for ( String path : paths )
-{
- File file = new File( new File( basedir, "target/repo" ), path );
- System.out.println( "Checking for existence of " + file );
- if ( !file.isFile() )
- {
- throw new FileNotFoundException( "Missing: " + file.getAbsolutePath() );
- }
-}
-
-return true;
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+def buildLog = new File ( basedir, "build.log")
+
+assert buildLog.text.contains( "The packaging plugin for this project did not assign "
+ + "a main file to the project but it has attachments. Change packaging to 'pom'." )
\ No newline at end of file
diff --git a/src/it/no-main-artifact-2/invoker.properties b/src/it/no-main-artifact-2/invoker.properties
new file mode 100644
index 00000000..e497ae44
--- /dev/null
+++ b/src/it/no-main-artifact-2/invoker.properties
@@ -0,0 +1,17 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+invoker.buildResult=failure
\ No newline at end of file
diff --git a/src/it/no-main-artifact-2/verify.bsh b/src/it/no-main-artifact-2/verify.groovy
similarity index 59%
rename from src/it/no-main-artifact-2/verify.bsh
rename to src/it/no-main-artifact-2/verify.groovy
index 4468ed8f..9442aa7d 100644
--- a/src/it/no-main-artifact-2/verify.bsh
+++ b/src/it/no-main-artifact-2/verify.groovy
@@ -1,40 +1,23 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import java.io.*;
-import java.util.*;
-
-String[] paths =
-{
- "org/apache/maven/its/deploy/nma2/test/maven-metadata.xml",
- "org/apache/maven/its/deploy/nma2/test/1.0/test-1.0.pom",
- "org/apache/maven/its/deploy/nma2/test/1.0/test-1.0-it.jar",
-};
-
-for ( String path : paths )
-{
- File file = new File( new File( basedir, "target/repo" ), path );
- System.out.println( "Checking for existence of " + file );
- if ( !file.isFile() )
- {
- throw new FileNotFoundException( "Missing: " + file.getAbsolutePath() );
- }
-}
-
-return true;
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+def buildLog = new File ( basedir, "build.log")
+
+assert buildLog.text.contains( "The packaging plugin for this project did not assign "
+ + "a main file to the project but it has attachments. Change packaging to 'pom'." )
\ No newline at end of file
diff --git a/src/it/no-main-artifact-snapshot/pom.xml b/src/it/no-main-artifact-snapshot/pom.xml
index ac2935ca..cb906106 100644
--- a/src/it/no-main-artifact-snapshot/pom.xml
+++ b/src/it/no-main-artifact-snapshot/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.maven.its.deploy.nmastest1.0-SNAPSHOT
- jar
+ pom
Tests the deployment of a snapshot for a project that has no main artifact file but only attached artifacts
@@ -49,6 +49,13 @@ under the License.
org.apache.maven.pluginsmaven-compiler-plugin2.0.2
+
+
+
+ compile
+
+
+ org.apache.maven.plugins
@@ -59,6 +66,13 @@ under the License.
org.apache.maven.pluginsmaven-jar-plugin2.1
+
+
+
+ jar
+
+
+ it
@@ -72,11 +86,13 @@ under the License.
org.apache.maven.pluginsmaven-resources-plugin2.2
-
-
- org.apache.maven.plugins
- maven-surefire-plugin
- 2.3.1
+
+
+
+ resources
+
+
+
diff --git a/src/main/java/org/apache/maven/plugins/deploy/DeployFileMojo.java b/src/main/java/org/apache/maven/plugins/deploy/DeployFileMojo.java
index 5a630a0b..f17dd8ae 100644
--- a/src/main/java/org/apache/maven/plugins/deploy/DeployFileMojo.java
+++ b/src/main/java/org/apache/maven/plugins/deploy/DeployFileMojo.java
@@ -54,6 +54,7 @@
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.project.MavenProject;
import org.apache.maven.project.MavenProjectHelper;
+import org.apache.maven.project.ProjectBuildingHelper;
import org.apache.maven.project.artifact.ProjectArtifactMetadata;
import org.apache.maven.shared.artifact.deploy.ArtifactDeployerException;
import org.apache.maven.shared.repository.RepositoryManager;
@@ -215,6 +216,9 @@ public class DeployFileMojo
@Component
private RepositoryManager repoManager;
+ @Component
+ private ProjectBuildingHelper projectBuildingHelper;
+
void initProperties()
throws MojoExecutionException
{
diff --git a/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java b/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java
index 115a235a..3c8ee440 100644
--- a/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java
+++ b/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java
@@ -235,26 +235,13 @@ private void deployProject( DeployRequest request )
}
else if ( !attachedArtifacts.isEmpty() )
{
- getLog().info( "No primary artifact to deploy, deploying attached artifacts instead." );
-
- Artifact pomArtifact =
- artifactFactory.createProjectArtifact( artifact.getGroupId(), artifact.getArtifactId(),
- artifact.getBaseVersion() );
- pomArtifact.setFile( pomFile );
- if ( request.isUpdateReleaseInfo() )
- {
- pomArtifact.setRelease( true );
- }
-
- deployableArtifacts.add( pomArtifact );
-
- // propagate the timestamped version to the main artifact for the attached artifacts to pick it up
- artifact.setResolvedVersion( pomArtifact.getVersion() );
+ throw new MojoExecutionException( "The packaging plugin for this project did not assign "
+ + "a main file to the project but it has attachments. Change packaging to 'pom'." );
}
else
{
- String message = "The packaging for this project did not assign a file to the build artifact";
- throw new MojoExecutionException( message );
+ throw new MojoExecutionException( "The packaging for this project did not assign "
+ + "a file to the build artifact" );
}
}
From cfee7eec96e38ef68faadba0ec366ee5ed7eaa0d Mon Sep 17 00:00:00 2001
From: Christian Schulte
Date: Thu, 5 May 2016 03:22:53 +0000
Subject: [PATCH 023/153] o Updated to 'plexus-utils-3.0.23'. o Updated to stop
suppressing exceptions incorrectly when closing resources. Most of the time
the 'IOUtils.closeQuietly' methods of 'commons-io' and the 'IOUtil.close'
method of 'plexus-utils' are used incorrectly. They are meant to be used in
'finally' blocks to not suppress an exception already thrown in the 'try'
block. The documentation of the 'IOUtils.closeQuietly' methods explicitly
contains usage examples. As soon as 'commons-io' or 'plexus-utils' is
targetted at Java 1.7, those methods should get deprecated and people
should be told to use the try-with-resources statement instead.
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1742353 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 2 +-
.../maven/plugins/deploy/DeployFileMojo.java | 14 +++++++++++++-
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/pom.xml b/pom.xml
index 08d01f06..c7a27e77 100644
--- a/pom.xml
+++ b/pom.xml
@@ -100,7 +100,7 @@ under the License.
org.codehaus.plexusplexus-utils
- 3.0.20
+ 3.0.23org.apache.maven.plugin-testing
diff --git a/src/main/java/org/apache/maven/plugins/deploy/DeployFileMojo.java b/src/main/java/org/apache/maven/plugins/deploy/DeployFileMojo.java
index f17dd8ae..f8068e88 100644
--- a/src/main/java/org/apache/maven/plugins/deploy/DeployFileMojo.java
+++ b/src/main/java/org/apache/maven/plugins/deploy/DeployFileMojo.java
@@ -267,6 +267,11 @@ void initProperties()
IOUtil.copy( pomInputStream, pomOutputStream );
+ pomOutputStream.close();
+ pomOutputStream = null;
+ pomInputStream.close();
+ pomInputStream = null;
+
processModel( readModel( pomFile ) );
break;
@@ -556,7 +561,10 @@ Model readModel( File pomFile )
try
{
reader = ReaderFactory.newXmlReader( pomFile );
- return new MavenXpp3Reader().read( reader );
+ final Model model = new MavenXpp3Reader().read( reader );
+ reader.close();
+ reader = null;
+ return model;
}
catch ( FileNotFoundException e )
{
@@ -594,8 +602,12 @@ private File generatePomFile()
tempFile.deleteOnExit();
fw = WriterFactory.newXmlWriter( tempFile );
+
new MavenXpp3Writer().write( fw, model );
+ fw.close();
+ fw = null;
+
return tempFile;
}
catch ( IOException e )
From d912c04ea6b1fd96c2ba8ac41a2637a43c01606e Mon Sep 17 00:00:00 2001
From: Christian Schulte
Date: Sun, 8 May 2016 00:27:05 +0000
Subject: [PATCH 024/153] o Updated to 'plexus-utils' 3.0.24.
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1742760 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index c7a27e77..777cb0f2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -100,7 +100,7 @@ under the License.
org.codehaus.plexusplexus-utils
- 3.0.23
+ 3.0.24org.apache.maven.plugin-testing
From 34b54a10303cff8925a85c9e795245231dbdc91e Mon Sep 17 00:00:00 2001
From: Herve Boutemy
Date: Sun, 15 May 2016 09:15:02 +0000
Subject: [PATCH 025/153] updated Jira url
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1743895 13f79535-47bb-0310-9956-ffa450edef68
---
src/site/site.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/site/site.xml b/src/site/site.xml
index d4d31b4c..195d0356 100644
--- a/src/site/site.xml
+++ b/src/site/site.xml
@@ -29,7 +29,7 @@ under the License.
-
+
From e45544218b4cabe45c47bb9f2582e83ddc268d0a Mon Sep 17 00:00:00 2001
From: Karl Heinz Marbaise
Date: Wed, 25 May 2016 21:10:11 +0000
Subject: [PATCH 026/153] Cleaned up code. o Removed unused code.
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1745541 13f79535-47bb-0310-9956-ffa450edef68
---
.../maven/plugins/deploy/DeployFileMojoTest.java | 6 ------
.../maven/plugins/deploy/DeployMojoTest.java | 15 ++-------------
2 files changed, 2 insertions(+), 19 deletions(-)
diff --git a/src/test/java/org/apache/maven/plugins/deploy/DeployFileMojoTest.java b/src/test/java/org/apache/maven/plugins/deploy/DeployFileMojoTest.java
index 9979513d..2564d77e 100644
--- a/src/test/java/org/apache/maven/plugins/deploy/DeployFileMojoTest.java
+++ b/src/test/java/org/apache/maven/plugins/deploy/DeployFileMojoTest.java
@@ -292,12 +292,6 @@ public void testDeployIfRepositoryLayoutIsLegacy()
String repositoryLayout = (String) getVariableValueFromObject( mojo, "repositoryLayout" );
- String groupId = (String) getVariableValueFromObject( mojo, "groupId" );
-
- String artifactId = (String) getVariableValueFromObject( mojo, "artifactId" );
-
- String version = (String) getVariableValueFromObject( mojo, "version" );
-
assertEquals( "legacy", repositoryLayout );
try
diff --git a/src/test/java/org/apache/maven/plugins/deploy/DeployMojoTest.java b/src/test/java/org/apache/maven/plugins/deploy/DeployMojoTest.java
index 54b2c924..97f2d3f5 100644
--- a/src/test/java/org/apache/maven/plugins/deploy/DeployMojoTest.java
+++ b/src/test/java/org/apache/maven/plugins/deploy/DeployMojoTest.java
@@ -29,31 +29,24 @@
import java.util.List;
import java.util.Properties;
-import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.repository.ArtifactRepository;
-import org.apache.maven.artifact.repository.ArtifactRepositoryFactory;
import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
import org.apache.maven.execution.MavenSession;
import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.testing.AbstractMojoTestCase;
+import org.apache.maven.plugin.testing.stubs.MavenProjectStub;
import org.apache.maven.plugins.deploy.stubs.ArtifactDeployerStub;
import org.apache.maven.plugins.deploy.stubs.ArtifactRepositoryStub;
import org.apache.maven.plugins.deploy.stubs.DeployArtifactStub;
-import org.apache.maven.plugin.testing.AbstractMojoTestCase;
-import org.apache.maven.plugin.testing.stubs.MavenProjectStub;
import org.apache.maven.project.MavenProject;
import org.apache.maven.project.ProjectBuildingRequest;
import org.apache.maven.repository.internal.MavenRepositorySystemSession;
-import org.apache.maven.shared.artifact.deploy.ArtifactDeployer;
import org.codehaus.plexus.util.FileUtils;
-import org.junit.Assume;
import org.junit.Ignore;
-import org.junit.internal.builders.IgnoredBuilder;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
-import org.sonatype.aether.RepositorySystemSession;
import org.sonatype.aether.impl.internal.SimpleLocalRepositoryManager;
-import org.sonatype.aether.repository.LocalRepositoryManager;
/**
* @author Allan Ramirez
@@ -468,10 +461,6 @@ public void testDeployWithAttachedArtifacts()
artifact.setFile( file );
- for( Artifact attachment :project.getAttachedArtifacts() )
- {}
-
-
ArtifactRepositoryStub repo = getRepoStub( mojo );
repo.setAppendToUrl( "basic-deploy-with-attached-artifacts" );
From 56db802dd57d1e4420fc6ac319e7fe7460d85677 Mon Sep 17 00:00:00 2001
From: Karl Heinz Marbaise
Date: Sun, 29 May 2016 12:02:28 +0000
Subject: [PATCH 027/153] [MDEPLOY-209] Upgrade maven-shared-components parent
to version 30
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1745987 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 777cb0f2..6d311a5e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.maven.pluginsmaven-plugins
- 28
+ 30../../pom/maven/maven-plugins/pom.xml
From 20f5b8a96df0d3103f56975c0f8a6ecafa97b975 Mon Sep 17 00:00:00 2001
From: Karl Heinz Marbaise
Date: Sun, 29 May 2016 12:04:14 +0000
Subject: [PATCH 028/153] Make a three digit version.
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1745988 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 6d311a5e..5bcd2395 100644
--- a/pom.xml
+++ b/pom.xml
@@ -30,7 +30,7 @@ under the License.
maven-deploy-plugin
- 3.0-SNAPSHOT
+ 3.0.0-SNAPSHOTmaven-pluginApache Maven Deploy Plugin
From e1575565b9ee05fadc81937445e6ee5610378a63 Mon Sep 17 00:00:00 2001
From: Karl Heinz Marbaise
Date: Sun, 29 May 2016 12:05:03 +0000
Subject: [PATCH 029/153] [MDEPLOY-209] Upgrade maven-shared-components parent
to version 30 o Followup let the parent do it's work.
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1745989 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 2 --
1 file changed, 2 deletions(-)
diff --git a/pom.xml b/pom.xml
index 5bcd2395..de229ca4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -59,8 +59,6 @@ under the License.
3.0
- 1.6
- 1.6
From ecd4a82346930b643c999fb419c3028836f5ba4d Mon Sep 17 00:00:00 2001
From: Karl Heinz Marbaise
Date: Sun, 29 May 2016 12:13:39 +0000
Subject: [PATCH 030/153] Use three digit version line for artifact-transfer as
well.
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1745991 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index de229ca4..f9a85f36 100644
--- a/pom.xml
+++ b/pom.xml
@@ -86,7 +86,7 @@ under the License.
org.apache.maven.sharedmaven-artifact-transfer
- 3.0-SNAPSHOT
+ 3.0.0-SNAPSHOT
From a7facac10e4587454df3e8a72b6fae7fe649a57a Mon Sep 17 00:00:00 2001
From: Christian Schulte
Date: Sat, 18 Jun 2016 13:51:35 +0000
Subject: [PATCH 031/153] [MDEPLOY-210] Upgrade of commons-io to 2.5.
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1749029 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/pom.xml b/pom.xml
index f9a85f36..7effe705 100644
--- a/pom.xml
+++ b/pom.xml
@@ -88,6 +88,12 @@ under the License.
maven-artifact-transfer3.0.0-SNAPSHOT
+
+
+ commons-io
+ commons-io
+ 2.5
+
From 91f24da53bca3299d743266f2b46b936674e5349 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Guillaume=20Bou=C3=A9?=
Date: Sat, 6 Aug 2016 18:38:21 +0000
Subject: [PATCH 032/153] [MDEPLOY-181] DeployAtEnd cannot be overwritten from
command line using -DdeployAtEnd=false
This issue is closed as "Not A Problem", removing the IT introduced in r1620139. It is expected for the parameters configured in the POM to have precedence over the ones from the default configuration.
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1755406 13f79535-47bb-0310-9956-ffa450edef68
---
src/it/MDEPLOY-181/invoker.properties | 20 -----
src/it/MDEPLOY-181/module1/pom.xml | 25 -------
src/it/MDEPLOY-181/module2/pom.xml | 38 ----------
src/it/MDEPLOY-181/pom.xml | 101 --------------------------
src/it/MDEPLOY-181/test.properties | 18 -----
src/it/MDEPLOY-181/verify.groovy | 21 ------
6 files changed, 223 deletions(-)
delete mode 100644 src/it/MDEPLOY-181/invoker.properties
delete mode 100644 src/it/MDEPLOY-181/module1/pom.xml
delete mode 100644 src/it/MDEPLOY-181/module2/pom.xml
delete mode 100644 src/it/MDEPLOY-181/pom.xml
delete mode 100644 src/it/MDEPLOY-181/test.properties
delete mode 100644 src/it/MDEPLOY-181/verify.groovy
diff --git a/src/it/MDEPLOY-181/invoker.properties b/src/it/MDEPLOY-181/invoker.properties
deleted file mode 100644
index ac00f436..00000000
--- a/src/it/MDEPLOY-181/invoker.properties
+++ /dev/null
@@ -1,20 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-invoker.goals = clean deploy
-# waiting for MDEPLOY-181 fix
-invoker.maven.version = 3.2.4+
\ No newline at end of file
diff --git a/src/it/MDEPLOY-181/module1/pom.xml b/src/it/MDEPLOY-181/module1/pom.xml
deleted file mode 100644
index aecbca0b..00000000
--- a/src/it/MDEPLOY-181/module1/pom.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
-
- 4.0.0
-
-
- org.apache.maven.its.mdeploy-170
- configperproject
- 1.0
-
- module1
-
-
diff --git a/src/it/MDEPLOY-181/module2/pom.xml b/src/it/MDEPLOY-181/module2/pom.xml
deleted file mode 100644
index d811568c..00000000
--- a/src/it/MDEPLOY-181/module2/pom.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
-
-
- 4.0.0
-
-
- org.apache.maven.its.mdeploy-170
- configperproject
- 1.0
-
- module2
- pom
-
-
-
-
- org.apache.maven.plugins
- maven-deploy-plugin
- @project.version@
-
- true
-
-
-
-
-
diff --git a/src/it/MDEPLOY-181/pom.xml b/src/it/MDEPLOY-181/pom.xml
deleted file mode 100644
index 3e7d3cc7..00000000
--- a/src/it/MDEPLOY-181/pom.xml
+++ /dev/null
@@ -1,101 +0,0 @@
-
-
-
-
-
- 4.0.0
-
- org.apache.maven.its.mdeploy-170
- configperproject
- 1.0
- pom
-
-
- Tests deployment at end with with different plugin configurations.
-
-
-
- true
-
-
-
-
- it
- file:///${basedir}/target/repo
- false
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-compiler-plugin
- 2.0.2
-
-
- org.apache.maven.plugins
- maven-deploy-plugin
- @project.version@
-
- true
-
-
-
- org.apache.maven.plugins
- maven-install-plugin
- 2.2
-
-
- org.apache.maven.plugins
- maven-jar-plugin
- 2.1
-
-
- org.apache.maven.plugins
- maven-resources-plugin
- 2.2
-
-
- org.apache.maven.plugins
- maven-source-plugin
- 2.0.4
-
-
- attach-sources
-
- jar
-
-
-
-
-
- org.apache.maven.plugins
- maven-surefire-plugin
- 2.3.1
-
-
-
-
-
- module1
- module2
-
-
diff --git a/src/it/MDEPLOY-181/test.properties b/src/it/MDEPLOY-181/test.properties
deleted file mode 100644
index fb658e56..00000000
--- a/src/it/MDEPLOY-181/test.properties
+++ /dev/null
@@ -1,18 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-deployAtEnd=false
\ No newline at end of file
diff --git a/src/it/MDEPLOY-181/verify.groovy b/src/it/MDEPLOY-181/verify.groovy
deleted file mode 100644
index 0c55d6e1..00000000
--- a/src/it/MDEPLOY-181/verify.groovy
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-def buildLog = new File ( basedir, "build.log")
-assert !buildLog.text.contains( 'true')
From f9575b1475914e70a873eda20041e707bc677917 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Guillaume=20Bou=C3=A9?=
Date: Sun, 7 Aug 2016 14:14:46 +0000
Subject: [PATCH 033/153] [MDEPLOY-212] deploy-file incorrectly deploys
attached artifacts [MDEPLOY-213] deploy-file replaces main artifact of a
project
The deploy-file Mojo now creates a new MavenProject and attaches to this project all artifacts to deploy. This also fixes the use of deprecated code from ArtifactFactory.
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1755441 13f79535-47bb-0310-9956-ffa450edef68
---
.../invoker.properties | 18 +++
src/it/3rd-party-pom-with-extras/pom.xml | 44 ++++++
.../test-0.1-src.tar.gz | Bin 0 -> 357 bytes
src/it/3rd-party-pom-with-extras/test-0.1.pom | 28 ++++
.../3rd-party-pom-with-extras/test-0.1.tar.gz | Bin 0 -> 357 bytes
src/it/3rd-party-pom-with-extras/test-0.1.zip | Bin 0 -> 345 bytes
.../3rd-party-pom-with-extras/test.properties | 27 ++++
src/it/3rd-party-pom-with-extras/verify.bsh | 57 ++++++++
src/it/MDEPLOY-212/invoker.properties | 18 +++
src/it/MDEPLOY-212/pom.xml | 79 ++++++++++
.../org/apache/maven/test/HelloWorld.java | 37 +++++
src/it/MDEPLOY-212/test-1.0.tar.gz | Bin 0 -> 357 bytes
src/it/MDEPLOY-212/test-1.0.zip | Bin 0 -> 345 bytes
src/it/MDEPLOY-212/verify.bsh | 56 ++++++++
src/it/MDEPLOY-213/invoker.properties | 18 +++
src/it/MDEPLOY-213/pom.xml | 88 ++++++++++++
.../org/apache/maven/test/HelloWorld.java | 37 +++++
src/it/MDEPLOY-213/test-1.0.tar.gz | Bin 0 -> 357 bytes
src/it/MDEPLOY-213/test-1.0.zip | Bin 0 -> 345 bytes
src/it/MDEPLOY-213/verify.bsh | 42 ++++++
.../maven/plugins/deploy/DeployFileMojo.java | 136 +++++++++++-------
.../plugins/deploy/DeployFileMojoTest.java | 14 --
22 files changed, 637 insertions(+), 62 deletions(-)
create mode 100644 src/it/3rd-party-pom-with-extras/invoker.properties
create mode 100644 src/it/3rd-party-pom-with-extras/pom.xml
create mode 100644 src/it/3rd-party-pom-with-extras/test-0.1-src.tar.gz
create mode 100644 src/it/3rd-party-pom-with-extras/test-0.1.pom
create mode 100644 src/it/3rd-party-pom-with-extras/test-0.1.tar.gz
create mode 100644 src/it/3rd-party-pom-with-extras/test-0.1.zip
create mode 100644 src/it/3rd-party-pom-with-extras/test.properties
create mode 100644 src/it/3rd-party-pom-with-extras/verify.bsh
create mode 100644 src/it/MDEPLOY-212/invoker.properties
create mode 100644 src/it/MDEPLOY-212/pom.xml
create mode 100644 src/it/MDEPLOY-212/src/main/java/org/apache/maven/test/HelloWorld.java
create mode 100644 src/it/MDEPLOY-212/test-1.0.tar.gz
create mode 100644 src/it/MDEPLOY-212/test-1.0.zip
create mode 100644 src/it/MDEPLOY-212/verify.bsh
create mode 100644 src/it/MDEPLOY-213/invoker.properties
create mode 100644 src/it/MDEPLOY-213/pom.xml
create mode 100644 src/it/MDEPLOY-213/src/main/java/org/apache/maven/test/HelloWorld.java
create mode 100644 src/it/MDEPLOY-213/test-1.0.tar.gz
create mode 100644 src/it/MDEPLOY-213/test-1.0.zip
create mode 100644 src/it/MDEPLOY-213/verify.bsh
diff --git a/src/it/3rd-party-pom-with-extras/invoker.properties b/src/it/3rd-party-pom-with-extras/invoker.properties
new file mode 100644
index 00000000..51d90e1b
--- /dev/null
+++ b/src/it/3rd-party-pom-with-extras/invoker.properties
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+invoker.goals = org.apache.maven.plugins:maven-deploy-plugin:${project.version}:deploy-file
diff --git a/src/it/3rd-party-pom-with-extras/pom.xml b/src/it/3rd-party-pom-with-extras/pom.xml
new file mode 100644
index 00000000..593d478a
--- /dev/null
+++ b/src/it/3rd-party-pom-with-extras/pom.xml
@@ -0,0 +1,44 @@
+
+
+
+
+
+ 4.0.0
+
+ org.apache.maven.its.deploy.tppwoc
+ test
+ 1.0
+ jar
+
+
+ Tests the manual deployment of a simple POM along with extra files.
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-deploy-plugin
+ @project.version@
+
+
+
+
+
diff --git a/src/it/3rd-party-pom-with-extras/test-0.1-src.tar.gz b/src/it/3rd-party-pom-with-extras/test-0.1-src.tar.gz
new file mode 100644
index 0000000000000000000000000000000000000000..2169f44a259a4bb8c65052af09615d7bf3eedaa0
GIT binary patch
literal 357
zcmV-r0h<0FiwFQtO#n^+1MSm6OT#b}2kW>}kpdJ9L68;%$VQ
zVZmiv+kyKe`WgI`rmmY|)ii)&h$rI}33QqoLK?v;+#jWffB!!PD3_OXipM6k?18w9Oh
zx6|&2Ea+_ZALcw<$623$TiB)i3oe?3^35*eb32}Ya!@-Y`{o|Vh+g&SEiL4I~vgBPJ)42gRl{nMj?*T9IiZKSqCfMSOol
z+l7x-^}n_1|Gxe$?v?7_ahn45{~H3Siw
+
+
+
+
+ 4.0.0
+ org.apache.maven.its.deploy.tppwoc
+ test
+ 1.0
+ pom
+
\ No newline at end of file
diff --git a/src/it/3rd-party-pom-with-extras/test-0.1.tar.gz b/src/it/3rd-party-pom-with-extras/test-0.1.tar.gz
new file mode 100644
index 0000000000000000000000000000000000000000..ad736b0d7b2e3120ed3a365a1cffe9cfbbd4e85c
GIT binary patch
literal 357
zcmV-r0h<0FiwFQcO#n^+1MSm6OT#b}2kW>}kpdJ9L68;%$VQ
zVZmiv+kyKe`WgI`rmmY|)ii)&h$rI}33QqoLK?v;+#jWffB!!PD3_OXipM6k?18w9Oh
zx6|&2Ea+_ZALcw<$623$TiB)i3oe?3^35*eb32}Ya!@-Y`{o|Vh+g&SEiL4I~vgBPJ)42gRl{nMj?*T9IiZKSqCfMSOol
z+l7x-^}n_1|Gxe$?v?7_ahn45{~H3Siw
+
+
+
+
+ 4.0.0
+
+ org.apache.maven.its.mdeploy-212
+ test
+ 1.0
+ jar
+
+
+ Tests that deploy-file only deploys the configured files when run in an existing project with attached artifacts
+
+
+ https://issues.apache.org/jira/browse/MDEPLOY-212
+
+
+
+
+ org.apache.maven.plugins
+ maven-javadoc-plugin
+ 2.7
+
+
+ attach-javadoc
+
+ jar
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-deploy-plugin
+ @project.version@
+
+
+ test-deploy
+
+ deploy-file
+
+ package
+
+ org.apache.maven.its.mdeploy-212
+ test
+ 1.0
+ test-1.0.tar.gz
+ tar.gz
+ file://${basedir}/target/repo
+ test-1.0.zip
+ zip
+ it
+
+
+
+
+
+
+
+
diff --git a/src/it/MDEPLOY-212/src/main/java/org/apache/maven/test/HelloWorld.java b/src/it/MDEPLOY-212/src/main/java/org/apache/maven/test/HelloWorld.java
new file mode 100644
index 00000000..ed8b2ca7
--- /dev/null
+++ b/src/it/MDEPLOY-212/src/main/java/org/apache/maven/test/HelloWorld.java
@@ -0,0 +1,37 @@
+package org.apache.maven.test;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * Hello World class
+ */
+public class HelloWorld
+{
+
+ /**
+ * Main method
+ * @param args Arguments
+ */
+ public static void main( String[] args )
+ {
+ System.out.println( "Hello world" );
+ }
+
+}
diff --git a/src/it/MDEPLOY-212/test-1.0.tar.gz b/src/it/MDEPLOY-212/test-1.0.tar.gz
new file mode 100644
index 0000000000000000000000000000000000000000..ad736b0d7b2e3120ed3a365a1cffe9cfbbd4e85c
GIT binary patch
literal 357
zcmV-r0h<0FiwFQcO#n^+1MSm6OT#b}2kW>}kpdJ9L68;%$VQ
zVZmiv+kyKe`WgI`rmmY|)ii)&h$rI}33QqoLK?v;+#jWffB!!PD3_OXipM6k?18w9Oh
zx6|&2Ea+_ZALcw<$623$TiB)i3oe?3^35*eb32}Ya!@-Y`{o|Vh+g&SEiL4I~vgBPJ)42gRl{nMj?*T9IiZKSqCfMSOol
z+l7x-^}n_1|Gxe$?v?7_ahn45{~H3Siw
+
+
+
+
+ 4.0.0
+
+ org.apache.maven.its.mdeploy-213
+ test
+ 1.0
+ jar
+
+
+ Tests that deploy-file does not change the main artifact of the project being built
+
+
+ https://issues.apache.org/jira/browse/MDEPLOY-213
+
+
+
+ it
+ file://${basedir}/target/repo
+ false
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-javadoc-plugin
+ 2.7
+
+
+ attach-javadoc
+
+ jar
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-deploy-plugin
+ @project.version@
+
+
+ test-deploy
+
+ deploy-file
+
+ package
+
+ org.apache.maven.its.mdeploy-213
+ test
+ 1.0
+ test-1.0.tar.gz
+ tar.gz
+ file://${basedir}/target/repo
+ test-1.0.zip
+ zip
+ it
+
+
+
+
+
+
+
+
diff --git a/src/it/MDEPLOY-213/src/main/java/org/apache/maven/test/HelloWorld.java b/src/it/MDEPLOY-213/src/main/java/org/apache/maven/test/HelloWorld.java
new file mode 100644
index 00000000..ed8b2ca7
--- /dev/null
+++ b/src/it/MDEPLOY-213/src/main/java/org/apache/maven/test/HelloWorld.java
@@ -0,0 +1,37 @@
+package org.apache.maven.test;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * Hello World class
+ */
+public class HelloWorld
+{
+
+ /**
+ * Main method
+ * @param args Arguments
+ */
+ public static void main( String[] args )
+ {
+ System.out.println( "Hello world" );
+ }
+
+}
diff --git a/src/it/MDEPLOY-213/test-1.0.tar.gz b/src/it/MDEPLOY-213/test-1.0.tar.gz
new file mode 100644
index 0000000000000000000000000000000000000000..ad736b0d7b2e3120ed3a365a1cffe9cfbbd4e85c
GIT binary patch
literal 357
zcmV-r0h<0FiwFQcO#n^+1MSm6OT#b}2kW>}kpdJ9L68;%$VQ
zVZmiv+kyKe`WgI`rmmY|)ii)&h$rI}33QqoLK?v;+#jWffB!!PD3_OXipM6k?18w9Oh
zx6|&2Ea+_ZALcw<$623$TiB)i3oe?3^35*eb32}Ya!@-Y`{o|Vh+g&SEiL4I~vgBPJ)42gRl{nMj?*T9IiZKSqCfMSOol
z+l7x-^}n_1|Gxe$?v?7_ahn45{~H3Siw deployableArtifacts = new ArrayList();
+
+ if ( classifier == null )
+ {
+ artifact.setFile( file );
+ deployableArtifacts.add( artifact );
+ }
+ else
+ {
+ projectHelper.attachArtifact( project, packaging, classifier, file );
+ }
+
// Upload the POM if requested, generating one if need be
if ( !"pom".equals( packaging ) )
{
- if ( pomFile != null )
+ File pom = pomFile;
+ if ( pom == null && generatePom )
{
- ProjectArtifactMetadata metadata = new ProjectArtifactMetadata( artifact, pomFile );
- artifact.addMetadata( metadata );
+ pom = generatePomFile();
}
- else if ( generatePom )
+ if ( pom != null )
{
- ProjectArtifactMetadata metadata = new ProjectArtifactMetadata( artifact, generatePomFile() );
- artifact.addMetadata( metadata );
+ if ( classifier == null )
+ {
+ ProjectArtifactMetadata metadata = new ProjectArtifactMetadata( artifact, pom );
+ artifact.addMetadata( metadata );
+ }
+ else
+ {
+ artifact.setFile( pom );
+ deployableArtifacts.add( artifact );
+ }
}
}
@@ -369,35 +391,16 @@ else if ( generatePom )
{
artifact.setRelease( true );
}
-
- project.setArtifact( artifact );
-
- artifact.setFile( file );
-
artifact.setRepository( deploymentRepository );
-
- List deployableArtifacts = new ArrayList();
-
- deployableArtifacts.add( artifact );
if ( sources != null )
{
- Artifact sourcesArtifact =
- artifactFactory.createArtifactWithClassifier( groupId, artifactId, version, "jar", "sources" );
-
- sourcesArtifact.setFile( sources );
-
- deployableArtifacts.add( sourcesArtifact );
+ projectHelper.attachArtifact( project, "jar", "sources", sources );
}
if ( javadoc != null )
{
- Artifact javadocArtifact =
- artifactFactory.createArtifactWithClassifier( groupId, artifactId, version, "jar", "javadoc" );
-
- javadocArtifact.setFile( javadoc );
-
- deployableArtifacts.add( javadocArtifact );
+ projectHelper.attachArtifact( project, "jar", "javadoc", javadoc );
}
if ( files != null )
@@ -498,17 +501,54 @@ else if ( generatePom )
throw new MojoExecutionException( e.getMessage(), e );
}
}
-
+
+ /**
+ * Creates a Maven project in-memory from the user-supplied groupId, artifactId and version.
+ * When a classifier is supplied, the packaging must be POM because the project with only have attachments.
+ * This project serves as basis to attach the artifacts to deploy to.
+ *
+ * @return The created Maven project, never null.
+ * @throws MojoFailureException When building the project failed.
+ */
+ private MavenProject createMavenProject()
+ throws MojoFailureException
+ {
+ ModelSource modelSource = new StringModelSource(
+ ""
+ + "4.0.0"
+ + "" + groupId + ""
+ + "" + artifactId + ""
+ + "" + version + ""
+ + "" + ( classifier == null ? packaging : "pom" ) + ""
+ + "" );
+ DefaultProjectBuildingRequest buildingRequest =
+ new DefaultProjectBuildingRequest( getSession().getProjectBuildingRequest() );
+ buildingRequest.setProcessPlugins( false );
+ try
+ {
+ return projectBuilder.build( modelSource, buildingRequest ).getProject();
+ }
+ catch ( ProjectBuildingException e )
+ {
+ throw new MojoFailureException( e.getMessage(), e );
+ }
+ }
+
/**
- * Gets the path of the specified artifact within the local repository. Note that the returned path need not exist
- * (yet).
+ * Gets the path of the artifact constructed from the supplied groupId, artifactId, version, classifier
+ * and packaging within the local repository. Note that the returned path need not exist (yet).
*
- * @param artifact The artifact whose local repo path should be determined, must not be null.
* @return The absolute path to the artifact when installed, never null.
*/
- private File getLocalRepoFile( Artifact artifact )
+ private File getLocalRepoFile()
{
- String path = repoManager.getPathForLocalArtifact( getSession().getProjectBuildingRequest(), artifact );
+ DefaultArtifactCoordinate coordinate = new DefaultArtifactCoordinate();
+ coordinate.setGroupId( groupId );
+ coordinate.setArtifactId( artifactId );
+ coordinate.setVersion( version );
+ coordinate.setClassifier( classifier );
+ coordinate.setExtension( packaging );
+ String path = repoManager.getPathForLocalArtifact( getSession().getProjectBuildingRequest(), coordinate );
return new File( repoManager.getLocalRepositoryBasedir( getSession().getProjectBuildingRequest() ), path );
}
diff --git a/src/test/java/org/apache/maven/plugins/deploy/DeployFileMojoTest.java b/src/test/java/org/apache/maven/plugins/deploy/DeployFileMojoTest.java
index 2564d77e..fff8676a 100644
--- a/src/test/java/org/apache/maven/plugins/deploy/DeployFileMojoTest.java
+++ b/src/test/java/org/apache/maven/plugins/deploy/DeployFileMojoTest.java
@@ -26,12 +26,10 @@
import java.util.ArrayList;
import java.util.List;
-import org.apache.maven.artifact.Artifact;
import org.apache.maven.execution.MavenSession;
import org.apache.maven.model.Model;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.testing.AbstractMojoTestCase;
-import org.apache.maven.plugin.testing.stubs.MavenProjectStub;
import org.apache.maven.project.ProjectBuildingRequest;
import org.apache.maven.repository.internal.MavenRepositorySystemSession;
import org.mockito.InjectMocks;
@@ -53,8 +51,6 @@ public class DeployFileMojoTest
private File remoteRepo;
- MavenProjectStub projectStub = new MavenProjectStub();
-
@Mock
private MavenSession session;
@@ -72,8 +68,6 @@ public void setUp()
{
remoteRepo.mkdirs();
}
-
- projectStub.setAttachedArtifacts( new ArrayList() );
}
public void testDeployTestEnvironment()
@@ -103,8 +97,6 @@ public void testBasicDeployFile()
repositorySession.setLocalRepositoryManager( new SimpleLocalRepositoryManager( LOCAL_REPO ) );
when( buildingRequest.getRepositorySession() ).thenReturn( repositorySession );
- setVariableValueToObject( mojo, "project", projectStub );
-
String groupId = (String) getVariableValueFromObject( mojo, "groupId" );
String artifactId = (String) getVariableValueFromObject( mojo, "artifactId" );
@@ -206,8 +198,6 @@ public void testDeployIfClassifierIsSet()
repositorySession.setLocalRepositoryManager( new SimpleLocalRepositoryManager( LOCAL_REPO ) );
when( buildingRequest.getRepositorySession() ).thenReturn( repositorySession );
- setVariableValueToObject( mojo, "project", projectStub );
-
String classifier = ( String ) getVariableValueFromObject( mojo, "classifier" );
String groupId = ( String ) getVariableValueFromObject( mojo, "groupId" );
@@ -256,8 +246,6 @@ public void testDeployIfArtifactIsNotJar()
repositorySession.setLocalRepositoryManager( new SimpleLocalRepositoryManager( LOCAL_REPO ) );
when( buildingRequest.getRepositorySession() ).thenReturn( repositorySession );
- setVariableValueToObject( mojo, "project", projectStub );
-
String groupId = (String) getVariableValueFromObject( mojo, "groupId" );
String artifactId = (String) getVariableValueFromObject( mojo, "artifactId" );
@@ -288,8 +276,6 @@ public void testDeployIfRepositoryLayoutIsLegacy()
assertNotNull( mojo );
- setVariableValueToObject( mojo, "project", projectStub );
-
String repositoryLayout = (String) getVariableValueFromObject( mojo, "repositoryLayout" );
assertEquals( "legacy", repositoryLayout );
From 01c8658e8e5792eb42f69e0b15d838fad1568953 Mon Sep 17 00:00:00 2001
From: Karl Heinz Marbaise
Date: Sun, 18 Sep 2016 17:24:00 +0000
Subject: [PATCH 034/153] o DeployMojo Using ProjectDeployer instead of
ArtifactDeployer which makes code much more simpler and using
ProjectDeployerRequest instead of DeployRequest. o DeployFileMojo using
ArtifactDeployer. o Added slf4j-api and slf4j-noop in test scope to get
running the tests.
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1761345 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 13 ++
.../plugins/deploy/AbstractDeployMojo.java | 69 -------
.../maven/plugins/deploy/DeployFileMojo.java | 53 +++---
.../maven/plugins/deploy/DeployMojo.java | 175 +++++++-----------
.../maven/plugins/deploy/DeployRequest.java | 149 ---------------
.../maven/plugins/deploy/DeployMojoTest.java | 23 ++-
.../deploy/stubs/ArtifactDeployerStub.java | 2 +-
7 files changed, 128 insertions(+), 356 deletions(-)
delete mode 100644 src/main/java/org/apache/maven/plugins/deploy/DeployRequest.java
diff --git a/pom.xml b/pom.xml
index 7effe705..31a8e935 100644
--- a/pom.xml
+++ b/pom.xml
@@ -136,6 +136,19 @@ under the License.
1.7test
+
+ org.slf4j
+ slf4j-api
+ 1.7.5
+ provided
+
+
+ org.slf4j
+ slf4j-nop
+ 1.7.5
+ test
+
+
diff --git a/src/main/java/org/apache/maven/plugins/deploy/AbstractDeployMojo.java b/src/main/java/org/apache/maven/plugins/deploy/AbstractDeployMojo.java
index e54c7781..7a78e8bc 100644
--- a/src/main/java/org/apache/maven/plugins/deploy/AbstractDeployMojo.java
+++ b/src/main/java/org/apache/maven/plugins/deploy/AbstractDeployMojo.java
@@ -19,10 +19,8 @@
* under the License.
*/
-import java.util.Collection;
import java.util.Map;
-import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.factory.ArtifactFactory;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.repository.ArtifactRepositoryPolicy;
@@ -34,8 +32,6 @@
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.Component;
import org.apache.maven.plugins.annotations.Parameter;
-import org.apache.maven.shared.artifact.deploy.ArtifactDeployer;
-import org.apache.maven.shared.artifact.deploy.ArtifactDeployerException;
/**
* @version $Id$
@@ -43,11 +39,6 @@
public abstract class AbstractDeployMojo
extends AbstractMojo
{
- /**
- */
- @Component
- private ArtifactDeployer deployer;
-
/**
* Component used to create an artifact.
*/
@@ -86,16 +77,6 @@ public abstract class AbstractDeployMojo
/* Setters and Getters */
- public ArtifactDeployer getDeployer()
- {
- return deployer;
- }
-
- public void setDeployer( ArtifactDeployer deployer )
- {
- this.deployer = deployer;
- }
-
void failIfOffline()
throws MojoFailureException
{
@@ -128,56 +109,6 @@ int getRetryFailedDeploymentCount()
return retryFailedDeploymentCount;
}
- /**
- * Deploy an artifact from a particular file.
- * @param artifacts the artifact definitions
- * @param deploymentRepository the repository to deploy to
- * @param localRepository the local repository to install into
- * @param retryFailedDeploymentCount TODO
- *
- * @throws ArtifactDeployerException if an error occurred deploying the artifact
- */
- protected void deploy( Collection artifacts, ArtifactRepository deploymentRepository,
- int retryFailedDeploymentCount )
- throws ArtifactDeployerException
- {
-
- // for now retry means redeploy the complete artifacts collection
- int retryFailedDeploymentCounter = Math.max( 1, Math.min( 10, retryFailedDeploymentCount ) );
- ArtifactDeployerException exception = null;
- for ( int count = 0; count < retryFailedDeploymentCounter; count++ )
- {
- try
- {
- if ( count > 0 )
- {
- getLog().info( "Retrying deployment attempt " + ( count + 1 ) + " of "
- + retryFailedDeploymentCounter );
- }
-
- getDeployer().deploy( session.getProjectBuildingRequest(), deploymentRepository, artifacts );
- exception = null;
- break;
- }
- catch ( ArtifactDeployerException e )
- {
- if ( count + 1 < retryFailedDeploymentCounter )
- {
- getLog().warn( "Encountered issue during deployment: " + e.getLocalizedMessage() );
- getLog().debug( e );
- }
- if ( exception == null )
- {
- exception = e;
- }
- }
- }
- if ( exception != null )
- {
- throw exception;
- }
- }
-
protected ArtifactRepository createDeploymentArtifactRepository( String id, String url,
ArtifactRepositoryLayout layout,
boolean uniqueVersion2 )
diff --git a/src/main/java/org/apache/maven/plugins/deploy/DeployFileMojo.java b/src/main/java/org/apache/maven/plugins/deploy/DeployFileMojo.java
index 5334c11a..9afe7ea5 100644
--- a/src/main/java/org/apache/maven/plugins/deploy/DeployFileMojo.java
+++ b/src/main/java/org/apache/maven/plugins/deploy/DeployFileMojo.java
@@ -61,6 +61,7 @@
import org.apache.maven.project.ProjectBuildingException;
import org.apache.maven.project.artifact.ProjectArtifactMetadata;
import org.apache.maven.shared.artifact.DefaultArtifactCoordinate;
+import org.apache.maven.shared.artifact.deploy.ArtifactDeployer;
import org.apache.maven.shared.artifact.deploy.ArtifactDeployerException;
import org.apache.maven.shared.repository.RepositoryManager;
import org.codehaus.plexus.util.FileUtils;
@@ -79,13 +80,15 @@
public class DeployFileMojo
extends AbstractDeployMojo
{
+ @Component
+ private ArtifactDeployer artifactDeployer;
/**
* Used for attaching the artifacts to deploy to the project.
*/
@Component
private MavenProjectHelper projectHelper;
-
+
/**
* Used for creating the project to which the artifacts to deploy will be attached.
*/
@@ -218,10 +221,10 @@ public class DeployFileMojo
*/
@Parameter( property = "files" )
private String files;
-
+
@Component
private RepositoryManager repoManager;
-
+
void initProperties()
throws MojoExecutionException
{
@@ -258,16 +261,16 @@ void initProperties()
try
{
pomInputStream = jarFile.getInputStream( entry );
-
+
String base = file.getName();
if ( base.indexOf( '.' ) > 0 )
{
base = base.substring( 0, base.lastIndexOf( '.' ) );
}
pomFile = new File( file.getParentFile(), base + ".pom" );
-
+
pomOutputStream = new FileOutputStream( pomFile );
-
+
IOUtil.copy( pomInputStream, pomOutputStream );
pomOutputStream.close();
@@ -494,18 +497,19 @@ public void execute()
try
{
- deploy( deployableArtifacts, deploymentRepository, getRetryFailedDeploymentCount() );
+ artifactDeployer.deploy( getSession().getProjectBuildingRequest(), deploymentRepository,
+ deployableArtifacts );
}
catch ( ArtifactDeployerException e )
{
throw new MojoExecutionException( e.getMessage(), e );
}
}
-
+
/**
- * Creates a Maven project in-memory from the user-supplied groupId, artifactId and version.
- * When a classifier is supplied, the packaging must be POM because the project with only have attachments.
- * This project serves as basis to attach the artifacts to deploy to.
+ * Creates a Maven project in-memory from the user-supplied groupId, artifactId and version. When a classifier is
+ * supplied, the packaging must be POM because the project with only have attachments. This project serves as basis
+ * to attach the artifacts to deploy to.
*
* @return The created Maven project, never null.
* @throws MojoFailureException When building the project failed.
@@ -513,14 +517,10 @@ public void execute()
private MavenProject createMavenProject()
throws MojoFailureException
{
- ModelSource modelSource = new StringModelSource(
- ""
- + "4.0.0"
- + "" + groupId + ""
- + "" + artifactId + ""
- + "" + version + ""
- + "" + ( classifier == null ? packaging : "pom" ) + ""
- + "" );
+ ModelSource modelSource =
+ new StringModelSource( "" + "4.0.0" + "" + groupId
+ + "" + "" + artifactId + "" + "" + version + ""
+ + "" + ( classifier == null ? packaging : "pom" ) + "" + "" );
DefaultProjectBuildingRequest buildingRequest =
new DefaultProjectBuildingRequest( getSession().getProjectBuildingRequest() );
buildingRequest.setProcessPlugins( false );
@@ -533,10 +533,10 @@ private MavenProject createMavenProject()
throw new MojoFailureException( e.getMessage(), e );
}
}
-
+
/**
- * Gets the path of the artifact constructed from the supplied groupId, artifactId, version, classifier
- * and packaging within the local repository. Note that the returned path need not exist (yet).
+ * Gets the path of the artifact constructed from the supplied groupId, artifactId, version, classifier and
+ * packaging within the local repository. Note that the returned path need not exist (yet).
*
* @return The absolute path to the artifact when installed, never null.
*/
@@ -673,7 +673,7 @@ private void validateArtifactInformation()
ModelBuildingRequest buildingRequest = new DefaultModelBuildingRequest();
DeployModelProblemCollector problemCollector = new DeployModelProblemCollector();
-
+
modelValidator.validateEffectiveModel( model, buildingRequest, problemCollector );
if ( problemCollector.getMessageCount() > 0 )
@@ -763,15 +763,16 @@ void setClassifier( String classifier )
{
this.classifier = classifier;
}
-
- private static class DeployModelProblemCollector implements ModelProblemCollector
+
+ private static class DeployModelProblemCollector
+ implements ModelProblemCollector
{
/** */
private static final String NEWLINE = System.getProperty( "line.separator" );
/** */
private List messages = new ArrayList();
-
+
@Override
public void add( Severity severity, String message, InputLocation location, Exception cause )
{
diff --git a/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java b/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java
index 3c8ee440..e1e61389 100644
--- a/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java
+++ b/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java
@@ -19,7 +19,27 @@
* under the License.
*/
-import java.io.File;
+import java.io.IOException;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@@ -27,18 +47,20 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.ArtifactUtils;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugins.annotations.Component;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.project.MavenProject;
-import org.apache.maven.project.artifact.ProjectArtifactMetadata;
-import org.apache.maven.shared.artifact.deploy.ArtifactDeployerException;
+import org.apache.maven.project.ProjectBuildingRequest;
+import org.apache.maven.shared.project.NoFileAssignedException;
+import org.apache.maven.shared.project.deploy.ProjectDeployer;
+import org.apache.maven.shared.project.deploy.ProjectDeployerRequest;
/**
* Deploys an artifact to remote repository.
@@ -60,8 +82,8 @@ public class DeployMojo
*/
private static final AtomicInteger READYPROJECTSCOUNTER = new AtomicInteger();
- private static final List DEPLOYREQUESTS =
- Collections.synchronizedList( new ArrayList() );
+ private static final List DEPLOYREQUESTS =
+ Collections.synchronizedList( new ArrayList() );
/**
*/
@@ -124,6 +146,12 @@ public class DeployMojo
@Parameter( property = "maven.deploy.skip", defaultValue = "false" )
private boolean skip;
+ /**
+ * Component used to deploy project.
+ */
+ @Component
+ private ProjectDeployer projectDeployer;
+
public void execute()
throws MojoExecutionException, MojoFailureException
{
@@ -137,17 +165,26 @@ public void execute()
failIfOffline();
// CHECKSTYLE_OFF: LineLength
- DeployRequest currentExecutionDeployRequest =
- new DeployRequest().setProject( project ).setUpdateReleaseInfo( isUpdateReleaseInfo() ).setRetryFailedDeploymentCount( getRetryFailedDeploymentCount() ).setAltReleaseDeploymentRepository( altReleaseDeploymentRepository ).setAltSnapshotDeploymentRepository( altSnapshotDeploymentRepository ).setAltDeploymentRepository( altDeploymentRepository );
+ // @formatter:off
+ ProjectDeployerRequest pdr = new ProjectDeployerRequest()
+ .setProject( project )
+ .setUpdateReleaseInfo( isUpdateReleaseInfo() )
+ .setRetryFailedDeploymentCount( getRetryFailedDeploymentCount() )
+ .setAltReleaseDeploymentRepository( altReleaseDeploymentRepository )
+ .setAltSnapshotDeploymentRepository( altSnapshotDeploymentRepository )
+ .setAltDeploymentRepository( altDeploymentRepository );
+ // @formatter:on
// CHECKSTYLE_ON: LineLength
+ ArtifactRepository repo = getDeploymentRepository( pdr );
+
if ( !deployAtEnd )
{
- deployProject( currentExecutionDeployRequest );
+ deployProject( getSession().getProjectBuildingRequest(), pdr, repo );
}
else
{
- DEPLOYREQUESTS.add( currentExecutionDeployRequest );
+ DEPLOYREQUESTS.add( pdr );
addedDeployRequest = true;
}
}
@@ -159,121 +196,46 @@ public void execute()
{
while ( !DEPLOYREQUESTS.isEmpty() )
{
- deployProject( DEPLOYREQUESTS.remove( 0 ) );
+ ArtifactRepository repo = getDeploymentRepository( DEPLOYREQUESTS.get( 0 ) );
+
+ deployProject( getSession().getProjectBuildingRequest(), DEPLOYREQUESTS.remove( 0 ), repo );
}
}
}
else if ( addedDeployRequest )
{
getLog().info( "Deploying " + project.getGroupId() + ":" + project.getArtifactId() + ":"
- + project.getVersion() + " at end" );
+ + project.getVersion() + " at end" );
}
}
- private void deployProject( DeployRequest request )
- throws MojoExecutionException, MojoFailureException
+ private void deployProject( ProjectBuildingRequest pbr, ProjectDeployerRequest pir, ArtifactRepository repo )
+ throws MojoFailureException, MojoExecutionException
{
- List deployableArtifacts = new ArrayList();
-
- Artifact artifact = request.getProject().getArtifact();
- String packaging = request.getProject().getPackaging();
- File pomFile = request.getProject().getFile();
-
- List attachedArtifacts = request.getProject().getAttachedArtifacts();
-
- ArtifactRepository repo =
- getDeploymentRepository( request.getProject(), request.getAltDeploymentRepository(),
- request.getAltReleaseDeploymentRepository(),
- request.getAltSnapshotDeploymentRepository() );
-
- String protocol = repo.getProtocol();
-
- if ( protocol.equalsIgnoreCase( "scp" ) )
- {
- File sshFile = new File( System.getProperty( "user.home" ), ".ssh" );
-
- if ( !sshFile.exists() )
- {
- sshFile.mkdirs();
- }
- }
-
- // Deploy the POM
- boolean isPomArtifact = "pom".equals( packaging );
- if ( !isPomArtifact )
+ try
{
- ProjectArtifactMetadata metadata = new ProjectArtifactMetadata( artifact, pomFile );
- artifact.addMetadata( metadata );
+ projectDeployer.deployProject( pbr, pir, repo );
}
- else
+ catch ( IOException e )
{
- artifact.setFile( pomFile );
+ throw new MojoFailureException( "IOException", e );
}
-
- if ( request.isUpdateReleaseInfo() )
+ catch ( NoFileAssignedException e )
{
- artifact.setRelease( true );
+ throw new MojoExecutionException( "NoFileAssignedException", e );
}
- artifact.setRepository( repo );
-
- int retryFailedDeploymentCount = request.getRetryFailedDeploymentCount();
-
- try
- {
- if ( isPomArtifact )
- {
- deployableArtifacts.add( artifact );
- }
- else
- {
- File file = artifact.getFile();
-
- if ( file != null && file.isFile() )
- {
- deployableArtifacts.add( artifact );
- }
- else if ( !attachedArtifacts.isEmpty() )
- {
- throw new MojoExecutionException( "The packaging plugin for this project did not assign "
- + "a main file to the project but it has attachments. Change packaging to 'pom'." );
- }
- else
- {
- throw new MojoExecutionException( "The packaging for this project did not assign "
- + "a file to the build artifact" );
- }
- }
-
- for ( Artifact attached : attachedArtifacts )
- {
- // This is here when AttachedArtifact is used, like m-sources-plugin:2.0.4
- try
- {
- attached.setRepository( repo );
- }
- catch ( UnsupportedOperationException e )
- {
- getLog().warn( attached.getId() + " has been attached with deprecated code, "
- + "try to upgrade the responsible plugin" );
- }
-
- deployableArtifacts.add( attached );
- }
-
- deploy( deployableArtifacts, repo, retryFailedDeploymentCount );
- }
- catch ( ArtifactDeployerException e )
- {
- throw new MojoExecutionException( e.getMessage(), e );
- }
}
- ArtifactRepository getDeploymentRepository( MavenProject project, String altDeploymentRepository,
- String altReleaseDeploymentRepository,
- String altSnapshotDeploymentRepository )
+ ArtifactRepository getDeploymentRepository( ProjectDeployerRequest pdr )
+
throws MojoExecutionException, MojoFailureException
{
+ MavenProject project = pdr.getProject();
+ String altDeploymentRepository = pdr.getAltDeploymentRepository();
+ String altReleaseDeploymentRepository = pdr.getAltReleaseDeploymentRepository();
+ String altSnapshotDeploymentRepository = pdr.getAltSnapshotDeploymentRepository();
+
ArtifactRepository repo = null;
String altDeploymentRepo;
@@ -320,9 +282,8 @@ else if ( !ArtifactUtils.isSnapshot( project.getVersion() ) && altReleaseDeploym
if ( repo == null )
{
- String msg =
- "Deployment failed: repository element was not specified in the POM inside"
- + " distributionManagement element or in -DaltDeploymentRepository=id::layout::url parameter";
+ String msg = "Deployment failed: repository element was not specified in the POM inside"
+ + " distributionManagement element or in -DaltDeploymentRepository=id::layout::url parameter";
throw new MojoExecutionException( msg );
}
diff --git a/src/main/java/org/apache/maven/plugins/deploy/DeployRequest.java b/src/main/java/org/apache/maven/plugins/deploy/DeployRequest.java
deleted file mode 100644
index cdb99f7e..00000000
--- a/src/main/java/org/apache/maven/plugins/deploy/DeployRequest.java
+++ /dev/null
@@ -1,149 +0,0 @@
-package org.apache.maven.plugins.deploy;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import org.apache.maven.project.MavenProject;
-
-/**
- *
- * @author Robert Scholte
- * @since 2.8.1
- */
-class DeployRequest
-{
-
- // From AbstractDeployMojo
-
- private boolean updateReleaseInfo;
-
- private int retryFailedDeploymentCount;
-
- // From DeployMojo
-
- private MavenProject project;
-
- private String altDeploymentRepository;
-
- private String altSnapshotDeploymentRepository;
-
- private String altReleaseDeploymentRepository;
-
- /**
- * @return the updateReleaseInfo
- */
- public boolean isUpdateReleaseInfo()
- {
- return updateReleaseInfo;
- }
-
- /**
- * @param updateReleaseInfo the updateReleaseInfo to set
- */
- public DeployRequest setUpdateReleaseInfo( boolean updateReleaseInfo )
- {
- this.updateReleaseInfo = updateReleaseInfo;
- return this;
- }
-
- /**
- * @return the retryFailedDeploymentCount
- */
- public int getRetryFailedDeploymentCount()
- {
- return retryFailedDeploymentCount;
- }
-
- /**
- * @param retryFailedDeploymentCount the retryFailedDeploymentCount to set
- */
- public DeployRequest setRetryFailedDeploymentCount( int retryFailedDeploymentCount )
- {
- this.retryFailedDeploymentCount = retryFailedDeploymentCount;
- return this;
- }
-
- /**
- * @return the project
- */
- public MavenProject getProject()
- {
- return project;
- }
-
- /**
- * @param project the project to set
- */
- public DeployRequest setProject( MavenProject project )
- {
- this.project = project;
- return this;
- }
-
- /**
- * @return the altDeploymentRepository
- */
- public String getAltDeploymentRepository()
- {
- return altDeploymentRepository;
- }
-
- /**
- * @param altDeploymentRepository the altDeploymentRepository to set
- */
- public DeployRequest setAltDeploymentRepository( String altDeploymentRepository )
- {
- this.altDeploymentRepository = altDeploymentRepository;
- return this;
- }
-
- /**
- * @return the altSnapshotDeploymentRepository
- */
- public String getAltSnapshotDeploymentRepository()
- {
- return altSnapshotDeploymentRepository;
- }
-
- /**
- * @param altSnapshotDeploymentRepository the altSnapshotDeploymentRepository to set
- */
- public DeployRequest setAltSnapshotDeploymentRepository( String altSnapshotDeploymentRepository )
- {
- this.altSnapshotDeploymentRepository = altSnapshotDeploymentRepository;
- return this;
- }
-
- /**
- * @return the altReleaseDeploymentRepository
- */
- public String getAltReleaseDeploymentRepository()
- {
- return altReleaseDeploymentRepository;
- }
-
- /**
- * @param altReleaseDeploymentRepository the altReleaseDeploymentRepository to set
- */
- public DeployRequest setAltReleaseDeploymentRepository( String altReleaseDeploymentRepository )
- {
- this.altReleaseDeploymentRepository = altReleaseDeploymentRepository;
- return this;
- }
-}
diff --git a/src/test/java/org/apache/maven/plugins/deploy/DeployMojoTest.java b/src/test/java/org/apache/maven/plugins/deploy/DeployMojoTest.java
index 97f2d3f5..17e63c10 100644
--- a/src/test/java/org/apache/maven/plugins/deploy/DeployMojoTest.java
+++ b/src/test/java/org/apache/maven/plugins/deploy/DeployMojoTest.java
@@ -41,6 +41,7 @@
import org.apache.maven.project.MavenProject;
import org.apache.maven.project.ProjectBuildingRequest;
import org.apache.maven.repository.internal.MavenRepositorySystemSession;
+import org.apache.maven.shared.project.deploy.ProjectDeployerRequest;
import org.codehaus.plexus.util.FileUtils;
import org.junit.Ignore;
import org.mockito.InjectMocks;
@@ -405,6 +406,13 @@ public void testDeployIfArtifactFileIsNull()
"target/test-classes/unit/basic-deploy-test/plugin-config.xml" );
DeployMojo mojo = ( DeployMojo ) lookupMojo( "deploy", testPom );
+
+ MockitoAnnotations.initMocks( this );
+
+ ProjectBuildingRequest buildingRequest = mock ( ProjectBuildingRequest.class );
+ when( session.getProjectBuildingRequest() ).thenReturn( buildingRequest );
+
+ setVariableValueToObject( mojo, "session", session );
assertNotNull( mojo );
@@ -598,9 +606,12 @@ public void testAltSnapshotDeploymentRepository()
project.setVersion( "1.0-SNAPSHOT" );
+ ProjectDeployerRequest pdr =
+ new ProjectDeployerRequest()
+ .setProject( project )
+ .setAltDeploymentRepository( "altSnapshotDeploymentRepository::default::http://localhost" );
assertEquals( repository,
- mojo.getDeploymentRepository( project, null, null,
- "altSnapshotDeploymentRepository::default::http://localhost" ) );
+ mojo.getDeploymentRepository( pdr ));
}
public void testAltReleaseDeploymentRepository()
@@ -618,9 +629,13 @@ public void testAltReleaseDeploymentRepository()
project.setVersion( "1.0" );
+ ProjectDeployerRequest pdr =
+ new ProjectDeployerRequest()
+ .setProject( project )
+ .setAltReleaseDeploymentRepository( "altReleaseDeploymentRepository::default::http://localhost" );
+
assertEquals( repository,
- mojo.getDeploymentRepository( project, null,
- "altReleaseDeploymentRepository::default::http://localhost", null ) );
+ mojo.getDeploymentRepository( pdr ));
}
private void addFileToList( File file, List fileList )
diff --git a/src/test/java/org/apache/maven/plugins/deploy/stubs/ArtifactDeployerStub.java b/src/test/java/org/apache/maven/plugins/deploy/stubs/ArtifactDeployerStub.java
index 518e36be..9bdf48ae 100644
--- a/src/test/java/org/apache/maven/plugins/deploy/stubs/ArtifactDeployerStub.java
+++ b/src/test/java/org/apache/maven/plugins/deploy/stubs/ArtifactDeployerStub.java
@@ -39,7 +39,7 @@ public void deploy( ProjectBuildingRequest request, Collection mavenAr
}
@Override
- public void deploy( ProjectBuildingRequest arg0, ArtifactRepository arg1, Collection arg2 )
+ public void deploy( ProjectBuildingRequest arg0, ArtifactRepository arg1, Collection arg2)
throws ArtifactDeployerException
{
// does nothing
From cb1a5a39b75db2d4f64db03179a9a81a720c4924 Mon Sep 17 00:00:00 2001
From: Karl Heinz Marbaise
Date: Sun, 18 Sep 2016 17:53:04 +0000
Subject: [PATCH 035/153] Fixed duplicated license header.
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1761349 13f79535-47bb-0310-9956-ffa450edef68
---
.../maven/plugins/deploy/DeployMojo.java | 19 -------------------
1 file changed, 19 deletions(-)
diff --git a/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java b/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java
index e1e61389..2680cb31 100644
--- a/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java
+++ b/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java
@@ -21,25 +21,6 @@
import java.io.IOException;
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
From ed6d6ecaed80a863fb97381b5ed62252189eb77e Mon Sep 17 00:00:00 2001
From: Karl Heinz Marbaise
Date: Wed, 21 Sep 2016 19:37:25 +0000
Subject: [PATCH 036/153] Followed renaming methods in DeployProject interface.
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1761801 13f79535-47bb-0310-9956-ffa450edef68
---
src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java b/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java
index 2680cb31..02c08806 100644
--- a/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java
+++ b/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java
@@ -195,7 +195,7 @@ private void deployProject( ProjectBuildingRequest pbr, ProjectDeployerRequest p
{
try
{
- projectDeployer.deployProject( pbr, pir, repo );
+ projectDeployer.deploy( pbr, pir, repo );
}
catch ( IOException e )
{
From 5a5598836664ac3b6e5428923a9705a94cd31ebc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Guillaume=20Bou=C3=A9?=
Date: Sun, 25 Sep 2016 15:26:55 +0000
Subject: [PATCH 037/153] Removed unused artifactFactory
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1762216 13f79535-47bb-0310-9956-ffa450edef68
---
.../org/apache/maven/plugins/deploy/AbstractDeployMojo.java | 6 ------
1 file changed, 6 deletions(-)
diff --git a/src/main/java/org/apache/maven/plugins/deploy/AbstractDeployMojo.java b/src/main/java/org/apache/maven/plugins/deploy/AbstractDeployMojo.java
index 7a78e8bc..bc9c4c07 100644
--- a/src/main/java/org/apache/maven/plugins/deploy/AbstractDeployMojo.java
+++ b/src/main/java/org/apache/maven/plugins/deploy/AbstractDeployMojo.java
@@ -21,7 +21,6 @@
import java.util.Map;
-import org.apache.maven.artifact.factory.ArtifactFactory;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.repository.ArtifactRepositoryPolicy;
import org.apache.maven.artifact.repository.MavenArtifactRepository;
@@ -39,11 +38,6 @@
public abstract class AbstractDeployMojo
extends AbstractMojo
{
- /**
- * Component used to create an artifact.
- */
- @Component
- protected ArtifactFactory artifactFactory;
/**
* Map that contains the layouts.
From 9c7f253423ce3c81bb0e504d269d8ba5443b53e5 Mon Sep 17 00:00:00 2001
From: Anders Hammar
Date: Fri, 4 Nov 2016 22:04:13 +0000
Subject: [PATCH 038/153] [MDEPLOY-215] Remove link to non-existing Codehaus
wiki
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1768110 13f79535-47bb-0310-9956-ffa450edef68
---
src/site/apt/index.apt.vm | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/src/site/apt/index.apt.vm b/src/site/apt/index.apt.vm
index c053e1a7..fedbe54a 100644
--- a/src/site/apt/index.apt.vm
+++ b/src/site/apt/index.apt.vm
@@ -78,9 +78,7 @@ ${project.name}
* Usage
General instructions on how to use the Deploy Plugin can be found on the {{{./usage.html}usage page}}. Some more
- specific use cases are described in the examples given below. Last but not least, users occasionally contribute
- additional examples, tips or errata to the
- {{{http://docs.codehaus.org/display/MAVENUSER/Deploy+Plugin}plugin's wiki page}}.
+ specific use cases are described in the examples given below.
In case you still have questions regarding the plugin's usage, please have a look at the {{{./faq.html}FAQ}} and feel
free to contact the {{{./mail-lists.html}user mailing list}}. The posts to the mailing list are archived and could
From c47aeea877cc2804469db8c265c39040b79b753a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Guillaume=20Bou=C3=A9?=
Date: Fri, 11 Nov 2016 20:36:18 +0000
Subject: [PATCH 039/153] [MDEPLOY-211] uniqueVersion broken (if not supported,
should be removed from doc, and warning printed)
The parameter uniqueVersion in the deploy-file goal isn't supported since Maven 3, so it is removed from the code base and from the documentation of the plugin. A check is made to fail the build if it is still used, and the index page mentions the removal.
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1769339 13f79535-47bb-0310-9956-ffa450edef68
---
.../pom.xml | 1 -
.../pom.xml | 1 -
.../pom.xml | 1 -
src/it/MDEPLOY-213/pom.xml | 1 -
src/it/attach-release-jar/pom.xml | 1 -
src/it/deploy-at-end-fail/pom.xml | 1 -
src/it/deploy-at-end-pass/pom.xml | 1 -
src/it/offline/pom.xml | 1 -
src/it/release-jar/pom.xml | 1 -
src/it/release-pom/pom.xml | 1 -
.../plugins/deploy/AbstractDeployMojo.java | 3 +--
.../maven/plugins/deploy/DeployFileMojo.java | 17 ++++++++++++++---
.../maven/plugins/deploy/DeployMojo.java | 2 +-
src/site/apt/file-deployment.apt | 2 --
src/site/apt/index.apt.vm | 10 ++++++++++
src/site/apt/usage.apt | 3 +--
.../maven/plugins/deploy/DeployMojoTest.java | 10 ++++------
.../plugin-config.xml | 1 -
.../deploy-file-classifier/plugin-config.xml | 1 -
.../plugin-config.xml | 1 -
.../deploy-file-pom-file/plugin-config.xml | Bin 3372 -> 3278 bytes
.../unit/deploy-file-test/plugin-config.xml | 1 -
22 files changed, 31 insertions(+), 30 deletions(-)
diff --git a/src/it/MDEPLOY-169_deploy-at-end-multithread/pom.xml b/src/it/MDEPLOY-169_deploy-at-end-multithread/pom.xml
index b1913bd2..576847dd 100644
--- a/src/it/MDEPLOY-169_deploy-at-end-multithread/pom.xml
+++ b/src/it/MDEPLOY-169_deploy-at-end-multithread/pom.xml
@@ -39,7 +39,6 @@ under the License.
itfile:///${basedir}/target/repo
- false
diff --git a/src/it/MDEPLOY-170_deploy-at-end-configperproject/pom.xml b/src/it/MDEPLOY-170_deploy-at-end-configperproject/pom.xml
index 3e7d3cc7..42f53daf 100644
--- a/src/it/MDEPLOY-170_deploy-at-end-configperproject/pom.xml
+++ b/src/it/MDEPLOY-170_deploy-at-end-configperproject/pom.xml
@@ -39,7 +39,6 @@ under the License.
itfile:///${basedir}/target/repo
- false
diff --git a/src/it/MDEPLOY-202_deployfile-with-multiple-executions/pom.xml b/src/it/MDEPLOY-202_deployfile-with-multiple-executions/pom.xml
index d52e4485..a9a99927 100644
--- a/src/it/MDEPLOY-202_deployfile-with-multiple-executions/pom.xml
+++ b/src/it/MDEPLOY-202_deployfile-with-multiple-executions/pom.xml
@@ -38,7 +38,6 @@
itfile:///${basedir}/target/repo
- false
diff --git a/src/it/MDEPLOY-213/pom.xml b/src/it/MDEPLOY-213/pom.xml
index 23a18488..7688d377 100644
--- a/src/it/MDEPLOY-213/pom.xml
+++ b/src/it/MDEPLOY-213/pom.xml
@@ -37,7 +37,6 @@ under the License.
itfile://${basedir}/target/repo
- false
diff --git a/src/it/attach-release-jar/pom.xml b/src/it/attach-release-jar/pom.xml
index 035707c5..3d2039eb 100644
--- a/src/it/attach-release-jar/pom.xml
+++ b/src/it/attach-release-jar/pom.xml
@@ -40,7 +40,6 @@ under the License.
itfile:///${basedir}/target/repo
- false
diff --git a/src/it/deploy-at-end-fail/pom.xml b/src/it/deploy-at-end-fail/pom.xml
index 92e45b05..be9ef50c 100644
--- a/src/it/deploy-at-end-fail/pom.xml
+++ b/src/it/deploy-at-end-fail/pom.xml
@@ -39,7 +39,6 @@ under the License.
itfile:///${basedir}/target/repo
- false
diff --git a/src/it/deploy-at-end-pass/pom.xml b/src/it/deploy-at-end-pass/pom.xml
index 8021f6a1..ecf739a8 100644
--- a/src/it/deploy-at-end-pass/pom.xml
+++ b/src/it/deploy-at-end-pass/pom.xml
@@ -39,7 +39,6 @@ under the License.
itfile:///${basedir}/target/repo
- false
diff --git a/src/it/offline/pom.xml b/src/it/offline/pom.xml
index c6043142..32e53ec2 100644
--- a/src/it/offline/pom.xml
+++ b/src/it/offline/pom.xml
@@ -39,7 +39,6 @@ under the License.
itfile:///${basedir}/target/repo
- false
diff --git a/src/it/release-jar/pom.xml b/src/it/release-jar/pom.xml
index a4e0eadc..51fe2487 100644
--- a/src/it/release-jar/pom.xml
+++ b/src/it/release-jar/pom.xml
@@ -40,7 +40,6 @@ under the License.
itfile:///${basedir}/target/repo
- false
diff --git a/src/it/release-pom/pom.xml b/src/it/release-pom/pom.xml
index ec19a46f..526fb37c 100644
--- a/src/it/release-pom/pom.xml
+++ b/src/it/release-pom/pom.xml
@@ -40,7 +40,6 @@ under the License.
itfile:///${basedir}/target/repo
- false
diff --git a/src/main/java/org/apache/maven/plugins/deploy/AbstractDeployMojo.java b/src/main/java/org/apache/maven/plugins/deploy/AbstractDeployMojo.java
index bc9c4c07..504806e7 100644
--- a/src/main/java/org/apache/maven/plugins/deploy/AbstractDeployMojo.java
+++ b/src/main/java/org/apache/maven/plugins/deploy/AbstractDeployMojo.java
@@ -104,8 +104,7 @@ int getRetryFailedDeploymentCount()
}
protected ArtifactRepository createDeploymentArtifactRepository( String id, String url,
- ArtifactRepositoryLayout layout,
- boolean uniqueVersion2 )
+ ArtifactRepositoryLayout layout )
{
return new MavenArtifactRepository( id, url, layout, new ArtifactRepositoryPolicy(),
new ArtifactRepositoryPolicy() );
diff --git a/src/main/java/org/apache/maven/plugins/deploy/DeployFileMojo.java b/src/main/java/org/apache/maven/plugins/deploy/DeployFileMojo.java
index 9afe7ea5..73b44255 100644
--- a/src/main/java/org/apache/maven/plugins/deploy/DeployFileMojo.java
+++ b/src/main/java/org/apache/maven/plugins/deploy/DeployFileMojo.java
@@ -191,9 +191,13 @@ public class DeployFileMojo
/**
* Whether to deploy snapshots with a unique version or not.
+ *
+ * @deprecated As of Maven 3, this isn't supported anymore and this parameter is only present to break the build
+ * if you use it!
*/
- @Parameter( property = "uniqueVersion", defaultValue = "true" )
- private boolean uniqueVersion;
+ @Parameter( property = "uniqueVersion" )
+ @Deprecated
+ private Boolean uniqueVersion;
/**
* The component used to validate the user-supplied artifact coordinates.
@@ -324,6 +328,13 @@ void initProperties()
public void execute()
throws MojoExecutionException, MojoFailureException
{
+ if ( uniqueVersion != null )
+ {
+ throw new MojoExecutionException( "You are using 'uniqueVersion' which has been removed"
+ + " from the maven-deploy-plugin. "
+ + "Please see the >>Major Version Upgrade to version 3.0.0<< on the plugin site." );
+ }
+
failIfOffline();
if ( !file.exists() )
@@ -338,7 +349,7 @@ public void execute()
ArtifactRepositoryLayout layout = getLayout( repositoryLayout );
ArtifactRepository deploymentRepository =
- createDeploymentArtifactRepository( repositoryId, url, layout, uniqueVersion );
+ createDeploymentArtifactRepository( repositoryId, url, layout );
String protocol = deploymentRepository.getProtocol();
diff --git a/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java b/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java
index 02c08806..b626d319 100644
--- a/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java
+++ b/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java
@@ -252,7 +252,7 @@ else if ( !ArtifactUtils.isSnapshot( project.getVersion() ) && altReleaseDeploym
ArtifactRepositoryLayout repoLayout = getLayout( layout );
- repo = createDeploymentArtifactRepository( id, url, repoLayout, true );
+ repo = createDeploymentArtifactRepository( id, url, repoLayout );
}
}
diff --git a/src/site/apt/file-deployment.apt b/src/site/apt/file-deployment.apt
index ee121408..a886cbf0 100644
--- a/src/site/apt/file-deployment.apt
+++ b/src/site/apt/file-deployment.apt
@@ -38,8 +38,6 @@ File Deployment
* {{{./examples/deploying-sources-javadoc.html}Deploy an artifact with sources and javadoc jars}}
- * {{{./examples/disabling-timestamps-suffix.html}Disable timestamps suffix in an artifact}}
-
* {{{./examples/deploying-in-legacy-layout.html}Deploy an artifact in legacy layout}}
[]
\ No newline at end of file
diff --git a/src/site/apt/index.apt.vm b/src/site/apt/index.apt.vm
index fedbe54a..c5e814e3 100644
--- a/src/site/apt/index.apt.vm
+++ b/src/site/apt/index.apt.vm
@@ -75,6 +75,16 @@ ${project.name}
[]
+* Major Version Upgrade to version 3.0.0
+
+ Please note that the following parameter has been completely removed from the plugin configuration:
+
+ * uniqueVersion
+
+ []
+
+ As of Maven 3, snapshot artifacts will always be deployed using a timestamped version.
+
* Usage
General instructions on how to use the Deploy Plugin can be found on the {{{./usage.html}usage page}}. Some more
diff --git a/src/site/apt/usage.apt b/src/site/apt/usage.apt
index 156e027a..8eafe93d 100644
--- a/src/site/apt/usage.apt
+++ b/src/site/apt/usage.apt
@@ -119,8 +119,7 @@ mvn deploy:deploy-file -Durl=file://C:\m2-repo \
[-Dclassifier=test] \
[-DgeneratePom=true] \
[-DgeneratePom.description="My Project Description"] \
- [-DrepositoryLayout=legacy] \
- [-DuniqueVersion=false]
+ [-DrepositoryLayout=legacy]
+---+
If the following required information is not specified in some way, the goal
diff --git a/src/test/java/org/apache/maven/plugins/deploy/DeployMojoTest.java b/src/test/java/org/apache/maven/plugins/deploy/DeployMojoTest.java
index 17e63c10..e88bfb59 100644
--- a/src/test/java/org/apache/maven/plugins/deploy/DeployMojoTest.java
+++ b/src/test/java/org/apache/maven/plugins/deploy/DeployMojoTest.java
@@ -600,9 +600,8 @@ public void testAltSnapshotDeploymentRepository()
setVariableValueToObject( mojo, "repositoryLayouts", Collections.singletonMap( "default", repositoryLayout ) );
ArtifactRepository repository = mock( ArtifactRepository.class );
- when(
- mojo.createDeploymentArtifactRepository( "altSnapshotDeploymentRepository", "http://localhost",
- repositoryLayout, true ) ).thenReturn( repository );
+ when( mojo.createDeploymentArtifactRepository( "altSnapshotDeploymentRepository", "http://localhost",
+ repositoryLayout ) ).thenReturn( repository );
project.setVersion( "1.0-SNAPSHOT" );
@@ -623,9 +622,8 @@ public void testAltReleaseDeploymentRepository()
setVariableValueToObject( mojo, "repositoryLayouts", Collections.singletonMap( "default", repositoryLayout ) );
ArtifactRepository repository = mock( ArtifactRepository.class );
- when(
- mojo.createDeploymentArtifactRepository( "altReleaseDeploymentRepository", "http://localhost",
- repositoryLayout, true ) ).thenReturn( repository );
+ when( mojo.createDeploymentArtifactRepository( "altReleaseDeploymentRepository", "http://localhost",
+ repositoryLayout ) ).thenReturn( repository );
project.setVersion( "1.0" );
diff --git a/src/test/resources/unit/deploy-file-artifact-not-jar/plugin-config.xml b/src/test/resources/unit/deploy-file-artifact-not-jar/plugin-config.xml
index f9b092e2..4c7fc951 100644
--- a/src/test/resources/unit/deploy-file-artifact-not-jar/plugin-config.xml
+++ b/src/test/resources/unit/deploy-file-artifact-not-jar/plugin-config.xml
@@ -29,7 +29,6 @@ under the License.
${basedir}/src/test/resources/unit/deploy-file-artifact-not-jar/target/deploy-test-file.zipdeploy-testfile://${basedir}/target/remote-repo/deploy-file-artifact-not-jar
- truedefaulttrue
diff --git a/src/test/resources/unit/deploy-file-classifier/plugin-config.xml b/src/test/resources/unit/deploy-file-classifier/plugin-config.xml
index 7929357d..59e09452 100644
--- a/src/test/resources/unit/deploy-file-classifier/plugin-config.xml
+++ b/src/test/resources/unit/deploy-file-classifier/plugin-config.xml
@@ -30,7 +30,6 @@ under the License.
${basedir}/src/test/resources/unit/deploy-file-classifier/target/deploy-test-file-1.0-SNAPSHOT.jardeploy-testfile://${basedir}/target/remote-repo/deploy-file-classifier
- truebindefaulttrue
diff --git a/src/test/resources/unit/deploy-file-legacy-repository-layout/plugin-config.xml b/src/test/resources/unit/deploy-file-legacy-repository-layout/plugin-config.xml
index d59b015e..97531f1b 100644
--- a/src/test/resources/unit/deploy-file-legacy-repository-layout/plugin-config.xml
+++ b/src/test/resources/unit/deploy-file-legacy-repository-layout/plugin-config.xml
@@ -30,7 +30,6 @@ under the License.
${basedir}/src/test/resources/unit/deploy-file-legacy-repository-layout/target/deploy-test-file-1.0-SNAPSHOT.jardeploy-testfile://${basedir}/target/remote-repo/deploy-file-legacy-repository-layout
- truelegacytrue
diff --git a/src/test/resources/unit/deploy-file-pom-file/plugin-config.xml b/src/test/resources/unit/deploy-file-pom-file/plugin-config.xml
index d1e9b0e52c7c848338b8223e2546c22064199a15..97f60b0a64958e1e0b07850c1b94e8f4924bc773 100644
GIT binary patch
delta 12
TcmZ1@bxv}_Kd#L&+!q)DC58o2
delta 69
zcmX>nxkhTkKQ7Z!hCGH$hC+r?hE#?yATDAk2J-WPqIL`=KpsfkhCv@lBdMF*&!N4E
H`y3+xeCQER
diff --git a/src/test/resources/unit/deploy-file-test/plugin-config.xml b/src/test/resources/unit/deploy-file-test/plugin-config.xml
index 8dd3915d..78c4c1ed 100644
--- a/src/test/resources/unit/deploy-file-test/plugin-config.xml
+++ b/src/test/resources/unit/deploy-file-test/plugin-config.xml
@@ -31,7 +31,6 @@ under the License.
deploy-testfile://${basedir}/target/remote-repo/deploy-file-testPOM was created from deploy:deploy-file
- truedefaulttrue
From 1170494f0d3247b6c4a1bc602a0d2d6359cf6ac3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Guillaume=20Bou=C3=A9?=
Date: Sat, 19 Nov 2016 15:21:30 +0000
Subject: [PATCH 040/153] Migration to Maven 3: because of an API change in
ModelProblemCollector between 3.0.x and 3.1.x, that interface cannot be used
as-is for compatibility for both in order to determine if the coordinate
information passed by the user is valid. The plugins are compiled with 3.0
core and are currently linked to a specific ModelProblemCollector, but
starting with 3.1.0-alpha-1, Maven core calls a different method than the one
the plugins were compiled with. This results in AbstractMethodError at
run-time. (this was not detected by the ITs because, although they tested
that the build failed with missing parameters, it didn't test the cause of
the failure.)
Since the plugins are now using a new MavenProject instance, and attaching things to it in order to deploy or install them, it is possible to rely on the validation performed during the building of that project to catch model errors.
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1770497 13f79535-47bb-0310-9956-ffa450edef68
---
src/it/gav-validation/invoker.properties | 3 +
...est.properties => test-invalid.properties} | 0
src/it/gav-validation/test-missing.properties | 23 +++++
.../{verify.bsh => verify.groovy} | 19 ++--
.../maven/plugins/deploy/DeployFileMojo.java | 98 ++++---------------
5 files changed, 55 insertions(+), 88 deletions(-)
rename src/it/gav-validation/{test.properties => test-invalid.properties} (100%)
create mode 100644 src/it/gav-validation/test-missing.properties
rename src/it/gav-validation/{verify.bsh => verify.groovy} (75%)
diff --git a/src/it/gav-validation/invoker.properties b/src/it/gav-validation/invoker.properties
index af74ba28..6635374e 100644
--- a/src/it/gav-validation/invoker.properties
+++ b/src/it/gav-validation/invoker.properties
@@ -17,3 +17,6 @@
invoker.goals = org.apache.maven.plugins:maven-deploy-plugin:${project.version}:deploy-file
invoker.buildResult = failure
+
+invoker.systemPropertiesFile.1 = test-invalid.properties
+invoker.systemPropertiesFile.2 = test-missing.properties
diff --git a/src/it/gav-validation/test.properties b/src/it/gav-validation/test-invalid.properties
similarity index 100%
rename from src/it/gav-validation/test.properties
rename to src/it/gav-validation/test-invalid.properties
diff --git a/src/it/gav-validation/test-missing.properties b/src/it/gav-validation/test-missing.properties
new file mode 100644
index 00000000..f43471ec
--- /dev/null
+++ b/src/it/gav-validation/test-missing.properties
@@ -0,0 +1,23 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+file = test.jar
+url = file:///${basedir}/target/repo
+packaging = jar
+
+# missing coordinates should have deploy-file bail out
+groupId = groupId
diff --git a/src/it/gav-validation/verify.bsh b/src/it/gav-validation/verify.groovy
similarity index 75%
rename from src/it/gav-validation/verify.bsh
rename to src/it/gav-validation/verify.groovy
index d1c2f46c..64caa903 100644
--- a/src/it/gav-validation/verify.bsh
+++ b/src/it/gav-validation/verify.groovy
@@ -17,22 +17,19 @@
* under the License.
*/
-import java.io.*;
-import java.util.*;
-
String[] paths =
-{
+[
"org/apache/maven/its/deploy/gv",
-};
+];
for ( String path : paths )
{
- File file = new File( new File( basedir, "target/repo" ), path );
- System.out.println( "Checking for absence of " + file );
- if ( file.exists() )
- {
- throw new Exception( "Existing: " + file.getAbsolutePath() );
- }
+ assert !new File( new File( basedir, "target/repo" ), path ).exists()
}
+File buildLog = new File( basedir, 'build.log' )
+assert buildLog.exists()
+assert buildLog.text.contains( "The artifact information is incomplete" )
+assert buildLog.text.contains( "The artifact information is not valid" )
+
return true;
diff --git a/src/main/java/org/apache/maven/plugins/deploy/DeployFileMojo.java b/src/main/java/org/apache/maven/plugins/deploy/DeployFileMojo.java
index 73b44255..1c493d35 100644
--- a/src/main/java/org/apache/maven/plugins/deploy/DeployFileMojo.java
+++ b/src/main/java/org/apache/maven/plugins/deploy/DeployFileMojo.java
@@ -37,13 +37,9 @@
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
-import org.apache.maven.model.InputLocation;
import org.apache.maven.model.Model;
import org.apache.maven.model.Parent;
-import org.apache.maven.model.building.DefaultModelBuildingRequest;
-import org.apache.maven.model.building.ModelBuildingRequest;
-import org.apache.maven.model.building.ModelProblem.Severity;
-import org.apache.maven.model.building.ModelProblemCollector;
+import org.apache.maven.model.building.ModelBuildingException;
import org.apache.maven.model.building.ModelSource;
import org.apache.maven.model.building.StringModelSource;
import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
@@ -64,6 +60,7 @@
import org.apache.maven.shared.artifact.deploy.ArtifactDeployer;
import org.apache.maven.shared.artifact.deploy.ArtifactDeployerException;
import org.apache.maven.shared.repository.RepositoryManager;
+import org.apache.maven.shared.utils.Os;
import org.codehaus.plexus.util.FileUtils;
import org.codehaus.plexus.util.IOUtil;
import org.codehaus.plexus.util.ReaderFactory;
@@ -192,8 +189,8 @@ public class DeployFileMojo
/**
* Whether to deploy snapshots with a unique version or not.
*
- * @deprecated As of Maven 3, this isn't supported anymore and this parameter is only present to break the build
- * if you use it!
+ * @deprecated As of Maven 3, this isn't supported anymore and this parameter is only present to break the build if
+ * you use it!
*/
@Parameter( property = "uniqueVersion" )
@Deprecated
@@ -344,12 +341,9 @@ public void execute()
initProperties();
- validateArtifactInformation();
-
ArtifactRepositoryLayout layout = getLayout( repositoryLayout );
- ArtifactRepository deploymentRepository =
- createDeploymentArtifactRepository( repositoryId, url, layout );
+ ArtifactRepository deploymentRepository = createDeploymentArtifactRepository( repositoryId, url, layout );
String protocol = deploymentRepository.getProtocol();
@@ -358,14 +352,14 @@ public void execute()
throw new MojoExecutionException( "No transfer protocol found." );
}
+ MavenProject project = createMavenProject();
+ Artifact artifact = project.getArtifact();
+
if ( file.equals( getLocalRepoFile() ) )
{
throw new MojoFailureException( "Cannot deploy artifact from the local repository: " + file );
}
- MavenProject project = createMavenProject();
- Artifact artifact = project.getArtifact();
-
List deployableArtifacts = new ArrayList();
if ( classifier == null )
@@ -523,11 +517,17 @@ public void execute()
* to attach the artifacts to deploy to.
*
* @return The created Maven project, never null.
+ * @throws MojoExecutionException When the model of the project could not be built.
* @throws MojoFailureException When building the project failed.
*/
private MavenProject createMavenProject()
- throws MojoFailureException
+ throws MojoExecutionException, MojoFailureException
{
+ if ( groupId == null || artifactId == null || version == null || packaging == null )
+ {
+ throw new MojoExecutionException( "The artifact information is incomplete: 'groupId', 'artifactId', "
+ + "'version' and 'packaging' are required." );
+ }
ModelSource modelSource =
new StringModelSource( "" + "4.0.0" + "" + groupId
+ "" + "" + artifactId + "" + "" + version + ""
@@ -541,7 +541,12 @@ private MavenProject createMavenProject()
}
catch ( ProjectBuildingException e )
{
- throw new MojoFailureException( e.getMessage(), e );
+ if ( e.getCause() instanceof ModelBuildingException )
+ {
+ throw new MojoExecutionException( "The artifact information is not valid:" + Os.LINE_SEP
+ + e.getCause().getMessage() );
+ }
+ throw new MojoFailureException( "Unable to create the project.", e );
}
}
@@ -671,29 +676,6 @@ private File generatePomFile()
}
}
- /**
- * Validates the user-supplied artifact information.
- *
- * @throws MojoExecutionException If any artifact coordinate is invalid.
- */
- private void validateArtifactInformation()
- throws MojoExecutionException
- {
- Model model = generateModel();
-
- ModelBuildingRequest buildingRequest = new DefaultModelBuildingRequest();
-
- DeployModelProblemCollector problemCollector = new DeployModelProblemCollector();
-
- modelValidator.validateEffectiveModel( model, buildingRequest, problemCollector );
-
- if ( problemCollector.getMessageCount() > 0 )
- {
- throw new MojoExecutionException( "The artifact information is incomplete or not valid:\n"
- + problemCollector.render( " " ) );
- }
- }
-
/**
* Generates a minimal model from the user-supplied artifact information.
*
@@ -775,42 +757,4 @@ void setClassifier( String classifier )
this.classifier = classifier;
}
- private static class DeployModelProblemCollector
- implements ModelProblemCollector
- {
- /** */
- private static final String NEWLINE = System.getProperty( "line.separator" );
-
- /** */
- private List messages = new ArrayList();
-
- @Override
- public void add( Severity severity, String message, InputLocation location, Exception cause )
- {
- messages.add( message );
- }
-
- public int getMessageCount()
- {
- return messages.size();
- }
-
- public String render( String indentation )
- {
- if ( messages.size() == 0 )
- {
- return indentation + "There were no validation errors.";
- }
-
- StringBuilder message = new StringBuilder();
-
- for ( int i = 0; i < messages.size(); i++ )
- {
- message.append( indentation + "[" + i + "] " + messages.get( i ).toString() + NEWLINE );
- }
-
- return message.toString();
- }
- };
-
}
From 2be1537350c1a4978ed45e1bb9505a4d39da8677 Mon Sep 17 00:00:00 2001
From: Michael Osipov
Date: Sat, 10 Dec 2016 23:24:24 +0000
Subject: [PATCH 041/153] Correct jira.codehaus.org to issues.apache.org/jira
Submitted-by: John Patrick
This closes #98
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1773543 13f79535-47bb-0310-9956-ffa450edef68
---
src/it/MDEPLOY-178_deployfile-with-embedded-pom/pom.xml | 2 +-
src/it/MDEPLOY-178_deployfile-with-embedded-pom/verify.groovy | 2 +-
.../path/to/pom.xml | 2 +-
src/it/deploy-attached-sources/pom.xml | 2 +-
src/it/deploy-default-packaging/pom.xml | 2 +-
5 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/it/MDEPLOY-178_deployfile-with-embedded-pom/pom.xml b/src/it/MDEPLOY-178_deployfile-with-embedded-pom/pom.xml
index aa089934..8ff44f4d 100644
--- a/src/it/MDEPLOY-178_deployfile-with-embedded-pom/pom.xml
+++ b/src/it/MDEPLOY-178_deployfile-with-embedded-pom/pom.xml
@@ -31,7 +31,7 @@ under the License.
Test to verify that the pom inside the jar in used when deploying the file
- https://jira.codehaus.org/browse/MDEPLOY-178
+ https://issues.apache.org/jira/browse/MDEPLOY-178
diff --git a/src/it/MDEPLOY-178_deployfile-with-embedded-pom/verify.groovy b/src/it/MDEPLOY-178_deployfile-with-embedded-pom/verify.groovy
index 2c6701ad..2b197b2d 100644
--- a/src/it/MDEPLOY-178_deployfile-with-embedded-pom/verify.groovy
+++ b/src/it/MDEPLOY-178_deployfile-with-embedded-pom/verify.groovy
@@ -26,4 +26,4 @@ assert buildLog.exists()
assert buildLog.text.contains( "[DEBUG] Using META-INF/maven/org.apache.maven.plugins.deploy.its/mdeploy178/pom.xml as pomFile" )
def pomProject = new XmlSlurper().parse( deployedPom )
-assert "https://jira.codehaus.org/browse/MDEPLOY-178".equals( pomProject.url.text() )
\ No newline at end of file
+assert "https://issues.apache.org/jira/browse/MDEPLOY-178".equals( pomProject.url.text() )
\ No newline at end of file
diff --git a/src/it/MDEPLOY-184_deployfile-with-javadoc-and-sources/path/to/pom.xml b/src/it/MDEPLOY-184_deployfile-with-javadoc-and-sources/path/to/pom.xml
index 0f56b2d4..3b0f7d9f 100644
--- a/src/it/MDEPLOY-184_deployfile-with-javadoc-and-sources/path/to/pom.xml
+++ b/src/it/MDEPLOY-184_deployfile-with-javadoc-and-sources/path/to/pom.xml
@@ -26,6 +26,6 @@ under the License.
artifact-name1.0
- http://jira.codehaus.org/browse/MDEPLOY-184
+ https://issues.apache.org/jira/browse/MDEPLOY-184
diff --git a/src/it/deploy-attached-sources/pom.xml b/src/it/deploy-attached-sources/pom.xml
index d0aac263..8dbaec1b 100644
--- a/src/it/deploy-attached-sources/pom.xml
+++ b/src/it/deploy-attached-sources/pom.xml
@@ -29,7 +29,7 @@ under the License.
deploy-attached-sourcessample jar project with attached sources
- http://jira.codehaus.org/browse/MDEPLOY-48
+ https://issues.apache.org/jira/browse/MDEPLOY-48
diff --git a/src/it/deploy-default-packaging/pom.xml b/src/it/deploy-default-packaging/pom.xml
index 6394e352..9764c8b8 100644
--- a/src/it/deploy-default-packaging/pom.xml
+++ b/src/it/deploy-default-packaging/pom.xml
@@ -29,7 +29,7 @@ under the License.
deploy-attached-sourcessample jar project with attached sources
- http://jira.codehaus.org/browse/MDEPLOY-106
+ https://issues.apache.org/jira/browse/MDEPLOY-106
From e619ea32fc26b4650a55ececec567221f855e63d Mon Sep 17 00:00:00 2001
From: Christian Schulte
Date: Sun, 18 Dec 2016 00:49:25 +0000
Subject: [PATCH 042/153] o Updated to latest parent SNAPSHOT.
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1774838 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 31a8e935..3ce74f6e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.maven.pluginsmaven-plugins
- 30
+ 31-SNAPSHOT../../pom/maven/maven-plugins/pom.xml
From 05614775669a78e8d8d7e0455a871c57b237654d Mon Sep 17 00:00:00 2001
From: Christian Schulte
Date: Sun, 18 Dec 2016 03:37:05 +0000
Subject: [PATCH 043/153] o Reverted last commit to reset to release version
parent's.
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1774844 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 3ce74f6e..31a8e935 100644
--- a/pom.xml
+++ b/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.maven.pluginsmaven-plugins
- 31-SNAPSHOT
+ 30../../pom/maven/maven-plugins/pom.xml
From cdf7d0afaa038323d33fa2a029d06de72cf51320 Mon Sep 17 00:00:00 2001
From: Christian Schulte
Date: Sat, 24 Dec 2016 13:58:28 +0000
Subject: [PATCH 044/153] [MNG-5457] Show repository id when downloading or
uploading from/to a remote repository
o Updated to account for recent log messages in 3.4+.
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1775953 13f79535-47bb-0310-9956-ffa450edef68
---
.../verify.groovy | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/it/MDEPLOY-202_deployfile-with-multiple-executions/verify.groovy b/src/it/MDEPLOY-202_deployfile-with-multiple-executions/verify.groovy
index 119b9387..a01675be 100644
--- a/src/it/MDEPLOY-202_deployfile-with-multiple-executions/verify.groovy
+++ b/src/it/MDEPLOY-202_deployfile-with-multiple-executions/verify.groovy
@@ -19,4 +19,4 @@
def buildLog = new File ( basedir, "build.log")
-assert 1 == buildLog.text.count( 'Uploading: file:target/repo/org/apache/maven/plugins/deploy/it/org.eclipse.osgi/1.0/org.eclipse.osgi-1.0-sources.jar')
\ No newline at end of file
+assert buildLog.text.matches( /Uploading .* file:target\/repo\/org\/apache\/maven\/plugins\/deploy\/it\/org\.eclipse\.osgi\/1\.0\/org\.eclipse\.osgi-1\.0-sources\.jar/)
\ No newline at end of file
From c820df8434b341a432757dddcc768199375482d3 Mon Sep 17 00:00:00 2001
From: Christian Schulte
Date: Sat, 24 Dec 2016 15:28:58 +0000
Subject: [PATCH 045/153] [MNG-5457] Show repository id when downloading or
uploading from/to a remote repository
o Updated to account for recent log messages in 3.4+.
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1775976 13f79535-47bb-0310-9956-ffa450edef68
---
.../verify.groovy | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/it/MDEPLOY-202_deployfile-with-multiple-executions/verify.groovy b/src/it/MDEPLOY-202_deployfile-with-multiple-executions/verify.groovy
index a01675be..4232c455 100644
--- a/src/it/MDEPLOY-202_deployfile-with-multiple-executions/verify.groovy
+++ b/src/it/MDEPLOY-202_deployfile-with-multiple-executions/verify.groovy
@@ -19,4 +19,4 @@
def buildLog = new File ( basedir, "build.log")
-assert buildLog.text.matches( /Uploading .* file:target\/repo\/org\/apache\/maven\/plugins\/deploy\/it\/org\.eclipse\.osgi\/1\.0\/org\.eclipse\.osgi-1\.0-sources\.jar/)
\ No newline at end of file
+assert buildLog.text =~ /Uploading.*file:target\/repo\/org\/apache\/maven\/plugins\/deploy\/it\/org\.eclipse\.osgi\/1\.0\/org\.eclipse\.osgi-1\.0-sources\.jar/
From b0286fefaf5da3b8e449a19113e5f67de80bbbf8 Mon Sep 17 00:00:00 2001
From: Karl Heinz Marbaise
Date: Sun, 16 Apr 2017 11:20:59 +0000
Subject: [PATCH 046/153] [MDEPLOY-207] Remove @Deprecated marked code o
Removed the repositoryLayout parameter of deploy-file goal and the
configuration part layout in altDeploymentRepository cause we are in Maven
3 and not Maven 2 and before anymore.
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1791602 13f79535-47bb-0310-9956-ffa450edef68
---
.../plugins/deploy/AbstractDeployMojo.java | 30 ++---------
.../maven/plugins/deploy/DeployFileMojo.java | 12 +----
.../maven/plugins/deploy/DeployMojo.java | 14 ++----
.../plugins/deploy/DeployFileMojoTest.java | 50 +++++++++----------
.../maven/plugins/deploy/DeployMojoTest.java | 18 ++-----
5 files changed, 38 insertions(+), 86 deletions(-)
diff --git a/src/main/java/org/apache/maven/plugins/deploy/AbstractDeployMojo.java b/src/main/java/org/apache/maven/plugins/deploy/AbstractDeployMojo.java
index 504806e7..77e811f8 100644
--- a/src/main/java/org/apache/maven/plugins/deploy/AbstractDeployMojo.java
+++ b/src/main/java/org/apache/maven/plugins/deploy/AbstractDeployMojo.java
@@ -19,17 +19,13 @@
* under the License.
*/
-import java.util.Map;
-
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.repository.ArtifactRepositoryPolicy;
import org.apache.maven.artifact.repository.MavenArtifactRepository;
-import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
+import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout;
import org.apache.maven.execution.MavenSession;
import org.apache.maven.plugin.AbstractMojo;
-import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
-import org.apache.maven.plugins.annotations.Component;
import org.apache.maven.plugins.annotations.Parameter;
/**
@@ -39,12 +35,6 @@ public abstract class AbstractDeployMojo
extends AbstractMojo
{
- /**
- * Map that contains the layouts.
- */
- @Component( role = ArtifactRepositoryLayout.class )
- private Map repositoryLayouts;
-
/**
* Flag whether Maven is currently in online/offline mode.
*/
@@ -80,19 +70,6 @@ void failIfOffline()
}
}
- ArtifactRepositoryLayout getLayout( String id )
- throws MojoExecutionException
- {
- ArtifactRepositoryLayout layout = repositoryLayouts.get( id );
-
- if ( layout == null )
- {
- throw new MojoExecutionException( "Invalid repository layout: " + id );
- }
-
- return layout;
- }
-
boolean isUpdateReleaseInfo()
{
return updateReleaseInfo;
@@ -103,10 +80,9 @@ int getRetryFailedDeploymentCount()
return retryFailedDeploymentCount;
}
- protected ArtifactRepository createDeploymentArtifactRepository( String id, String url,
- ArtifactRepositoryLayout layout )
+ protected ArtifactRepository createDeploymentArtifactRepository( String id, String url )
{
- return new MavenArtifactRepository( id, url, layout, new ArtifactRepositoryPolicy(),
+ return new MavenArtifactRepository( id, url, new DefaultRepositoryLayout(), new ArtifactRepositoryPolicy(),
new ArtifactRepositoryPolicy() );
}
diff --git a/src/main/java/org/apache/maven/plugins/deploy/DeployFileMojo.java b/src/main/java/org/apache/maven/plugins/deploy/DeployFileMojo.java
index 1c493d35..140e589b 100644
--- a/src/main/java/org/apache/maven/plugins/deploy/DeployFileMojo.java
+++ b/src/main/java/org/apache/maven/plugins/deploy/DeployFileMojo.java
@@ -36,7 +36,6 @@
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.repository.ArtifactRepository;
-import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
import org.apache.maven.model.Model;
import org.apache.maven.model.Parent;
import org.apache.maven.model.building.ModelBuildingException;
@@ -154,13 +153,6 @@ public class DeployFileMojo
@Parameter( property = "repositoryId", defaultValue = "remote-repository", required = true )
private String repositoryId;
- /**
- * The type of remote repository layout to deploy to. Try legacy for a Maven 1.x-style repository layout.
- */
- @Deprecated
- @Parameter( property = "repositoryLayout", defaultValue = "default" )
- private String repositoryLayout;
-
/**
* URL where the artifact will be deployed.
* ie ( file:///C:/m2-repo or scp://host.com/path/to/repo )
@@ -341,9 +333,7 @@ public void execute()
initProperties();
- ArtifactRepositoryLayout layout = getLayout( repositoryLayout );
-
- ArtifactRepository deploymentRepository = createDeploymentArtifactRepository( repositoryId, url, layout );
+ ArtifactRepository deploymentRepository = createDeploymentArtifactRepository( repositoryId, url );
String protocol = deploymentRepository.getProtocol();
diff --git a/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java b/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java
index b626d319..11dca7c4 100644
--- a/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java
+++ b/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java
@@ -30,7 +30,6 @@
import org.apache.maven.artifact.ArtifactUtils;
import org.apache.maven.artifact.repository.ArtifactRepository;
-import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.Component;
@@ -55,7 +54,7 @@ public class DeployMojo
extends AbstractDeployMojo
{
- private static final Pattern ALT_REPO_SYNTAX_PATTERN = Pattern.compile( "(.+)::(.+)::(.+)" );
+ private static final Pattern ALT_REPO_SYNTAX_PATTERN = Pattern.compile( "(.+)::(.+)" );
/**
* When building with multiple threads, reaching the last project doesn't have to mean that all projects are ready
@@ -91,12 +90,10 @@ public class DeployMojo
*
*
id
*
The id can be used to pick up the correct credentials from the settings.xml
- *
layout
- *
Either default for the Maven2 layout or legacy for the Maven1 layout. Maven3 also
- * uses the default layout.
*
url
*
The location of the repository
*
+ * Note: Since 3.0.0 the layout part has been removed.
*/
@Parameter( property = "altDeploymentRepository" )
private String altDeploymentRepository;
@@ -247,12 +244,9 @@ else if ( !ArtifactUtils.isSnapshot( project.getVersion() ) && altReleaseDeploym
else
{
String id = matcher.group( 1 ).trim();
- String layout = matcher.group( 2 ).trim();
- String url = matcher.group( 3 ).trim();
+ String url = matcher.group( 2 ).trim();
- ArtifactRepositoryLayout repoLayout = getLayout( layout );
-
- repo = createDeploymentArtifactRepository( id, url, repoLayout );
+ repo = createDeploymentArtifactRepository( id, url );
}
}
diff --git a/src/test/java/org/apache/maven/plugins/deploy/DeployFileMojoTest.java b/src/test/java/org/apache/maven/plugins/deploy/DeployFileMojoTest.java
index fff8676a..2ebd83c4 100644
--- a/src/test/java/org/apache/maven/plugins/deploy/DeployFileMojoTest.java
+++ b/src/test/java/org/apache/maven/plugins/deploy/DeployFileMojoTest.java
@@ -267,31 +267,31 @@ public void testDeployIfArtifactIsNotJar()
assertTrue( file.exists() );
}
- public void testDeployIfRepositoryLayoutIsLegacy()
- throws Exception
- {
- File testPom = new File( getBasedir(), "target/test-classes/unit/deploy-file-legacy-repository-layout/plugin-config.xml" );
-
- AbstractDeployMojo mojo = (AbstractDeployMojo) lookupMojo( "deploy-file", testPom );
-
- assertNotNull( mojo );
-
- String repositoryLayout = (String) getVariableValueFromObject( mojo, "repositoryLayout" );
-
- assertEquals( "legacy", repositoryLayout );
-
- try
- {
- mojo.execute();
- fail( "legacy is not supported anymore" );
- }
- catch ( MojoExecutionException e )
- {
- assertEquals( "Invalid repository layout: legacy", e.getMessage() );
- }
-
- }
-
+// public void testDeployIfRepositoryLayoutIsLegacy()
+// throws Exception
+// {
+// File testPom = new File( getBasedir(), "target/test-classes/unit/deploy-file-legacy-repository-layout/plugin-config.xml" );
+//
+// AbstractDeployMojo mojo = (AbstractDeployMojo) lookupMojo( "deploy-file", testPom );
+//
+// assertNotNull( mojo );
+//
+// String repositoryLayout = (String) getVariableValueFromObject( mojo, "repositoryLayout" );
+//
+// assertEquals( "legacy", repositoryLayout );
+//
+// try
+// {
+// mojo.execute();
+// fail( "legacy is not supported anymore" );
+// }
+// catch ( MojoExecutionException e )
+// {
+// assertEquals( "Invalid repository layout: legacy", e.getMessage() );
+// }
+//
+// }
+//
private void addFileToList( File file, List fileList )
{
if ( !file.isDirectory() )
diff --git a/src/test/java/org/apache/maven/plugins/deploy/DeployMojoTest.java b/src/test/java/org/apache/maven/plugins/deploy/DeployMojoTest.java
index e88bfb59..4db5b2de 100644
--- a/src/test/java/org/apache/maven/plugins/deploy/DeployMojoTest.java
+++ b/src/test/java/org/apache/maven/plugins/deploy/DeployMojoTest.java
@@ -30,7 +30,6 @@
import java.util.Properties;
import org.apache.maven.artifact.repository.ArtifactRepository;
-import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
import org.apache.maven.execution.MavenSession;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.testing.AbstractMojoTestCase;
@@ -596,19 +595,16 @@ public void testAltSnapshotDeploymentRepository()
{
DeployMojo mojo = spy( new DeployMojo() );
- ArtifactRepositoryLayout repositoryLayout = mock( ArtifactRepositoryLayout.class );
- setVariableValueToObject( mojo, "repositoryLayouts", Collections.singletonMap( "default", repositoryLayout ) );
-
ArtifactRepository repository = mock( ArtifactRepository.class );
- when( mojo.createDeploymentArtifactRepository( "altSnapshotDeploymentRepository", "http://localhost",
- repositoryLayout ) ).thenReturn( repository );
+ when( mojo.createDeploymentArtifactRepository( "altSnapshotDeploymentRepository", "http://localhost"
+ ) ).thenReturn( repository );
project.setVersion( "1.0-SNAPSHOT" );
ProjectDeployerRequest pdr =
new ProjectDeployerRequest()
.setProject( project )
- .setAltDeploymentRepository( "altSnapshotDeploymentRepository::default::http://localhost" );
+ .setAltDeploymentRepository( "altSnapshotDeploymentRepository::http://localhost" );
assertEquals( repository,
mojo.getDeploymentRepository( pdr ));
}
@@ -618,19 +614,15 @@ public void testAltReleaseDeploymentRepository()
{
DeployMojo mojo = spy( new DeployMojo() );
- ArtifactRepositoryLayout repositoryLayout = mock( ArtifactRepositoryLayout.class );
- setVariableValueToObject( mojo, "repositoryLayouts", Collections.singletonMap( "default", repositoryLayout ) );
-
ArtifactRepository repository = mock( ArtifactRepository.class );
- when( mojo.createDeploymentArtifactRepository( "altReleaseDeploymentRepository", "http://localhost",
- repositoryLayout ) ).thenReturn( repository );
+ when( mojo.createDeploymentArtifactRepository( "altReleaseDeploymentRepository", "http://localhost" ) ).thenReturn( repository );
project.setVersion( "1.0" );
ProjectDeployerRequest pdr =
new ProjectDeployerRequest()
.setProject( project )
- .setAltReleaseDeploymentRepository( "altReleaseDeploymentRepository::default::http://localhost" );
+ .setAltReleaseDeploymentRepository( "altReleaseDeploymentRepository::http://localhost" );
assertEquals( repository,
mojo.getDeploymentRepository( pdr ));
From 4ab9964c3cbd3d7d8cf801611124ea4a5a084498 Mon Sep 17 00:00:00 2001
From: Karl Heinz Marbaise
Date: Sun, 16 Apr 2017 13:17:52 +0000
Subject: [PATCH 047/153] [MDEPLOY-207] Remove @Deprecated marked code o
followup fixed the UT which are referencing plugin-config.xml files.
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1791607 13f79535-47bb-0310-9956-ffa450edef68
---
.../plugins/deploy/DeployFileMojoTest.java | 26 ------------
.../plugin-config.xml | 1 -
.../deploy-file-classifier/plugin-config.xml | 1 -
.../plugin-config.xml | 39 ------------------
.../target/deploy-test-file-1.0-SNAPSHOT.jar | 1 -
.../deploy-file-pom-file/plugin-config.xml | Bin 3278 -> 3166 bytes
.../unit/deploy-file-test/plugin-config.xml | 1 -
7 files changed, 69 deletions(-)
delete mode 100644 src/test/resources/unit/deploy-file-legacy-repository-layout/plugin-config.xml
delete mode 100644 src/test/resources/unit/deploy-file-legacy-repository-layout/target/deploy-test-file-1.0-SNAPSHOT.jar
diff --git a/src/test/java/org/apache/maven/plugins/deploy/DeployFileMojoTest.java b/src/test/java/org/apache/maven/plugins/deploy/DeployFileMojoTest.java
index 2ebd83c4..6c7064bb 100644
--- a/src/test/java/org/apache/maven/plugins/deploy/DeployFileMojoTest.java
+++ b/src/test/java/org/apache/maven/plugins/deploy/DeployFileMojoTest.java
@@ -28,7 +28,6 @@
import org.apache.maven.execution.MavenSession;
import org.apache.maven.model.Model;
-import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.testing.AbstractMojoTestCase;
import org.apache.maven.project.ProjectBuildingRequest;
import org.apache.maven.repository.internal.MavenRepositorySystemSession;
@@ -267,31 +266,6 @@ public void testDeployIfArtifactIsNotJar()
assertTrue( file.exists() );
}
-// public void testDeployIfRepositoryLayoutIsLegacy()
-// throws Exception
-// {
-// File testPom = new File( getBasedir(), "target/test-classes/unit/deploy-file-legacy-repository-layout/plugin-config.xml" );
-//
-// AbstractDeployMojo mojo = (AbstractDeployMojo) lookupMojo( "deploy-file", testPom );
-//
-// assertNotNull( mojo );
-//
-// String repositoryLayout = (String) getVariableValueFromObject( mojo, "repositoryLayout" );
-//
-// assertEquals( "legacy", repositoryLayout );
-//
-// try
-// {
-// mojo.execute();
-// fail( "legacy is not supported anymore" );
-// }
-// catch ( MojoExecutionException e )
-// {
-// assertEquals( "Invalid repository layout: legacy", e.getMessage() );
-// }
-//
-// }
-//
private void addFileToList( File file, List fileList )
{
if ( !file.isDirectory() )
diff --git a/src/test/resources/unit/deploy-file-artifact-not-jar/plugin-config.xml b/src/test/resources/unit/deploy-file-artifact-not-jar/plugin-config.xml
index 4c7fc951..7db42a33 100644
--- a/src/test/resources/unit/deploy-file-artifact-not-jar/plugin-config.xml
+++ b/src/test/resources/unit/deploy-file-artifact-not-jar/plugin-config.xml
@@ -29,7 +29,6 @@ under the License.
${basedir}/src/test/resources/unit/deploy-file-artifact-not-jar/target/deploy-test-file.zipdeploy-testfile://${basedir}/target/remote-repo/deploy-file-artifact-not-jar
- defaulttrue
diff --git a/src/test/resources/unit/deploy-file-classifier/plugin-config.xml b/src/test/resources/unit/deploy-file-classifier/plugin-config.xml
index 59e09452..b77961b4 100644
--- a/src/test/resources/unit/deploy-file-classifier/plugin-config.xml
+++ b/src/test/resources/unit/deploy-file-classifier/plugin-config.xml
@@ -31,7 +31,6 @@ under the License.
deploy-testfile://${basedir}/target/remote-repo/deploy-file-classifierbin
- defaulttrue
diff --git a/src/test/resources/unit/deploy-file-legacy-repository-layout/plugin-config.xml b/src/test/resources/unit/deploy-file-legacy-repository-layout/plugin-config.xml
deleted file mode 100644
index 97531f1b..00000000
--- a/src/test/resources/unit/deploy-file-legacy-repository-layout/plugin-config.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
-
-
-
- maven-deploy-plugin
-
- org.apache.maven.test
- maven-deploy-file-test
- 1.0
- jar
- ${basedir}/src/test/resources/unit/deploy-file-legacy-repository-layout/target/deploy-test-file-1.0-SNAPSHOT.jar
- deploy-test
- file://${basedir}/target/remote-repo/deploy-file-legacy-repository-layout
- legacy
- true
-
-
-
-
-
diff --git a/src/test/resources/unit/deploy-file-legacy-repository-layout/target/deploy-test-file-1.0-SNAPSHOT.jar b/src/test/resources/unit/deploy-file-legacy-repository-layout/target/deploy-test-file-1.0-SNAPSHOT.jar
deleted file mode 100644
index 6f5f2f81..00000000
--- a/src/test/resources/unit/deploy-file-legacy-repository-layout/target/deploy-test-file-1.0-SNAPSHOT.jar
+++ /dev/null
@@ -1 +0,0 @@
-This is not an actual jar
\ No newline at end of file
diff --git a/src/test/resources/unit/deploy-file-pom-file/plugin-config.xml b/src/test/resources/unit/deploy-file-pom-file/plugin-config.xml
index 97f60b0a64958e1e0b07850c1b94e8f4924bc773..3a4e2ce0e4fa409b2e183257514a22791aadf144 100644
GIT binary patch
delta 11
ScmX>nc~4@)3GT@jJktOl#stm)
delta 79
zcmca7aZYl>3GT@sIHl};7!nyO8S)uQ8A=%J7*ZHg8Pb3vr3^Vhz72yuLlID<04QI~
TkO>sY2l6W!kn~L6$h{T-RK*l5
diff --git a/src/test/resources/unit/deploy-file-test/plugin-config.xml b/src/test/resources/unit/deploy-file-test/plugin-config.xml
index 78c4c1ed..67b98a17 100644
--- a/src/test/resources/unit/deploy-file-test/plugin-config.xml
+++ b/src/test/resources/unit/deploy-file-test/plugin-config.xml
@@ -31,7 +31,6 @@ under the License.
deploy-testfile://${basedir}/target/remote-repo/deploy-file-testPOM was created from deploy:deploy-file
- defaulttrue
From c62ba1e44f258f18b204850a75cf5a8063b27afd Mon Sep 17 00:00:00 2001
From: Karl Heinz Marbaise
Date: Sun, 16 Apr 2017 16:44:59 +0000
Subject: [PATCH 048/153] [MDEPLOY-207] Remove @Deprecated marked code o
followup fixed the exception message.
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1791612 13f79535-47bb-0310-9956-ffa450edef68
---
src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java b/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java
index 11dca7c4..f2bd5b52 100644
--- a/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java
+++ b/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java
@@ -239,7 +239,7 @@ else if ( !ArtifactUtils.isSnapshot( project.getVersion() ) && altReleaseDeploym
if ( !matcher.matches() )
{
throw new MojoFailureException( altDeploymentRepo, "Invalid syntax for repository.",
- "Invalid syntax for alternative repository. Use \"id::layout::url\"." );
+ "Invalid syntax for alternative repository. Use \"id::url\"." );
}
else
{
From 914779f0543fdc7c3f2c5976a44a9276e3404e2f Mon Sep 17 00:00:00 2001
From: Karl Heinz Marbaise
Date: Sun, 23 Apr 2017 20:24:02 +0000
Subject: [PATCH 049/153] [MDEPLOY-207] Remove @Deprecated marked code o Fixed
integration tests which used layout definition for
altDeploymentRepository.
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1792390 13f79535-47bb-0310-9956-ffa450edef68
---
src/it/alt-deploy-repo-with-dist-mgmt-snapshot/test.properties | 2 +-
src/it/alt-deploy-repo-with-dist-mgmt/test.properties | 2 +-
src/it/alt-deploy-repo-without-dist-mgmt/test.properties | 2 +-
src/it/mdeploy-45-test/pom.xml | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/it/alt-deploy-repo-with-dist-mgmt-snapshot/test.properties b/src/it/alt-deploy-repo-with-dist-mgmt-snapshot/test.properties
index e9992d60..a0875d1d 100644
--- a/src/it/alt-deploy-repo-with-dist-mgmt-snapshot/test.properties
+++ b/src/it/alt-deploy-repo-with-dist-mgmt-snapshot/test.properties
@@ -15,4 +15,4 @@
# specific language governing permissions and limitations
# under the License.
-altDeploymentRepository = alt-id::default::file:target/repo
+altDeploymentRepository = alt-id::file:target/repo
diff --git a/src/it/alt-deploy-repo-with-dist-mgmt/test.properties b/src/it/alt-deploy-repo-with-dist-mgmt/test.properties
index e9992d60..a0875d1d 100644
--- a/src/it/alt-deploy-repo-with-dist-mgmt/test.properties
+++ b/src/it/alt-deploy-repo-with-dist-mgmt/test.properties
@@ -15,4 +15,4 @@
# specific language governing permissions and limitations
# under the License.
-altDeploymentRepository = alt-id::default::file:target/repo
+altDeploymentRepository = alt-id::file:target/repo
diff --git a/src/it/alt-deploy-repo-without-dist-mgmt/test.properties b/src/it/alt-deploy-repo-without-dist-mgmt/test.properties
index e9992d60..a0875d1d 100644
--- a/src/it/alt-deploy-repo-without-dist-mgmt/test.properties
+++ b/src/it/alt-deploy-repo-without-dist-mgmt/test.properties
@@ -15,4 +15,4 @@
# specific language governing permissions and limitations
# under the License.
-altDeploymentRepository = alt-id::default::file:target/repo
+altDeploymentRepository = alt-id::file:target/repo
diff --git a/src/it/mdeploy-45-test/pom.xml b/src/it/mdeploy-45-test/pom.xml
index c30df9e6..2447705a 100644
--- a/src/it/mdeploy-45-test/pom.xml
+++ b/src/it/mdeploy-45-test/pom.xml
@@ -85,7 +85,7 @@ under the License.
@project.version@
- mine::default::file://${basedir}/target
+ mine::file://${basedir}/target
From 1c2d34c01d5b2dd9e3eca753c792fa8e5460cb7b Mon Sep 17 00:00:00 2001
From: Karl Heinz Marbaise
Date: Tue, 16 May 2017 19:07:36 +0000
Subject: [PATCH 050/153] [MDEPLOY-219] Upgrade maven-artifact-transfer to
version 0.9.1
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1795356 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 2 +-
.../java/org/apache/maven/plugins/deploy/DeployMojo.java | 6 ------
2 files changed, 1 insertion(+), 7 deletions(-)
diff --git a/pom.xml b/pom.xml
index 31a8e935..fa6aba4a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -86,7 +86,7 @@ under the License.
org.apache.maven.sharedmaven-artifact-transfer
- 3.0.0-SNAPSHOT
+ 0.9.1
diff --git a/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java b/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java
index f2bd5b52..812b22d9 100644
--- a/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java
+++ b/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java
@@ -19,8 +19,6 @@
* under the License.
*/
-import java.io.IOException;
-
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@@ -194,10 +192,6 @@ private void deployProject( ProjectBuildingRequest pbr, ProjectDeployerRequest p
{
projectDeployer.deploy( pbr, pir, repo );
}
- catch ( IOException e )
- {
- throw new MojoFailureException( "IOException", e );
- }
catch ( NoFileAssignedException e )
{
throw new MojoExecutionException( "NoFileAssignedException", e );
From 57c8adca00b675afc8673405812a23b917d9dc3c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Herv=C3=A9=20Boutemy?=
Date: Sat, 9 Dec 2017 19:31:11 +0100
Subject: [PATCH 051/153] moved to git
---
.gitignore | 15 +++++++++++++++
Jenkinsfile | 20 ++++++++++++++++++++
pom.xml | 11 ++++++++---
3 files changed, 43 insertions(+), 3 deletions(-)
create mode 100644 .gitignore
create mode 100644 Jenkinsfile
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000..f79c9285
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,15 @@
+target/
+.project
+.classpath
+.settings/
+.svn/
+bin/
+# Intellij
+*.ipr
+*.iml
+.idea
+out/
+.DS_Store
+/bootstrap
+/dependencies.xml
+.java-version
diff --git a/Jenkinsfile b/Jenkinsfile
new file mode 100644
index 00000000..09ac70f1
--- /dev/null
+++ b/Jenkinsfile
@@ -0,0 +1,20 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+asfMavenTlpStdBuild()
diff --git a/pom.xml b/pom.xml
index fa6aba4a..7628e8b1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -42,14 +42,19 @@ under the License.
- scm:svn:http://svn.apache.org/repos/asf/maven/plugins/trunk/maven-deploy-plugin/
- scm:svn:https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-deploy-plugin/
- http://svn.apache.org/viewvc/maven/plugins/trunk/maven-deploy-plugin/
+ scm:git:https://gitbox.apache.org/repos/asf/maven-deploy-plugin.git
+ scm:git:https://gitbox.apache.org/repos/asf/maven-deploy-plugin.git
+ https://github.com/apache/maven-deploy-plugin/tree/${project.scm.tag}
+ HEADJIRAhttps://issues.apache.org/jira/browse/MDEPLOY
+
+ Jenkins
+ https://builds.apache.org/job/maven-box/job/maven-deploy-plugin/
+ apache.website
From e2843fc249c74a022f00c8010e6d104f6deef976 Mon Sep 17 00:00:00 2001
From: Karl Heinz Marbaise
Date: Sat, 13 Jan 2018 21:04:05 +0100
Subject: [PATCH 052/153] [MDEPLOY-228] Upgrade plexus-utils 3.1.0
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 7628e8b1..87b44239 100644
--- a/pom.xml
+++ b/pom.xml
@@ -109,7 +109,7 @@ under the License.
org.codehaus.plexusplexus-utils
- 3.0.24
+ 3.1.0org.apache.maven.plugin-testing
From 8ca9666c9ddd6b9db4fdd9c94f1ae52f25f173c6 Mon Sep 17 00:00:00 2001
From: Karl Heinz Marbaise
Date: Sat, 10 Feb 2018 16:46:12 +0100
Subject: [PATCH 053/153] [MDEPLOY-230] - Update parent to 31.
---
pom.xml | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/pom.xml b/pom.xml
index 87b44239..83649978 100644
--- a/pom.xml
+++ b/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.maven.pluginsmaven-plugins
- 30
+ 31../../pom/maven/maven-plugins/pom.xml
@@ -200,7 +200,6 @@ under the License.
org.apache.maven.pluginsmaven-changes-plugin
- 2.3Type,Key,Summary,Assignee,Status,Resolution,Fix Version
From e880d2f25aaa3e0575232188cecc06b194482652 Mon Sep 17 00:00:00 2001
From: Karl Heinz Marbaise
Date: Wed, 7 Mar 2018 21:44:44 +0100
Subject: [PATCH 054/153] [MDEPLOY-232] - Using maven-fluido-skin 1.7
---
src/site/site.xml | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/src/site/site.xml b/src/site/site.xml
index 195d0356..50bd8869 100644
--- a/src/site/site.xml
+++ b/src/site/site.xml
@@ -22,6 +22,30 @@ under the License.
+
+ http://maven.apache.org/images/apache-maven-project.png
+ http://www.apache.org/
+
+
+
+ http://maven.apache.org/images/maven-logo-black-on-white.png
+ http://maven.apache.org/
+
+
+ org.apache.maven.skins
+ maven-fluido-skin
+ 1.7
+
+
+
+
+ true
+
+
+ maven.apache.org/plugins/maven-deploy-plugin/
+
+
+
- true
diff --git a/src/test/resources/unit/basic-deploy-scp/plugin-config.xml b/src/test/resources/unit/basic-deploy-scp/plugin-config.xml
index ffb387ad..4b3a9bfe 100644
--- a/src/test/resources/unit/basic-deploy-scp/plugin-config.xml
+++ b/src/test/resources/unit/basic-deploy-scp/plugin-config.xml
@@ -30,7 +30,6 @@ under the License.
- false
diff --git a/src/test/resources/unit/basic-deploy-test/plugin-config.xml b/src/test/resources/unit/basic-deploy-test/plugin-config.xml
index ae6eeaf21c833221d84a50b5eca9872782c72d74..a98749b1574d542007b8f1409d64cf80e8fed0d9 100644
GIT binary patch
delta 11
ScmZ1`wM}w^0?*_LJktOf)dVpB
delta 103
zcmdlcxlC$<0?*_L>}wdM
THVpa<1a(a2${basedir}
- true
From 83b2d51cb3427a54ea465ff836c68da18accd426 Mon Sep 17 00:00:00 2001
From: Karl Heinz Marbaise
Date: Thu, 9 Aug 2018 17:24:14 +0200
Subject: [PATCH 065/153] [MDEPLOY-231] - Move checksum generation from install
to deploy plugin
---
pom.xml | 7 +-
src/it/attach-jar-checksum-release/pom.xml | 103 ++++++++++++++++++
src/it/attach-jar-checksum-release/setup.bsh | 29 +++++
.../attach-jar-checksum-release/verify.groovy | 64 +++++++++++
src/it/attach-jar-checksum-snapshot/pom.xml | 102 +++++++++++++++++
src/it/attach-jar-checksum-snapshot/setup.bsh | 29 +++++
.../verify.groovy | 95 ++++++++++++++++
.../maven/plugins/deploy/DeployFileMojo.java | 8 +-
.../maven/plugins/deploy/DeployMojo.java | 11 +-
.../maven/plugins/deploy/DeployMojoTest.java | 2 +-
.../apache/maven/plugins/deploy/Utils.java | 64 +++++++++++
.../deploy/stubs/ArtifactDeployerStub.java | 4 +-
12 files changed, 507 insertions(+), 11 deletions(-)
create mode 100644 src/it/attach-jar-checksum-release/pom.xml
create mode 100644 src/it/attach-jar-checksum-release/setup.bsh
create mode 100644 src/it/attach-jar-checksum-release/verify.groovy
create mode 100644 src/it/attach-jar-checksum-snapshot/pom.xml
create mode 100644 src/it/attach-jar-checksum-snapshot/setup.bsh
create mode 100644 src/it/attach-jar-checksum-snapshot/verify.groovy
create mode 100644 src/test/java/org/apache/maven/plugins/deploy/Utils.java
diff --git a/pom.xml b/pom.xml
index a0e07880..36cafaf2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -91,7 +91,7 @@ under the License.
org.apache.maven.sharedmaven-artifact-transfer
- 0.9.1
+ 0.10.0
@@ -185,9 +185,14 @@ under the License.
verify${project.build.directory}/local-reposrc/it/settings.xml
+ truedeploy
+
+
+ ${https.protocols}
+
diff --git a/src/it/attach-jar-checksum-release/pom.xml b/src/it/attach-jar-checksum-release/pom.xml
new file mode 100644
index 00000000..bda659d4
--- /dev/null
+++ b/src/it/attach-jar-checksum-release/pom.xml
@@ -0,0 +1,103 @@
+
+
+
+
+
+ 4.0.0
+
+ org.apache.maven.its.deploy.ajc
+ test
+ 1.0
+ jar
+
+
+ This test has been moved from maven-install-plugin to maven-deploy-plugin.
+ Tests the installation of a simple snapshot JAR with an attached artifact and checksums
+
+
+
+ true
+
+
+
+ it
+ file:///${basedir}/target/remoterepo
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ 2.0.2
+
+
+ org.apache.maven.plugins
+ maven-deploy-plugin
+ @project.version@
+
+
+
+ org.apache.maven.plugins
+ maven-install-plugin
+ 2.5.2
+
+ false
+
+
+
+ org.apache.maven.plugins
+ maven-jar-plugin
+ 2.1
+
+
+ org.apache.maven.plugins
+ maven-resources-plugin
+ 2.2
+
+
+ org.apache.maven.plugins
+ maven-source-plugin
+ 2.0.4
+
+
+ attach-sources
+
+ jar
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+ 2.3.1
+
+
+
+
+
diff --git a/src/it/attach-jar-checksum-release/setup.bsh b/src/it/attach-jar-checksum-release/setup.bsh
new file mode 100644
index 00000000..4d739715
--- /dev/null
+++ b/src/it/attach-jar-checksum-release/setup.bsh
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.*;
+import java.util.*;
+
+import org.codehaus.plexus.util.*;
+
+File file = new File( basedir, "org/apache/maven/its/deploy/ajc" );
+System.out.println( "Deleting " + file );
+FileUtils.deleteDirectory( file );
+
+return true;
diff --git a/src/it/attach-jar-checksum-release/verify.groovy b/src/it/attach-jar-checksum-release/verify.groovy
new file mode 100644
index 00000000..ac362f81
--- /dev/null
+++ b/src/it/attach-jar-checksum-release/verify.groovy
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.*;
+import java.util.*;
+
+import org.apache.maven.plugins.deploy.Utils;
+
+def paths =
+[
+ "org/apache/maven/its/deploy/ajc/test/1.0/test-1.0.pom",
+ "org/apache/maven/its/deploy/ajc/test/1.0/test-1.0.pom.md5",
+ "org/apache/maven/its/deploy/ajc/test/1.0/test-1.0.pom.sha1",
+ "org/apache/maven/its/deploy/ajc/test/1.0/test-1.0.jar",
+ "org/apache/maven/its/deploy/ajc/test/1.0/test-1.0.jar.md5",
+ "org/apache/maven/its/deploy/ajc/test/1.0/test-1.0.jar.sha1",
+ "org/apache/maven/its/deploy/ajc/test/1.0/test-1.0-sources.jar",
+ "org/apache/maven/its/deploy/ajc/test/1.0/test-1.0-sources.jar.md5",
+ "org/apache/maven/its/deploy/ajc/test/1.0/test-1.0-sources.jar.sha1",
+ "org/apache/maven/its/deploy/ajc/test/maven-metadata.xml",
+ "org/apache/maven/its/deploy/ajc/test/maven-metadata.xml.md5",
+ "org/apache/maven/its/deploy/ajc/test/maven-metadata.xml.sha1",
+]
+
+def cksumToCheckPaths = [
+ "org/apache/maven/its/deploy/ajc/test/1.0/test-1.0.pom",
+ "org/apache/maven/its/deploy/ajc/test/1.0/test-1.0.jar",
+ "org/apache/maven/its/deploy/ajc/test/1.0/test-1.0-sources.jar"
+]
+
+// Check if artifacts have been uploaded to remote with checksums
+def repository = new File (basedir, "target/remoterepo" )
+paths.each { path ->
+ //File file = new File( localRepositoryPath, path );
+ File file = new File( repository, path );
+ println "Checking for existence of ${file}"
+ if ( !file.isFile() )
+ {
+ throw new FileNotFoundException( "Missing: " + file.getAbsolutePath() );
+ }
+ if ( cksumToCheckPaths.contains( path ) )
+ {
+ println "Verifying ${file}"
+ Utils.verifyChecksum( file );
+ }
+}
+
+return true;
diff --git a/src/it/attach-jar-checksum-snapshot/pom.xml b/src/it/attach-jar-checksum-snapshot/pom.xml
new file mode 100644
index 00000000..89ddce78
--- /dev/null
+++ b/src/it/attach-jar-checksum-snapshot/pom.xml
@@ -0,0 +1,102 @@
+
+
+
+
+
+ 4.0.0
+
+ org.apache.maven.its.deploy.ajc
+ test
+ 1.0-SNAPSHOT
+ jar
+
+
+ Tests the deployment of a simple SNAPSHOT JAR with an attached artifact and checksums
+
+
+
+ true
+
+
+
+ it
+ file:///${basedir}/target/remoterepo
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ 2.0.2
+
+
+ org.apache.maven.plugins
+ maven-deploy-plugin
+ @project.version@
+
+
+ org.apache.maven.plugins
+ maven-jar-plugin
+ 2.1
+
+
+
+ org.apache.maven.plugins
+ maven-install-plugin
+ 2.5.2
+
+ false
+
+
+
+ org.apache.maven.plugins
+ maven-resources-plugin
+ 2.2
+
+
+ org.apache.maven.plugins
+ maven-source-plugin
+ 2.0.4
+
+
+ attach-sources
+
+ jar
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+ 2.3.1
+
+
+
+
+
diff --git a/src/it/attach-jar-checksum-snapshot/setup.bsh b/src/it/attach-jar-checksum-snapshot/setup.bsh
new file mode 100644
index 00000000..7d54f90e
--- /dev/null
+++ b/src/it/attach-jar-checksum-snapshot/setup.bsh
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.*;
+import java.util.*;
+
+import org.codehaus.plexus.util.*;
+
+File file = new File( basedir, "target/remoterepo/org/apache/maven/its/deploy/ajc" );
+System.out.println( "Deleting " + file );
+FileUtils.deleteDirectory( file );
+
+return true;
diff --git a/src/it/attach-jar-checksum-snapshot/verify.groovy b/src/it/attach-jar-checksum-snapshot/verify.groovy
new file mode 100644
index 00000000..0a4a14f9
--- /dev/null
+++ b/src/it/attach-jar-checksum-snapshot/verify.groovy
@@ -0,0 +1,95 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.maven.plugins.deploy.Utils;
+
+def pathsInTargetDirectory = [
+ "test\\-1\\.0\\-\\d{8}\\.\\d{6}\\-\\d{1}\\.pom",
+ "test\\-1\\.0\\-\\d{8}\\.\\d{6}\\-\\d{1}\\.pom\\.md5",
+ "test\\-1\\.0\\-\\d{8}\\.\\d{6}\\-\\d{1}\\.pom\\.sha1",
+ "test\\-1\\.0\\-\\d{8}\\.\\d{6}\\-\\d{1}\\.jar",
+ "test\\-1\\.0\\-\\d{8}\\.\\d{6}\\-\\d{1}\\.jar\\.md5",
+ "test\\-1\\.0\\-\\d{8}\\.\\d{6}\\-\\d{1}\\.jar\\.sha1",
+ "test\\-1\\.0\\-\\d{8}\\.\\d{6}\\-\\d{1}\\-sources\\.jar",
+ "test\\-1\\.0\\-\\d{8}\\.\\d{6}\\-\\d{1}\\-sources\\.jar\\.md5",
+ "test\\-1\\.0\\-\\d{8}\\.\\d{6}\\-\\d{1}\\-sources\\.jar\\.sha1",
+ //The following files will be generated. But they can't be check for the checksums
+ //cause they contain timestamps which means they change everytime.
+ "maven\\-metadata\\.xml",
+ "maven\\-metadata\\.xml\\.md5",
+ "maven\\-metadata\\.xml\\.sha1",
+]
+
+def checkSumsToCheckPaths = [
+ "test\\-1\\.0\\-\\d{8}\\.\\d{6}\\-\\d{1}\\.pom",
+ "test\\-1\\.0\\-\\d{8}\\.\\d{6}\\-\\d{1}\\.jar",
+ "test\\-1\\.0\\-\\d{8}\\.\\d{6}\\-\\d{1}\\-sources\\.jar",
+]
+
+// All files are being deployed to that location. See pom.xml
+def repository = new File (basedir, "target/remoterepo/org/apache/maven/its/deploy/ajc/test/1.0-SNAPSHOT" )
+
+// Read all files from the target directory.
+def filesInDirectory = []
+repository.eachFile() { file ->
+ filesInDirectory << file.getName()
+}
+
+println "Size: ${filesInDirectory.size()} / ${pathsInTargetDirectory.size()}"
+
+// First Step is to check the number of files found in directory against
+// the number of files we expect to find.
+if (filesInDirectory.size() != pathsInTargetDirectory.size()) {
+ throw new Exception( "The number of files in filesInDirectory and the number of files in pathsInTargetDirectory are not equal" );
+}
+
+// The following will check for the existence of all given
+// files based on the given regular expressions.
+// This is needed cause the time stamp in the file name
+// changes each time this test will be running.
+filesInDirectory.each { existingFile ->
+ def result = false
+ pathsInTargetDirectory.each { searchItem ->
+ def expected = existingFile ==~ searchItem
+ println "existingFile: ${existingFile} ${searchItem} expeced:${expected}"
+ if (expected) {
+ result = true
+ }
+ }
+
+ if (!result) {
+ throw new FileNotFoundException ( "Missing: ${existingFile}" )
+ }
+}
+
+// The following will check the existing checksums.
+filesInDirectory.each { existingFile ->
+ def result = false
+ checkSumsToCheckPaths.each { searchItem ->
+ //search for the file name pattern..
+ def expected = existingFile ==~ searchItem
+ if (expected) {
+ println "Verifying ${existingFile}"
+ Utils.verifyChecksum( new File(repository, existingFile) );
+ }
+ }
+}
+
+return true;
+
diff --git a/src/main/java/org/apache/maven/plugins/deploy/DeployFileMojo.java b/src/main/java/org/apache/maven/plugins/deploy/DeployFileMojo.java
index 23014bb9..43044218 100644
--- a/src/main/java/org/apache/maven/plugins/deploy/DeployFileMojo.java
+++ b/src/main/java/org/apache/maven/plugins/deploy/DeployFileMojo.java
@@ -54,10 +54,10 @@
import org.apache.maven.project.ProjectBuilder;
import org.apache.maven.project.ProjectBuildingException;
import org.apache.maven.project.artifact.ProjectArtifactMetadata;
-import org.apache.maven.shared.artifact.DefaultArtifactCoordinate;
-import org.apache.maven.shared.artifact.deploy.ArtifactDeployer;
-import org.apache.maven.shared.artifact.deploy.ArtifactDeployerException;
-import org.apache.maven.shared.repository.RepositoryManager;
+import org.apache.maven.shared.transfer.artifact.DefaultArtifactCoordinate;
+import org.apache.maven.shared.transfer.artifact.deploy.ArtifactDeployer;
+import org.apache.maven.shared.transfer.artifact.deploy.ArtifactDeployerException;
+import org.apache.maven.shared.transfer.repository.RepositoryManager;
import org.apache.maven.shared.utils.Os;
import org.codehaus.plexus.util.FileUtils;
import org.codehaus.plexus.util.IOUtil;
diff --git a/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java b/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java
index 72d672f8..94b94055 100644
--- a/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java
+++ b/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java
@@ -36,9 +36,10 @@
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.project.MavenProject;
import org.apache.maven.project.ProjectBuildingRequest;
-import org.apache.maven.shared.project.NoFileAssignedException;
-import org.apache.maven.shared.project.deploy.ProjectDeployer;
-import org.apache.maven.shared.project.deploy.ProjectDeployerRequest;
+import org.apache.maven.shared.transfer.artifact.deploy.ArtifactDeployerException;
+import org.apache.maven.shared.transfer.project.NoFileAssignedException;
+import org.apache.maven.shared.transfer.project.deploy.ProjectDeployer;
+import org.apache.maven.shared.transfer.project.deploy.ProjectDeployerRequest;
/**
* Deploys an artifact to remote repository.
@@ -195,6 +196,10 @@ private void deployProject( ProjectBuildingRequest pbr, ProjectDeployerRequest p
{
throw new MojoExecutionException( "NoFileAssignedException", e );
}
+ catch ( ArtifactDeployerException e )
+ {
+ throw new MojoExecutionException( "ArtifactDeployerException", e );
+ }
}
diff --git a/src/test/java/org/apache/maven/plugins/deploy/DeployMojoTest.java b/src/test/java/org/apache/maven/plugins/deploy/DeployMojoTest.java
index 746be91d..6c6f9387 100644
--- a/src/test/java/org/apache/maven/plugins/deploy/DeployMojoTest.java
+++ b/src/test/java/org/apache/maven/plugins/deploy/DeployMojoTest.java
@@ -40,7 +40,7 @@
import org.apache.maven.project.MavenProject;
import org.apache.maven.project.ProjectBuildingRequest;
import org.apache.maven.repository.internal.MavenRepositorySystemSession;
-import org.apache.maven.shared.project.deploy.ProjectDeployerRequest;
+import org.apache.maven.shared.transfer.project.deploy.ProjectDeployerRequest;
import org.codehaus.plexus.util.FileUtils;
import org.junit.Ignore;
import org.mockito.InjectMocks;
diff --git a/src/test/java/org/apache/maven/plugins/deploy/Utils.java b/src/test/java/org/apache/maven/plugins/deploy/Utils.java
new file mode 100644
index 00000000..09949a65
--- /dev/null
+++ b/src/test/java/org/apache/maven/plugins/deploy/Utils.java
@@ -0,0 +1,64 @@
+package org.apache.maven.plugins.deploy;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.maven.plugin.MojoExecutionException;
+import org.sonatype.aether.util.ChecksumUtils;
+
+/**
+ * A utility class to assist testing.
+ *
+ * @author Benjamin Bentmann
+ * @version $Id$
+ */
+public class Utils
+{
+
+ public static final List CHECKSUM_ALGORITHMS = Arrays.asList( "MD5", "SHA-1" );
+
+ /**
+ * Verifies the checksum files in the local repo for the given file.
+ *
+ * @param file The file to verify its checksum with, must not be null.
+ * @throws MojoExecutionException In case the checksums were incorrect.
+ * @throws IOException If the files couldn't be read.
+ */
+ public static void verifyChecksum( File file )
+ throws MojoExecutionException, IOException
+ {
+ Map checksums = ChecksumUtils.calc( file, CHECKSUM_ALGORITHMS );
+ for ( Map.Entry entry : checksums.entrySet() )
+ {
+ File cksumFile = new File( file + "." + entry.getKey().toLowerCase().replace( "-", "" ) );
+ String actualChecksum = ChecksumUtils.read( cksumFile );
+ if ( !actualChecksum.equals( entry.getValue() ) )
+ {
+ throw new MojoExecutionException( "Incorrect " + entry.getKey() + " checksum for file: " + file );
+ }
+ }
+ }
+
+}
diff --git a/src/test/java/org/apache/maven/plugins/deploy/stubs/ArtifactDeployerStub.java b/src/test/java/org/apache/maven/plugins/deploy/stubs/ArtifactDeployerStub.java
index 9bdf48ae..d0b47d43 100644
--- a/src/test/java/org/apache/maven/plugins/deploy/stubs/ArtifactDeployerStub.java
+++ b/src/test/java/org/apache/maven/plugins/deploy/stubs/ArtifactDeployerStub.java
@@ -24,8 +24,8 @@
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.project.ProjectBuildingRequest;
-import org.apache.maven.shared.artifact.deploy.ArtifactDeployer;
-import org.apache.maven.shared.artifact.deploy.ArtifactDeployerException;
+import org.apache.maven.shared.transfer.artifact.deploy.ArtifactDeployer;
+import org.apache.maven.shared.transfer.artifact.deploy.ArtifactDeployerException;
public class ArtifactDeployerStub
implements ArtifactDeployer
From db21c8fee0c040210aa0aa0275560a962ad3b840 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Herv=C3=A9=20Boutemy?=
Date: Wed, 29 Aug 2018 14:42:27 +0200
Subject: [PATCH 066/153] [MNGSITE-341] use https for sigs, hashes and KEYS
---
src/site/xdoc/download.xml.vm | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/site/xdoc/download.xml.vm b/src/site/xdoc/download.xml.vm
index cf13dc93..7047d2c6 100644
--- a/src/site/xdoc/download.xml.vm
+++ b/src/site/xdoc/download.xml.vm
@@ -34,7 +34,7 @@ under the License.
In order to guard against corrupted downloads/installations, it is highly recommended to
verify the signature
- of the release bundles against the public KEYS used by the Apache Maven
+ of the release bundles against the public KEYS used by the Apache Maven
developers.
From d8baa8dc13a75d814c275e9cfe622ea93017b7b0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Herv=C3=A9=20Boutemy?=
Date: Sun, 16 Sep 2018 20:00:34 +0200
Subject: [PATCH 068/153] upgraded parent POM from 32 to 33
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 36cafaf2..ab457324 100644
--- a/pom.xml
+++ b/pom.xml
@@ -25,7 +25,7 @@ under the License.
org.apache.maven.pluginsmaven-plugins
- 32
+ 33../../pom/maven/maven-plugins/pom.xml
From 54329afd813cfca8c298eda1710468578998224d Mon Sep 17 00:00:00 2001
From: Karl Heinz Marbaise
Date: Sun, 23 Sep 2018 14:34:09 +0200
Subject: [PATCH 069/153] [MDEPLOY-242] - Lift JDK minimum to JDK 7
---
pom.xml | 1 +
1 file changed, 1 insertion(+)
diff --git a/pom.xml b/pom.xml
index ab457324..0afaf1b2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -64,6 +64,7 @@ under the License.
3.0
+ 7
From 5aa24d1848f4d4d6ab4838b00fa2b7b5e5c0f3ef Mon Sep 17 00:00:00 2001
From: Karl Heinz Marbaise
Date: Sun, 23 Sep 2018 19:30:11 +0200
Subject: [PATCH 070/153] [maven-release-plugin] prepare release
maven-deploy-plugin-3.0.0-M1
---
pom.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/pom.xml b/pom.xml
index 0afaf1b2..d582c14e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -30,7 +30,7 @@ under the License.
maven-deploy-plugin
- 3.0.0-SNAPSHOT
+ 3.0.0-M1maven-pluginApache Maven Deploy Plugin
@@ -45,7 +45,7 @@ under the License.
scm:git:https://gitbox.apache.org/repos/asf/maven-deploy-plugin.gitscm:git:https://gitbox.apache.org/repos/asf/maven-deploy-plugin.githttps://github.com/apache/maven-deploy-plugin/tree/${project.scm.tag}
- HEAD
+ maven-deploy-plugin-3.0.0-M1JIRA
From 72c179744b86120716e166ba59e2754b02fc1c4d Mon Sep 17 00:00:00 2001
From: Karl Heinz Marbaise
Date: Sun, 23 Sep 2018 19:30:32 +0200
Subject: [PATCH 071/153] [maven-release-plugin] prepare for next development
iteration
---
pom.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/pom.xml b/pom.xml
index d582c14e..b006e455 100644
--- a/pom.xml
+++ b/pom.xml
@@ -30,7 +30,7 @@ under the License.
maven-deploy-plugin
- 3.0.0-M1
+ 3.0.0-M2-SNAPSHOTmaven-pluginApache Maven Deploy Plugin
@@ -45,7 +45,7 @@ under the License.
scm:git:https://gitbox.apache.org/repos/asf/maven-deploy-plugin.gitscm:git:https://gitbox.apache.org/repos/asf/maven-deploy-plugin.githttps://github.com/apache/maven-deploy-plugin/tree/${project.scm.tag}
- maven-deploy-plugin-3.0.0-M1
+ HEADJIRA
From 3f279e4801ebc9a77585c309444b5b12620d9046 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Herv=C3=A9=20Boutemy?=
Date: Fri, 18 Jan 2019 19:01:20 +0100
Subject: [PATCH 072/153] [MDEPLOY-249] fixed javadoc: format has no layout
part now
---
.../java/org/apache/maven/plugins/deploy/DeployMojo.java | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java b/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java
index 94b94055..986591a8 100644
--- a/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java
+++ b/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java
@@ -85,14 +85,15 @@ public class DeployMojo
/**
* Specifies an alternative repository to which the project artifacts should be deployed ( other than those
* specified in <distributionManagement> ).
- * Format: id::layout::url
+ * Format: id::url
*
*
id
*
The id can be used to pick up the correct credentials from the settings.xml
*
url
*
The location of the repository
*
- * Note: Since 3.0.0 the layout part has been removed.
+ * Note: In version 2, the format was id::layout::url, but since 3.0.0 the layout part has been removed because Maven 3
+ * only supports default (ie. Maven 2) layout and not legacy (Maven 1) layout.
*/
@Parameter( property = "altDeploymentRepository" )
private String altDeploymentRepository;
From a00bd1931f8712a56fb34a917edb7857764b5038 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Herv=C3=A9=20Boutemy?=
Date: Sat, 19 Jan 2019 09:05:16 +0100
Subject: [PATCH 073/153] [MDEPLOY-249] fixed javadoc: format has no layout
part now
---
.../java/org/apache/maven/plugins/deploy/DeployMojo.java | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java b/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java
index 986591a8..75918ac7 100644
--- a/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java
+++ b/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java
@@ -92,8 +92,9 @@ public class DeployMojo
*