diff --git a/.asf.yaml b/.asf.yaml
new file mode 100644
index 00000000..d4bb4049
--- /dev/null
+++ b/.asf.yaml
@@ -0,0 +1,21 @@
+# see https://s.apache.org/asfyaml
+github:
+ description: "Apache Maven Deploy Plugin"
+ homepage: https://maven.apache.org/plugins/maven-deploy-plugin
+ labels:
+ - java
+ - build-management
+ - apache-maven
+ - maven-plugins
+ - maven-deploy-plugin
+ enabled_merge_buttons:
+ squash: true
+ merge: false
+ rebase: true
+ autolink_jira:
+ - MDEPLOY
+notifications:
+ commits: commits@maven.apache.org
+ issues: issues@maven.apache.org
+ pullrequests: issues@maven.apache.org
+ jira_options: link label comment
diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs
new file mode 100644
index 00000000..517a2a39
--- /dev/null
+++ b/.git-blame-ignore-revs
@@ -0,0 +1,21 @@
+#
+# 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.
+#
+
+# Change maven code style - parent 39
+27026fb9d50f2ccf008387d562e9dc7800bfb975
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
new file mode 100644
index 00000000..778ea2af
--- /dev/null
+++ b/.github/dependabot.yml
@@ -0,0 +1,27 @@
+# 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.
+
+version: 2
+updates:
+ - package-ecosystem: "maven"
+ directory: "/"
+ schedule:
+ interval: "daily"
+ - package-ecosystem: "github-actions"
+ directory: "/"
+ schedule:
+ interval: "daily"
diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md
new file mode 100644
index 00000000..7f4ebfaa
--- /dev/null
+++ b/.github/pull_request_template.md
@@ -0,0 +1,29 @@
+Following this checklist to help us incorporate your
+contribution quickly and easily:
+
+ - [ ] Make sure there is a [JIRA issue](https://issues.apache.org/jira/browse/MDEPLOY) filed
+ for the change (usually before you start working on it). Trivial changes like typos do not
+ require a JIRA issue. Your pull request should address just this issue, without
+ pulling in other changes.
+ - [ ] Each commit in the pull request should have a meaningful subject line and body.
+ - [ ] Format the pull request title like `[MDEPLOY-XXX] - Fixes bug in ApproximateQuantiles`,
+ where you replace `MDEPLOY-XXX` with the appropriate JIRA issue. Best practice
+ is to use the JIRA issue title in the pull request title and in the first line of the
+ commit message.
+ - [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
+ - [ ] Run `mvn clean verify` to make sure basic checks pass. A more thorough check will
+ be performed on your pull request automatically.
+ - [ ] You have run the integration tests successfully (`mvn -Prun-its clean verify`).
+
+If your pull request is about ~20 lines of code you don't need to sign an
+[Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf) if you are unsure
+please ask on the developers list.
+
+To make clear that you license your contribution under
+the [Apache License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
+you have to acknowledge this by using the following check-box.
+
+ - [ ] I hereby declare this contribution to be licenced under the [Apache License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
+
+ - [ ] In any other case, please file an [Apache Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
+
diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml
new file mode 100644
index 00000000..387b9ca2
--- /dev/null
+++ b/.github/release-drafter.yml
@@ -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.
+
+_extends: maven-gh-actions-shared
diff --git a/.github/workflows/maven-verify.yml b/.github/workflows/maven-verify.yml
new file mode 100644
index 00000000..cd3c4512
--- /dev/null
+++ b/.github/workflows/maven-verify.yml
@@ -0,0 +1,28 @@
+# 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.
+
+name: Verify
+
+on:
+ push:
+ pull_request:
+
+jobs:
+ build:
+ name: Verify
+ uses: apache/maven-gh-actions-shared/.github/workflows/maven-verify.yml@v4
+
diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml
new file mode 100644
index 00000000..1049eaa3
--- /dev/null
+++ b/.github/workflows/release-drafter.yml
@@ -0,0 +1,25 @@
+# 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.
+
+name: Release Drafter
+on:
+ push:
+ branches:
+ - master
+jobs:
+ update_release_draft:
+ uses: apache/maven-gh-actions-shared/.github/workflows/release-drafter.yml@v4
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/src/it/MDEPLOY-181/verify.groovy b/Jenkinsfile
similarity index 83%
rename from src/it/MDEPLOY-181/verify.groovy
rename to Jenkinsfile
index 0c55d6e1..e9f05f7d 100644
--- a/src/it/MDEPLOY-181/verify.groovy
+++ b/Jenkinsfile
@@ -1,21 +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.
- */
-
-def buildLog = new File ( basedir, "build.log")
-assert !buildLog.text.contains( '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.
+ */
+
+asfMavenTlpPlgnBuild()
diff --git a/README.md b/README.md
new file mode 100644
index 00000000..52b7b0fd
--- /dev/null
+++ b/README.md
@@ -0,0 +1,100 @@
+
+Contributing to [Apache Maven Deploy Plugin](https://maven.apache.org/plugins/maven-deploy-plugin/)
+======================
+
+[][jira]
+[][license]
+[](https://search.maven.org/artifact/org.apache.maven.plugins/maven-deploy-plugin)
+[](https://github.com/jvm-repo-rebuild/reproducible-central/blob/master/content/org/apache/maven/plugins/maven-deploy-plugin/README.md)
+[][build]
+[][test-results]
+
+
+You have found a bug or you have an idea for a cool new feature? Contributing
+code is a great way to give something back to the open source community. Before
+you dig right into the code, there are a few guidelines that we need
+contributors to follow so that we can have a chance of keeping on top of
+things.
+
+Getting Started
+---------------
+
++ Make sure you have a [JIRA account](https://issues.apache.org/jira/).
++ Make sure you have a [GitHub account](https://github.com/signup/free).
++ If you're planning to implement a new feature, it makes sense to discuss your changes
+ on the [dev list][ml-list]] first.
+ This way you can make sure you're not wasting your time on something that isn't
+ considered to be in Apache Maven's scope.
++ Submit a ticket for your issue, assuming one does not already exist.
+ + Clearly describe the issue, including steps to reproduce when it is a bug.
+ + Make sure you fill in the earliest version that you know has the issue.
++ Fork the repository on GitHub.
+
+Making and Submitting Changes
+--------------
+
+We accept Pull Requests via GitHub. The [developer mailing list][ml-list] is the
+main channel of communication for contributors.
+There are some guidelines which will make applying PRs easier for us:
++ Create a topic branch from where you want to base your work (this is usually the master branch).
+ Push your changes to a topic branch in your fork of the repository.
++ Make commits of logical units.
++ Respect the original code style: by using the same [codestyle][code-style],
+ patches should only highlight the actual difference, not being disturbed by any formatting issues:
+ + Only use spaces for indentation.
+ + Create minimal diffs - disable on save actions like reformat source code or organize imports.
+ If you feel the source code should be reformatted, create a separate PR for this change.
+ + Check for unnecessary whitespace with `git diff --check` before committing.
++ Make sure your commit messages are in the proper format. Your commit message should contain the key of the JIRA issue.
+```
+[MDEPLOY-XXX] - Subject of the JIRA Ticket
+ Optional supplemental description.
+```
++ Make sure you have added the necessary tests (JUnit/IT) for your changes.
++ Run all the tests with `mvn -Prun-its verify` to assure nothing else was accidentally broken.
++ Submit a pull request to the repository in the Apache organization.
++ Update your JIRA ticket and include a link to the pull request in the ticket.
+
+If you plan to contribute on a regular basis, please consider filing a [contributor license agreement][cla].
+
+Making Trivial Changes
+----------------------
+
+For changes of a trivial nature to comments and documentation, it is not always
+necessary to create a new ticket in JIRA. In this case, it is appropriate to
+start the first line of a commit with '(doc)' instead of a ticket number.
+
+Additional Resources
+--------------------
+
++ [Contributing patches](https://maven.apache.org/guides/development/guide-maven-development.html#Creating_and_submitting_a_patch)
++ [Apache Maven Deploy JIRA project page][jira]
++ [Contributor License Agreement][cla]
++ [General GitHub documentation](https://help.github.com/)
++ [GitHub pull request documentation](https://help.github.com/send-pull-requests/)
++ [Apache Maven Twitter Account](https://twitter.com/ASFMavenProject)
++ #Maven IRC channel on freenode.org
+
+[jira]: https://issues.apache.org/jira/projects/MDEPLOY/
+[license]: https://www.apache.org/licenses/LICENSE-2.0
+[ml-list]: https://maven.apache.org/mailing-lists.html
+[code-style]: https://maven.apache.org/developers/conventions/code.html
+[cla]: https://www.apache.org/licenses/#clas
+[maven-wiki]: https://cwiki.apache.org/confluence/display/MAVEN/Index
+[test-results]: https://ci-maven.apache.org/job/Maven/job/maven-box/job/maven-deploy-plugin/job/master/lastCompletedBuild/testReport/
+[build]: https://ci-maven.apache.org/job/Maven/job/maven-box/job/maven-deploy-plugin/job/master/
diff --git a/pom.xml b/pom.xml
index 03b2d9c3..a4363e37 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,5 +1,4 @@
-
-
+
-
4.0.0org.apache.maven.pluginsmaven-plugins
- 25
- ../maven-plugins/pom.xml
+ 42
+ maven-deploy-plugin
- 2.8.2
+ 3.1.2maven-pluginApache Maven Deploy PluginUploads the project artifacts to the internal remote repository.2004
+
+
+
+ Hermann Josef Hill
+
+
+
- ${mavenVersion}
+ 3.6.3
- 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:git:https://gitbox.apache.org/repos/asf/maven-deploy-plugin.git
+ scm:git:https://gitbox.apache.org/repos/asf/maven-deploy-plugin.git
+ maven-deploy-plugin-3.1.2
+ https://github.com/apache/maven-deploy-plugin/tree/${project.scm.tag}JIRA
- http://jira.codehaus.org/browse/MDEPLOY
+ https://issues.apache.org/jira/browse/MDEPLOY
+
+ Jenkins
+ https://ci-builds.apache.org/job/Maven/job/maven-box/job/maven-deploy-plugin/
+ apache.website
- scm:svn:https://svn.apache.org/repos/infra/websites/production/maven/content/${maven.site.path}
+ scm:svn:https://svn.apache.org/repos/asf/maven/website/components/${maven.site.path}
- 2.2.1
- 3.2
+ 8
+ 3.9.6
+
+ 1.7.36
+
+ 1.9.18
+
+
+ ${version.maven-antrun-plugin}
+ ${version.maven-compiler-plugin}
+ ${version.maven-enforcer-plugin}
+ ${version.maven-install-plugin}
+ ${version.maven-jar-plugin}
+ ${version.maven-javadoc-plugin}
+ ${version.maven-plugin-tools}
+ ${version.maven-resources-plugin}
+ ${version.maven-source-plugin}
+ ${version.maven-surefire}
+ ${version.maven-war-plugin}
+
+ 2024-04-26T10:30:22Z
@@ -67,90 +96,131 @@ under the License.
org.apache.mavenmaven-plugin-api${mavenVersion}
+ providedorg.apache.maven
- maven-project
+ maven-core${mavenVersion}
+ providedorg.apache.mavenmaven-model${mavenVersion}
+ providedorg.apache.mavenmaven-artifact${mavenVersion}
+ provided
-
+
- org.apache.maven.plugin-tools
- maven-plugin-annotations
- ${mavenPluginPluginVersion}
+ org.slf4j
+ slf4j-api
+ ${slf4jVersion}providedorg.codehaus.plexusplexus-utils
- 3.0.15
+
+ org.codehaus.plexus
+ plexus-xml
+
+
+ org.apache.maven.resolver
+ maven-resolver-api
+ ${resolverVersion}
+ provided
+
+
+ org.apache.maven.resolver
+ maven-resolver-util
+ ${resolverVersion}
+
+ compile
+
+
+
+
+ org.apache.maven.plugin-tools
+ maven-plugin-annotations
+ provided
+
+
+
org.apache.maven.plugin-testingmaven-plugin-testing-harness
- 1.2
+ 3.3.0
+ test
+
+
+
+ org.apache.maven
+ maven-compat
+ ${mavenVersion}
+ test
+
+
+ org.apache.maven
+ maven-resolver-provider
+ ${mavenVersion}
+ test
+
+
+ org.apache.maven.resolver
+ maven-resolver-connector-basic
+ ${resolverVersion}
+ test
+
+
+ org.apache.maven.resolver
+ maven-resolver-transport-file
+ ${resolverVersion}
+ test
+
+
+ org.apache.maven.resolver
+ maven-resolver-transport-http
+ ${resolverVersion}testorg.mockitomockito-core
- 1.9.5
+ 4.11.0testjunitjunit
- 3.8.2
+ 4.13.2
+ test
+
+
+ org.slf4j
+ slf4j-nop
+ ${slf4jVersion}test
-
-
-
- Hermann Josef Hill
-
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-plugin-plugin
- ${mavenPluginPluginVersion}
-
- true
-
-
-
- mojo-descriptor
- process-classes
-
- descriptor
-
-
-
- help-goal
-
- helpmojo
-
-
-
-
-
-
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+
+ none
+ true
+
+
+
@@ -164,6 +234,7 @@ under the License.
maven-invoker-plugintrue
+ true${project.build.directory}/ittrue
@@ -174,6 +245,12 @@ under the License.
verify${project.build.directory}/local-reposrc/it/settings.xml
+
+ ${project.build.directory}/remote-repo
+
+
+ ${project.build.directory}/remote-repo
+ deploy
@@ -183,31 +260,5 @@ under the License.
-
- reporting
-
-
-
- org.apache.maven.plugins
- maven-changes-plugin
- 2.3
-
-
- Type,Key,Summary,Assignee,Status,Resolution,Fix Version
- true
- Closed
- Type,Key
-
-
-
-
- jira-report
-
-
-
-
-
-
-
diff --git a/src/it/3rd-party-jar-with-extras/test.properties b/src/it/3rd-party-jar-with-extras/test.properties
index c2b57c06..6fd20939 100644
--- a/src/it/3rd-party-jar-with-extras/test.properties
+++ b/src/it/3rd-party-jar-with-extras/test.properties
@@ -17,7 +17,6 @@
file = test-0.1.jar
url = file:target/repo
-updateReleaseInfo = true
groupId = org.apache.maven.its.deploy.tpjwop
artifactId = test
version = 1.0
diff --git a/src/it/3rd-party-jar-without-pom/test.properties b/src/it/3rd-party-jar-without-pom/test.properties
index 02fcbcf6..269719d4 100644
--- a/src/it/3rd-party-jar-without-pom/test.properties
+++ b/src/it/3rd-party-jar-without-pom/test.properties
@@ -17,7 +17,6 @@
file = test-0.1.jar
url = file:target/repo
-updateReleaseInfo = true
groupId = org.apache.maven.its.deploy.tpjwop
artifactId = test
version = 1.0
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 00000000..2169f44a
Binary files /dev/null and b/src/it/3rd-party-pom-with-extras/test-0.1-src.tar.gz differ
diff --git a/src/it/3rd-party-pom-with-extras/test-0.1.pom b/src/it/3rd-party-pom-with-extras/test-0.1.pom
new file mode 100644
index 00000000..83f1a8e7
--- /dev/null
+++ b/src/it/3rd-party-pom-with-extras/test-0.1.pom
@@ -0,0 +1,28 @@
+
+
+
+
+
+ 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 00000000..ad736b0d
Binary files /dev/null and b/src/it/3rd-party-pom-with-extras/test-0.1.tar.gz differ
diff --git a/src/it/3rd-party-pom-with-extras/test-0.1.zip b/src/it/3rd-party-pom-with-extras/test-0.1.zip
new file mode 100644
index 00000000..226277c3
Binary files /dev/null and b/src/it/3rd-party-pom-with-extras/test-0.1.zip differ
diff --git a/src/it/3rd-party-pom-with-extras/test.properties b/src/it/3rd-party-pom-with-extras/test.properties
new file mode 100644
index 00000000..5c4d1159
--- /dev/null
+++ b/src/it/3rd-party-pom-with-extras/test.properties
@@ -0,0 +1,26 @@
+# 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-0.1.pom
+url = file:target/repo
+groupId = org.apache.maven.its.deploy.tppwoc
+artifactId = test
+version = 1.0
+packaging = pom
+files = test-0.1.zip,test-0.1-src.tar.gz,test-0.1.tar.gz
+types = zip,tar.gz,tar.gz
+classifiers = ,src,
diff --git a/src/it/3rd-party-pom-with-extras/verify.bsh b/src/it/3rd-party-pom-with-extras/verify.bsh
new file mode 100644
index 00000000..a477aa2a
--- /dev/null
+++ b/src/it/3rd-party-pom-with-extras/verify.bsh
@@ -0,0 +1,57 @@
+/*
+ * 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/tppwoc/test/maven-metadata.xml",
+ "org/apache/maven/its/deploy/tppwoc/test/1.0/test-1.0.pom",
+ "org/apache/maven/its/deploy/tppwoc/test/1.0/test-1.0.zip",
+ "org/apache/maven/its/deploy/tppwoc/test/1.0/test-1.0-src.tar.gz",
+ "org/apache/maven/its/deploy/tppwoc/test/1.0/test-1.0.tar.gz",
+};
+
+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() );
+ }
+}
+
+String[] missing =
+{
+ "org/apache/maven/its/deploy/tppwoc/test/1.0/test-1.0.jar",
+};
+
+for ( String path : missing )
+{
+ File file = new File( new File( basedir, "target/repo" ), path );
+ System.out.println( "Checking for absence of " + file );
+ if ( file.exists() )
+ {
+ throw new FileNotFoundException( "Existent: " + file.getAbsolutePath() );
+ }
+}
+
+return true;
diff --git a/src/it/MDEPLOY-169_deploy-at-end-multithread/invoker.properties b/src/it/MDEPLOY-169_deploy-at-end-multithread/invoker.properties
index 18efa761..50360fc0 100644
--- a/src/it/MDEPLOY-169_deploy-at-end-multithread/invoker.properties
+++ b/src/it/MDEPLOY-169_deploy-at-end-multithread/invoker.properties
@@ -1,18 +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.goals = clean deploy -T2
-invoker.maven.version = 3.0+
\ No newline at end of file
+# 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 -T2
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..af8d8c2b 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
@@ -48,7 +47,7 @@ under the License.
org.apache.maven.pluginsmaven-compiler-plugin
- 2.0.2
+ @mavenCompilerPluginVersion@org.apache.maven.plugins
@@ -61,22 +60,22 @@ under the License.
org.apache.maven.pluginsmaven-install-plugin
- 2.2
+ @mavenInstallPluginVersion@org.apache.maven.pluginsmaven-jar-plugin
- 2.1
+ @mavenJarPluginVersion@org.apache.maven.pluginsmaven-resources-plugin
- 2.2
+ @mavenResourcesPluginVersion@org.apache.maven.pluginsmaven-source-plugin
- 2.0.4
+ @mavenSourcePluginVersion@attach-sources
@@ -89,7 +88,7 @@ under the License.
org.apache.maven.pluginsmaven-surefire-plugin
- 2.3.1
+ @mavenSurefirePluginVersion@
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..8884e138 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
@@ -48,7 +47,7 @@ under the License.
org.apache.maven.pluginsmaven-compiler-plugin
- 2.0.2
+ @mavenCompilerPluginVersion@org.apache.maven.plugins
@@ -61,22 +60,22 @@ under the License.
org.apache.maven.pluginsmaven-install-plugin
- 2.2
+ @mavenInstallPluginVersion@org.apache.maven.pluginsmaven-jar-plugin
- 2.1
+ @mavenJarPluginVersion@org.apache.maven.pluginsmaven-resources-plugin
- 2.2
+ @mavenResourcesPluginVersion@org.apache.maven.pluginsmaven-source-plugin
- 2.0.4
+ @mavenSourcePluginVersion@attach-sources
@@ -89,7 +88,7 @@ under the License.
org.apache.maven.pluginsmaven-surefire-plugin
- 2.3.1
+ @mavenSurefirePluginVersion@
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..8ff44f4d
--- /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://issues.apache.org/jira/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..181104aa
--- /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 groovy.xml.XmlParser().parse( deployedPom )
+assert "https://issues.apache.org/jira/browse/MDEPLOY-178".equals( pomProject.get("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/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 00000000..2fa3a242
Binary files /dev/null and b/src/it/MDEPLOY-202_deployfile-with-multiple-executions/lib/org.eclipse.equinox.common.source_1.0.jar differ
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 00000000..2fa3a242
Binary files /dev/null and b/src/it/MDEPLOY-202_deployfile-with-multiple-executions/lib/org.eclipse.equinox.common_1.0.jar differ
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 00000000..2fa3a242
Binary files /dev/null and b/src/it/MDEPLOY-202_deployfile-with-multiple-executions/lib/org.eclipse.osgi.source_1.0.jar differ
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 00000000..2fa3a242
Binary files /dev/null and b/src/it/MDEPLOY-202_deployfile-with-multiple-executions/lib/org.eclipse.osgi_1.0.jar differ
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..a9a99927
--- /dev/null
+++ b/src/it/MDEPLOY-202_deployfile-with-multiple-executions/pom.xml
@@ -0,0 +1,99 @@
+
+
+
+
+
+ 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
+
+
+
+
+
+
+ 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..4232c455
--- /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 buildLog.text =~ /Uploading.*file:target\/repo\/org\/apache\/maven\/plugins\/deploy\/it\/org\.eclipse\.osgi\/1\.0\/org\.eclipse\.osgi-1\.0-sources\.jar/
diff --git a/src/it/MDEPLOY-181/test.properties b/src/it/MDEPLOY-212/invoker.properties
similarity index 95%
rename from src/it/MDEPLOY-181/test.properties
rename to src/it/MDEPLOY-212/invoker.properties
index fb658e56..a644cb7e 100644
--- a/src/it/MDEPLOY-181/test.properties
+++ b/src/it/MDEPLOY-212/invoker.properties
@@ -1,18 +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.
-
-deployAtEnd=false
\ No newline at end of file
+# 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 package
diff --git a/src/it/MDEPLOY-212/pom.xml b/src/it/MDEPLOY-212/pom.xml
new file mode 100644
index 00000000..8bca65b1
--- /dev/null
+++ b/src/it/MDEPLOY-212/pom.xml
@@ -0,0 +1,79 @@
+
+
+
+
+
+ 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
+ @mavenJavadocPluginVersion@
+
+
+ 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/test/java/org/apache/maven/plugin/deploy/stubs/MavenProjectStub.java b/src/it/MDEPLOY-212/src/main/java/org/apache/maven/test/HelloWorld.java
similarity index 68%
rename from src/test/java/org/apache/maven/plugin/deploy/stubs/MavenProjectStub.java
rename to src/it/MDEPLOY-212/src/main/java/org/apache/maven/test/HelloWorld.java
index 3c8531f2..ed8b2ca7 100644
--- a/src/test/java/org/apache/maven/plugin/deploy/stubs/MavenProjectStub.java
+++ b/src/it/MDEPLOY-212/src/main/java/org/apache/maven/test/HelloWorld.java
@@ -1,4 +1,4 @@
-package org.apache.maven.plugin.deploy.stubs;
+package org.apache.maven.test;
/*
* Licensed to the Apache Software Foundation (ASF) under one
@@ -19,17 +19,19 @@
* under the License.
*/
-import org.apache.maven.artifact.repository.ArtifactRepository;
-
-public class MavenProjectStub
- extends org.apache.maven.plugin.testing.stubs.MavenProjectStub
+/**
+ * Hello World class
+ */
+public class HelloWorld
{
- private ArtifactRepositoryStub deploymentRepository;
-
- public ArtifactRepository getDistributionManagementArtifactRepository()
+ /**
+ * Main method
+ * @param args Arguments
+ */
+ public static void main( String[] args )
{
- return deploymentRepository;
+ 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 00000000..ad736b0d
Binary files /dev/null and b/src/it/MDEPLOY-212/test-1.0.tar.gz differ
diff --git a/src/it/MDEPLOY-212/test-1.0.zip b/src/it/MDEPLOY-212/test-1.0.zip
new file mode 100644
index 00000000..226277c3
Binary files /dev/null and b/src/it/MDEPLOY-212/test-1.0.zip differ
diff --git a/src/it/MDEPLOY-212/verify.bsh b/src/it/MDEPLOY-212/verify.bsh
new file mode 100644
index 00000000..f71e2520
--- /dev/null
+++ b/src/it/MDEPLOY-212/verify.bsh
@@ -0,0 +1,56 @@
+/*
+ * 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/mdeploy-212/test/1.0/test-1.0.pom",
+ "org/apache/maven/its/mdeploy-212/test/1.0/test-1.0.tar.gz",
+ "org/apache/maven/its/mdeploy-212/test/1.0/test-1.0-it.zip",
+};
+
+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() );
+ }
+}
+
+String[] missing =
+{
+ "org/apache/maven/its/mdeploy-212/test/1.0/test-1.0.jar",
+ "org/apache/maven/its/mdeploy-212/test/1.0/test-1.0-javadoc.jar",
+};
+
+for ( String path : missing )
+{
+ File file = new File( new File( basedir, "target/repo" ), path );
+ System.out.println( "Checking for absence of " + file );
+ if ( file.exists() )
+ {
+ throw new FileNotFoundException( "Existent: " + file.getAbsolutePath() );
+ }
+}
+
+return true;
diff --git a/src/it/MDEPLOY-181/invoker.properties b/src/it/MDEPLOY-213/invoker.properties
similarity index 89%
rename from src/it/MDEPLOY-181/invoker.properties
rename to src/it/MDEPLOY-213/invoker.properties
index ac00f436..2035eadd 100644
--- a/src/it/MDEPLOY-181/invoker.properties
+++ b/src/it/MDEPLOY-213/invoker.properties
@@ -15,6 +15,4 @@
# 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
+invoker.goals = clean package deploy
diff --git a/src/it/MDEPLOY-213/pom.xml b/src/it/MDEPLOY-213/pom.xml
new file mode 100644
index 00000000..ff4574d6
--- /dev/null
+++ b/src/it/MDEPLOY-213/pom.xml
@@ -0,0 +1,87 @@
+
+
+
+
+
+ 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
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-javadoc-plugin
+ @mavenJavadocPluginVersion@
+
+
+ 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 00000000..ad736b0d
Binary files /dev/null and b/src/it/MDEPLOY-213/test-1.0.tar.gz differ
diff --git a/src/it/MDEPLOY-213/test-1.0.zip b/src/it/MDEPLOY-213/test-1.0.zip
new file mode 100644
index 00000000..226277c3
Binary files /dev/null and b/src/it/MDEPLOY-213/test-1.0.zip differ
diff --git a/src/it/no-main-artifact-2/verify.bsh b/src/it/MDEPLOY-213/verify.bsh
similarity index 78%
rename from src/it/no-main-artifact-2/verify.bsh
rename to src/it/MDEPLOY-213/verify.bsh
index 4468ed8f..ae711422 100644
--- a/src/it/no-main-artifact-2/verify.bsh
+++ b/src/it/MDEPLOY-213/verify.bsh
@@ -22,9 +22,11 @@ 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",
+ "org/apache/maven/its/mdeploy-213/test/1.0/test-1.0.pom",
+ "org/apache/maven/its/mdeploy-213/test/1.0/test-1.0.tar.gz",
+ "org/apache/maven/its/mdeploy-213/test/1.0/test-1.0-it.zip",
+ "org/apache/maven/its/mdeploy-213/test/1.0/test-1.0.jar",
+ "org/apache/maven/its/mdeploy-213/test/1.0/test-1.0-javadoc.jar",
};
for ( String path : paths )
diff --git a/src/it/MDEPLOY-224_deploy-at-end-only-modules/module1/pom.xml b/src/it/MDEPLOY-224_deploy-at-end-only-modules/module1/pom.xml
new file mode 100644
index 00000000..9f255085
--- /dev/null
+++ b/src/it/MDEPLOY-224_deploy-at-end-only-modules/module1/pom.xml
@@ -0,0 +1,37 @@
+
+
+
+
+
+ 4.0.0
+
+
+ org.apache.maven.its.mdeploy-224
+ parent
+ 1.0
+
+ module1
+
+
+
+ org.apache.maven.plugins
+ maven-deploy-plugin
+ @project.version@
+
+ true
+
+
+
+
+
+
diff --git a/src/it/MDEPLOY-181/module2/pom.xml b/src/it/MDEPLOY-224_deploy-at-end-only-modules/module2/pom.xml
similarity index 89%
rename from src/it/MDEPLOY-181/module2/pom.xml
rename to src/it/MDEPLOY-224_deploy-at-end-only-modules/module2/pom.xml
index d811568c..081edc5a 100644
--- a/src/it/MDEPLOY-181/module2/pom.xml
+++ b/src/it/MDEPLOY-224_deploy-at-end-only-modules/module2/pom.xml
@@ -1,38 +1,38 @@
-
-
-
-
-
- 4.0.0
-
-
- org.apache.maven.its.mdeploy-170
- configperproject
- 1.0
-
- module2
- pom
-
-
-
-
- org.apache.maven.plugins
- maven-deploy-plugin
- @project.version@
-
- true
-
-
-
-
-
+
+
+
+
+
+ 4.0.0
+
+
+ org.apache.maven.its.mdeploy-224
+ parent
+ 1.0
+
+ module2
+ pom
+
+
+
+
+ org.apache.maven.plugins
+ maven-deploy-plugin
+ @project.version@
+
+ true
+
+
+
+
+
diff --git a/src/it/MDEPLOY-224_deploy-at-end-only-modules/pom.xml b/src/it/MDEPLOY-224_deploy-at-end-only-modules/pom.xml
new file mode 100644
index 00000000..f40c64ac
--- /dev/null
+++ b/src/it/MDEPLOY-224_deploy-at-end-only-modules/pom.xml
@@ -0,0 +1,87 @@
+
+
+
+
+
+ 4.0.0
+
+ org.apache.maven.its.mdeploy-224
+ parent
+ 1.0
+ pom
+
+
+ Tests deployment at end only in modules.
+
+
+
+ true
+
+
+
+
+ it
+ file:///${basedir}/target/repo
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ @mavenCompilerPluginVersion@
+
+
+ org.apache.maven.plugins
+ maven-deploy-plugin
+ @project.version@
+
+ false
+
+
+
+ org.apache.maven.plugins
+ maven-install-plugin
+ @mavenInstallPluginVersion@
+
+
+ org.apache.maven.plugins
+ maven-jar-plugin
+ @mavenJarPluginVersion@
+
+
+ org.apache.maven.plugins
+ maven-resources-plugin
+ @mavenResourcesPluginVersion@
+
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+ @mavenSurefirePluginVersion@
+
+
+
+
+
+ module1
+ module2
+
+
diff --git a/src/it/MDEPLOY-224_deploy-at-end-only-modules/verify.groovy b/src/it/MDEPLOY-224_deploy-at-end-only-modules/verify.groovy
new file mode 100644
index 00000000..063f2aee
--- /dev/null
+++ b/src/it/MDEPLOY-224_deploy-at-end-only-modules/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/its/mdeploy-224/parent/1.0/parent-1.0.pom" ).exists()
+assert new File( basedir, "module1/target/repo/org/apache/maven/its/mdeploy-224/module1/1.0/module1-1.0.pom" ).exists()
+assert new File( basedir, "module2/target/repo/org/apache/maven/its/mdeploy-224/module2/1.0/module2-1.0.pom" ).exists()
+
+def buildLog = new File ( basedir, "build.log").text
+
+assert ! buildLog.contains('[INFO] Deferring deploy for org.apache.maven.its.mdeploy-224:parent:1.0 at end')
+assert buildLog.contains('[INFO] Deferring deploy for org.apache.maven.its.mdeploy-224:module1:1.0 at end')
+// Last module does not emit this misleading message, as it IS "the end", not deferring anymore
+// assert buildLog.contains('[INFO] Deferring deploy for org.apache.maven.its.mdeploy-224:module2:1.0 at end')
diff --git a/src/it/MDEPLOY-225_deploy-at-end-skip-root/module1/pom.xml b/src/it/MDEPLOY-225_deploy-at-end-skip-root/module1/pom.xml
new file mode 100644
index 00000000..325a6342
--- /dev/null
+++ b/src/it/MDEPLOY-225_deploy-at-end-skip-root/module1/pom.xml
@@ -0,0 +1,37 @@
+
+
+
+
+
+ 4.0.0
+
+
+ org.apache.maven.its.mdeploy-225
+ parent
+ 1.0
+
+ module1
+
+
+
+ org.apache.maven.plugins
+ maven-deploy-plugin
+ @project.version@
+
+ false
+
+
+
+
+
+
diff --git a/src/it/MDEPLOY-225_deploy-at-end-skip-root/module2/pom.xml b/src/it/MDEPLOY-225_deploy-at-end-skip-root/module2/pom.xml
new file mode 100644
index 00000000..5bb4f62a
--- /dev/null
+++ b/src/it/MDEPLOY-225_deploy-at-end-skip-root/module2/pom.xml
@@ -0,0 +1,38 @@
+
+
+
+
+
+ 4.0.0
+
+
+ org.apache.maven.its.mdeploy-225
+ parent
+ 1.0
+
+ module2
+ pom
+
+
+
+
+ org.apache.maven.plugins
+ maven-deploy-plugin
+ @project.version@
+
+ false
+
+
+
+
+
diff --git a/src/it/MDEPLOY-181/pom.xml b/src/it/MDEPLOY-225_deploy-at-end-skip-root/pom.xml
similarity index 74%
rename from src/it/MDEPLOY-181/pom.xml
rename to src/it/MDEPLOY-225_deploy-at-end-skip-root/pom.xml
index 3e7d3cc7..8ac0f820 100644
--- a/src/it/MDEPLOY-181/pom.xml
+++ b/src/it/MDEPLOY-225_deploy-at-end-skip-root/pom.xml
@@ -1,101 +1,88 @@
-
-
-
-
-
- 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
-
-
+
+
+
+
+
+ 4.0.0
+
+ org.apache.maven.its.mdeploy-225
+ parent
+ 1.0
+ pom
+
+
+ Tests deployment at end with skipped root project.
+
+
+
+ true
+
+
+
+
+ it
+ file:///${basedir}/target/repo
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ @mavenCompilerPluginVersion@
+
+
+ org.apache.maven.plugins
+ maven-deploy-plugin
+ @project.version@
+
+ true
+ true
+
+
+
+ org.apache.maven.plugins
+ maven-install-plugin
+ @mavenInstallPluginVersion@
+
+
+ org.apache.maven.plugins
+ maven-jar-plugin
+ @mavenJarPluginVersion@
+
+
+ org.apache.maven.plugins
+ maven-resources-plugin
+ @mavenResourcesPluginVersion@
+
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+ @mavenSurefirePluginVersion@
+
+
+
+
+
+ module1
+ module2
+
+
diff --git a/src/it/MDEPLOY-225_deploy-at-end-skip-root/verify.groovy b/src/it/MDEPLOY-225_deploy-at-end-skip-root/verify.groovy
new file mode 100644
index 00000000..edcc0b97
--- /dev/null
+++ b/src/it/MDEPLOY-225_deploy-at-end-skip-root/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.
+ */
+
+assert ! new File( basedir, "target/repo" ).exists()
+assert new File( basedir, "module1/target/repo/org/apache/maven/its/mdeploy-225/module1/1.0/module1-1.0.pom" ).exists()
+assert new File( basedir, "module2/target/repo/org/apache/maven/its/mdeploy-225/module2/1.0/module2-1.0.pom" ).exists()
diff --git a/src/it/alt-deploy-repo-with-dist-mgmt-snapshot/pom.xml b/src/it/alt-deploy-repo-with-dist-mgmt-snapshot/pom.xml
index ac1f97eb..cd943815 100644
--- a/src/it/alt-deploy-repo-with-dist-mgmt-snapshot/pom.xml
+++ b/src/it/alt-deploy-repo-with-dist-mgmt-snapshot/pom.xml
@@ -48,7 +48,7 @@ under the License.
org.apache.maven.pluginsmaven-compiler-plugin
- 2.0.2
+ @mavenCompilerPluginVersion@org.apache.maven.plugins
@@ -58,22 +58,22 @@ under the License.
org.apache.maven.pluginsmaven-install-plugin
- 2.2
+ @mavenInstallPluginVersion@org.apache.maven.pluginsmaven-jar-plugin
- 2.1
+ @mavenJarPluginVersion@org.apache.maven.pluginsmaven-resources-plugin
- 2.2
+ @mavenResourcesPluginVersion@org.apache.maven.pluginsmaven-surefire-plugin
- 2.3.1
+ @mavenSurefirePluginVersion@
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/pom.xml b/src/it/alt-deploy-repo-with-dist-mgmt/pom.xml
index aa1dd736..e29e00f4 100644
--- a/src/it/alt-deploy-repo-with-dist-mgmt/pom.xml
+++ b/src/it/alt-deploy-repo-with-dist-mgmt/pom.xml
@@ -48,7 +48,7 @@ under the License.
org.apache.maven.pluginsmaven-compiler-plugin
- 2.0.2
+ @mavenCompilerPluginVersion@org.apache.maven.plugins
@@ -58,22 +58,22 @@ under the License.
org.apache.maven.pluginsmaven-install-plugin
- 2.2
+ @mavenInstallPluginVersion@org.apache.maven.pluginsmaven-jar-plugin
- 2.1
+ @mavenJarPluginVersion@org.apache.maven.pluginsmaven-resources-plugin
- 2.2
+ @mavenResourcesPluginVersion@org.apache.maven.pluginsmaven-surefire-plugin
- 2.3.1
+ @mavenSurefirePluginVersion@
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/pom.xml b/src/it/alt-deploy-repo-without-dist-mgmt/pom.xml
index a6826e95..185d92d7 100644
--- a/src/it/alt-deploy-repo-without-dist-mgmt/pom.xml
+++ b/src/it/alt-deploy-repo-without-dist-mgmt/pom.xml
@@ -41,7 +41,7 @@ under the License.
org.apache.maven.pluginsmaven-compiler-plugin
- 2.0.2
+ @mavenCompilerPluginVersion@org.apache.maven.plugins
@@ -51,22 +51,22 @@ under the License.
org.apache.maven.pluginsmaven-install-plugin
- 2.2
+ @mavenInstallPluginVersion@org.apache.maven.pluginsmaven-jar-plugin
- 2.1
+ @mavenJarPluginVersion@org.apache.maven.pluginsmaven-resources-plugin
- 2.2
+ @mavenResourcesPluginVersion@org.apache.maven.pluginsmaven-surefire-plugin
- 2.3.1
+ @mavenSurefirePluginVersion@
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/attach-release-jar/pom.xml b/src/it/attach-release-jar/pom.xml
index 035707c5..916f2462 100644
--- a/src/it/attach-release-jar/pom.xml
+++ b/src/it/attach-release-jar/pom.xml
@@ -33,14 +33,12 @@ under the License.
true
- trueitfile:///${basedir}/target/repo
- false
@@ -49,7 +47,7 @@ under the License.
org.apache.maven.pluginsmaven-compiler-plugin
- 2.0.2
+ @mavenCompilerPluginVersion@org.apache.maven.plugins
@@ -59,22 +57,22 @@ under the License.
org.apache.maven.pluginsmaven-install-plugin
- 2.2
+ @mavenInstallPluginVersion@org.apache.maven.pluginsmaven-jar-plugin
- 2.1
+ @mavenJarPluginVersion@org.apache.maven.pluginsmaven-resources-plugin
- 2.2
+ @mavenResourcesPluginVersion@org.apache.maven.pluginsmaven-source-plugin
- 2.0.4
+ @mavenSourcePluginVersion@attach-sources
@@ -83,11 +81,14 @@ under the License.
+
+ true
+ org.apache.maven.pluginsmaven-surefire-plugin
- 2.3.1
+ @mavenSurefirePluginVersion@
diff --git a/src/it/deploy-at-end-fail/module1/pom.xml b/src/it/deploy-at-end-fail/module1/pom.xml
index 7b48b486..ba919db5 100644
--- a/src/it/deploy-at-end-fail/module1/pom.xml
+++ b/src/it/deploy-at-end-fail/module1/pom.xml
@@ -27,7 +27,7 @@
org.apache.maven.pluginsmaven-enforcer-plugin
- 1.2
+ @mavenEnforcerPluginVersion@enforce
diff --git a/src/it/deploy-at-end-fail/pom.xml b/src/it/deploy-at-end-fail/pom.xml
index 92e45b05..ed5f9ba0 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
@@ -48,7 +47,7 @@ under the License.
org.apache.maven.pluginsmaven-compiler-plugin
- 2.0.2
+ @mavenCompilerPluginVersion@org.apache.maven.plugins
@@ -61,22 +60,22 @@ under the License.
org.apache.maven.pluginsmaven-install-plugin
- 2.2
+ @mavenInstallPluginVersion@org.apache.maven.pluginsmaven-jar-plugin
- 2.1
+ @mavenJarPluginVersion@org.apache.maven.pluginsmaven-resources-plugin
- 2.2
+ @mavenResourcesPluginVersion@org.apache.maven.pluginsmaven-source-plugin
- 2.0.4
+ @mavenSourcePluginVersion@attach-sources
@@ -89,7 +88,7 @@ under the License.
org.apache.maven.pluginsmaven-surefire-plugin
- 2.3.1
+ @mavenSurefirePluginVersion@
diff --git a/src/it/deploy-at-end-fail/verify.groovy b/src/it/deploy-at-end-fail/verify.groovy
index 03398e8b..27d678a6 100644
--- a/src/it/deploy-at-end-fail/verify.groovy
+++ b/src/it/deploy-at-end-fail/verify.groovy
@@ -22,5 +22,5 @@ assert !( new File( basedir, "module1/target/repo/org/apache/maven/its/deploy/da
File buildLog = new File( basedir, 'build.log' )
assert buildLog.exists()
-assert buildLog.text.contains( "[INFO] Deploying org.apache.maven.its.deploy.dae.fail:dae:1.0 at end" )
+assert buildLog.text.contains( "[INFO] Deferring deploy for org.apache.maven.its.deploy.dae.fail:dae:1.0 at end" )
diff --git a/src/it/deploy-at-end-pass/module1/pom.xml b/src/it/deploy-at-end-pass/module1/pom.xml
index 1a91fc56..602a8f5c 100644
--- a/src/it/deploy-at-end-pass/module1/pom.xml
+++ b/src/it/deploy-at-end-pass/module1/pom.xml
@@ -22,27 +22,4 @@
module1
-
-
-
- org.apache.maven.plugins
- maven-enforcer-plugin
- 1.2
-
-
- enforce
-
- enforce
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/it/deploy-at-end-pass/module2/pom.xml b/src/it/deploy-at-end-pass/module2/pom.xml
new file mode 100644
index 00000000..827396fe
--- /dev/null
+++ b/src/it/deploy-at-end-pass/module2/pom.xml
@@ -0,0 +1,39 @@
+
+
+
+
+
+ 4.0.0
+
+
+ org.apache.maven.its.deploy.dae.pass
+ dae
+ 1.0
+
+ module2
+
+
+
+
+ org.apache.maven.plugins
+ maven-deploy-plugin
+
+
+ default-deploy
+ none
+
+
+
+
+
+
diff --git a/src/it/MDEPLOY-181/module1/pom.xml b/src/it/deploy-at-end-pass/module3/pom.xml
similarity index 87%
rename from src/it/MDEPLOY-181/module1/pom.xml
rename to src/it/deploy-at-end-pass/module3/pom.xml
index aecbca0b..48c9caa0 100644
--- a/src/it/MDEPLOY-181/module1/pom.xml
+++ b/src/it/deploy-at-end-pass/module3/pom.xml
@@ -1,25 +1,25 @@
-
-
-
-
-
- 4.0.0
-
-
- org.apache.maven.its.mdeploy-170
- configperproject
- 1.0
-
- module1
-
-
+
+
+
+
+
+ 4.0.0
+
+
+ org.apache.maven.its.deploy.dae.pass
+ dae
+ 1.0
+
+ module3
+
+
diff --git a/src/it/deploy-at-end-pass/module4/pom.xml b/src/it/deploy-at-end-pass/module4/pom.xml
new file mode 100644
index 00000000..05f07629
--- /dev/null
+++ b/src/it/deploy-at-end-pass/module4/pom.xml
@@ -0,0 +1,38 @@
+
+
+
+
+
+ 4.0.0
+
+
+ org.apache.maven.its.deploy.dae.pass
+ dae
+ 1.0
+
+ module4
+
+
+ without-deploy
+
+
+
+
+ org.apache.maven.its.deploy.mock
+ mock-phase-maven-plugin
+ 1.0
+ true
+
+
+
+
diff --git a/src/it/deploy-at-end-pass/pom.xml b/src/it/deploy-at-end-pass/pom.xml
index 8021f6a1..90ed655c 100644
--- a/src/it/deploy-at-end-pass/pom.xml
+++ b/src/it/deploy-at-end-pass/pom.xml
@@ -38,8 +38,7 @@ under the License.
it
- file:///${basedir}/target/repo
- false
+ file:///@remoteRepo@/deploy-at-end-pass
@@ -48,7 +47,7 @@ under the License.
org.apache.maven.pluginsmaven-compiler-plugin
- 2.0.2
+ @mavenCompilerPluginVersion@org.apache.maven.plugins
@@ -61,22 +60,22 @@ under the License.
org.apache.maven.pluginsmaven-install-plugin
- 2.2
+ @mavenInstallPluginVersion@org.apache.maven.pluginsmaven-jar-plugin
- 2.1
+ @mavenJarPluginVersion@org.apache.maven.pluginsmaven-resources-plugin
- 2.2
+ @mavenResourcesPluginVersion@org.apache.maven.pluginsmaven-source-plugin
- 2.0.4
+ @mavenSourcePluginVersion@attach-sources
@@ -89,12 +88,15 @@ under the License.
org.apache.maven.pluginsmaven-surefire-plugin
- 2.3.1
+ @mavenSurefirePluginVersion@module1
+ module2
+ module3
+ module4
diff --git a/src/it/deploy-at-end-pass/verify.groovy b/src/it/deploy-at-end-pass/verify.groovy
index d776935a..8db44909 100644
--- a/src/it/deploy-at-end-pass/verify.groovy
+++ b/src/it/deploy-at-end-pass/verify.groovy
@@ -17,10 +17,16 @@
* under the License.
*/
-assert new File( basedir, "target/repo/org/apache/maven/its/deploy/dae/pass/dae/1.0/dae-1.0.pom" ).exists()
-assert new File( basedir, "module1/target/repo/org/apache/maven/its/deploy/dae/pass/module1/1.0/module1-1.0.pom" ).exists()
+assert new File( remoteRepo, "deploy-at-end-pass/org/apache/maven/its/deploy/dae/pass/dae/1.0/dae-1.0.pom" ).exists()
+assert new File( remoteRepo, "deploy-at-end-pass/org/apache/maven/its/deploy/dae/pass/module1/1.0/module1-1.0.pom" ).exists()
+assert new File( remoteRepo, "deploy-at-end-pass/org/apache/maven/its/deploy/dae/pass/module1/1.0/module1-1.0.jar" ).exists()
+assert new File( remoteRepo, "deploy-at-end-pass/org/apache/maven/its/deploy/dae/pass/module3/1.0/module3-1.0.pom" ).exists()
+assert new File( remoteRepo, "deploy-at-end-pass/org/apache/maven/its/deploy/dae/pass/module3/1.0/module3-1.0.jar" ).exists()
File buildLog = new File( basedir, 'build.log' )
assert buildLog.exists()
-assert buildLog.text.contains( "[INFO] Deploying org.apache.maven.its.deploy.dae.pass:dae:1.0 at end" )
+assert buildLog.text.contains( "[INFO] Deferring deploy for org.apache.maven.its.deploy.dae.pass:dae:1.0 at end" )
+assert buildLog.text.contains( "[INFO] Deferring deploy for org.apache.maven.its.deploy.dae.pass:module1:1.0 at end" )
+// Last module does not emit this misleading message, as it IS "the end", not deferring anymore
+//assert buildLog.text.contains( "[INFO] Deferring deploy for org.apache.maven.its.deploy.dae.pass:module3:1.0 at end" )
diff --git a/src/it/deploy-attached-sources/pom.xml b/src/it/deploy-attached-sources/pom.xml
index d0aac263..01a48240 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
@@ -49,7 +49,7 @@ under the License.
org.apache.maven.pluginsmaven-source-plugin
- 2.1.2
+ @mavenSourcePluginVersion@attach-sources
@@ -62,7 +62,7 @@ under the License.
org.apache.maven.pluginsmaven-javadoc-plugin
- 2.7
+ @mavenJavadocPluginVersion@attach-javadoc
diff --git a/src/it/deploy-default-packaging/pom.xml b/src/it/deploy-default-packaging/pom.xml
index 6394e352..9440f68f 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
@@ -49,7 +49,7 @@ under the License.
org.apache.maven.pluginsmaven-source-plugin
- 2.1.2
+ @mavenSourcePluginVersion@attach-sources
@@ -62,7 +62,7 @@ under the License.
org.apache.maven.pluginsmaven-javadoc-plugin
- 2.7
+ @mavenJavadocPluginVersion@attach-javadoc
diff --git a/src/it/deployfile-release-skip-fail/invoker.properties b/src/it/deployfile-release-skip-fail/invoker.properties
new file mode 100644
index 00000000..44aca986
--- /dev/null
+++ b/src/it/deployfile-release-skip-fail/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.goals=package deploy:deploy-file
diff --git a/src/it/deployfile-release-skip-fail/pom.xml b/src/it/deployfile-release-skip-fail/pom.xml
new file mode 100644
index 00000000..ab4e9cb7
--- /dev/null
+++ b/src/it/deployfile-release-skip-fail/pom.xml
@@ -0,0 +1,48 @@
+
+
+
+
+
+ 4.0.0
+
+ org.apache.maven.plugins.deploy.its
+ deployfile-release-skip-fail
+ 1.0
+
+
+ Test to verify that skip stops artifact deployment
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-deploy-plugin
+ @project.version@
+
+ 1.0
+ snapshots
+
+
+
+
+
+
diff --git a/src/it/deployfile-release-skip-fail/test.properties b/src/it/deployfile-release-skip-fail/test.properties
new file mode 100644
index 00000000..4b138a5c
--- /dev/null
+++ b/src/it/deployfile-release-skip-fail/test.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.
+file=target/deployfile-release-skip-fail-1.0.jar
+url=file:target/repo
\ No newline at end of file
diff --git a/src/it/deployfile-release-skip-fail/verify.groovy b/src/it/deployfile-release-skip-fail/verify.groovy
new file mode 100644
index 00000000..17fe4366
--- /dev/null
+++ b/src/it/deployfile-release-skip-fail/verify.groovy
@@ -0,0 +1,26 @@
+/*
+ * 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/deployfile-release-skip-fail/1.0/deployfile-release-skip-fail-1.0.jar").exists()
+File deployedPom = new File(basedir, "target/repo/org/apache/maven/plugins/deploy/its/deployfile-release-skip-fail/1.0/deployfile-release-skip-fail-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/deployfile-release-skip-fail/pom.xml as pomFile")
diff --git a/src/it/deployfile-release-skip/invoker.properties b/src/it/deployfile-release-skip/invoker.properties
new file mode 100644
index 00000000..44aca986
--- /dev/null
+++ b/src/it/deployfile-release-skip/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.goals=package deploy:deploy-file
diff --git a/src/it/deployfile-release-skip/pom.xml b/src/it/deployfile-release-skip/pom.xml
new file mode 100644
index 00000000..3a02d9af
--- /dev/null
+++ b/src/it/deployfile-release-skip/pom.xml
@@ -0,0 +1,48 @@
+
+
+
+
+
+ 4.0.0
+
+ org.apache.maven.plugins.deploy.its
+ deployfile-release-skip
+ 1.0
+
+
+ Test to verify that skip stops artifact deployment
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-deploy-plugin
+ @project.version@
+
+ 1.0
+ releases
+
+
+
+
+
+
diff --git a/src/it/deployfile-release-skip/test.properties b/src/it/deployfile-release-skip/test.properties
new file mode 100644
index 00000000..28953464
--- /dev/null
+++ b/src/it/deployfile-release-skip/test.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.
+file=target/deployfile-release-skip-1.0.jar
+url=file:target/repo
\ No newline at end of file
diff --git a/src/it/deployfile-release-skip/verify.groovy b/src/it/deployfile-release-skip/verify.groovy
new file mode 100644
index 00000000..c476e408
--- /dev/null
+++ b/src/it/deployfile-release-skip/verify.groovy
@@ -0,0 +1,24 @@
+/*
+ * 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/deployfile-release-skip").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/deployfile-release-skip/pom.xml as pomFile")
diff --git a/src/it/deployfile-skip-fail/invoker.properties b/src/it/deployfile-skip-fail/invoker.properties
new file mode 100644
index 00000000..44aca986
--- /dev/null
+++ b/src/it/deployfile-skip-fail/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.goals=package deploy:deploy-file
diff --git a/src/it/deployfile-skip-fail/pom.xml b/src/it/deployfile-skip-fail/pom.xml
new file mode 100644
index 00000000..ae7aa257
--- /dev/null
+++ b/src/it/deployfile-skip-fail/pom.xml
@@ -0,0 +1,47 @@
+
+
+
+
+
+ 4.0.0
+
+ org.apache.maven.plugins.deploy.its
+ deployfile-skip-fail
+ 1.0
+
+
+ Test to verify that skip stops artifact deployment
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-deploy-plugin
+ @project.version@
+
+ false
+
+
+
+
+
+
diff --git a/src/it/deployfile-skip-fail/test.properties b/src/it/deployfile-skip-fail/test.properties
new file mode 100644
index 00000000..f93ace8d
--- /dev/null
+++ b/src/it/deployfile-skip-fail/test.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.
+file=target/deployfile-skip-fail-1.0.jar
+url=file:target/repo
\ No newline at end of file
diff --git a/src/it/deployfile-skip-fail/verify.groovy b/src/it/deployfile-skip-fail/verify.groovy
new file mode 100644
index 00000000..35e8db1f
--- /dev/null
+++ b/src/it/deployfile-skip-fail/verify.groovy
@@ -0,0 +1,26 @@
+/*
+ * 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/deployfile-skip-fail/1.0/deployfile-skip-fail-1.0.jar").exists()
+File deployedPom = new File(basedir, "target/repo/org/apache/maven/plugins/deploy/its/deployfile-skip-fail/1.0/deployfile-skip-fail-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/deployfile-skip-fail/pom.xml as pomFile")
diff --git a/src/it/deployfile-skip/invoker.properties b/src/it/deployfile-skip/invoker.properties
new file mode 100644
index 00000000..44aca986
--- /dev/null
+++ b/src/it/deployfile-skip/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.goals=package deploy:deploy-file
diff --git a/src/it/deployfile-skip/pom.xml b/src/it/deployfile-skip/pom.xml
new file mode 100644
index 00000000..530a84ec
--- /dev/null
+++ b/src/it/deployfile-skip/pom.xml
@@ -0,0 +1,47 @@
+
+
+
+
+
+ 4.0.0
+
+ org.apache.maven.plugins.deploy.its
+ deployfile-skip
+ 1.0
+
+
+ Test to verify that skip stops artifact deployment
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-deploy-plugin
+ @project.version@
+
+ true
+
+
+
+
+
+
diff --git a/src/it/deployfile-skip/test.properties b/src/it/deployfile-skip/test.properties
new file mode 100644
index 00000000..b1cd0111
--- /dev/null
+++ b/src/it/deployfile-skip/test.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.
+file=target/deployfile-skip-1.0.jar
+url=file:target/repo
\ No newline at end of file
diff --git a/src/it/deployfile-skip/verify.groovy b/src/it/deployfile-skip/verify.groovy
new file mode 100644
index 00000000..618ff5e4
--- /dev/null
+++ b/src/it/deployfile-skip/verify.groovy
@@ -0,0 +1,24 @@
+/*
+ * 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/deployfile-skip").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/deployfile-skip/pom.xml as pomFile")
diff --git a/src/it/deployfile-snapshot-skip-fail/invoker.properties b/src/it/deployfile-snapshot-skip-fail/invoker.properties
new file mode 100644
index 00000000..44aca986
--- /dev/null
+++ b/src/it/deployfile-snapshot-skip-fail/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.goals=package deploy:deploy-file
diff --git a/src/it/deployfile-snapshot-skip-fail/pom.xml b/src/it/deployfile-snapshot-skip-fail/pom.xml
new file mode 100644
index 00000000..aba1a40d
--- /dev/null
+++ b/src/it/deployfile-snapshot-skip-fail/pom.xml
@@ -0,0 +1,48 @@
+
+
+
+
+
+ 4.0.0
+
+ org.apache.maven.plugins.deploy.its
+ deployfile-snapshot-skip-fail
+ 1.0
+
+
+ Test to verify that skip stops artifact deployment
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-deploy-plugin
+ @project.version@
+
+ 1.0-SNAPSHOT
+ releases
+
+
+
+
+
+
diff --git a/src/it/deployfile-snapshot-skip-fail/test.properties b/src/it/deployfile-snapshot-skip-fail/test.properties
new file mode 100644
index 00000000..24b71939
--- /dev/null
+++ b/src/it/deployfile-snapshot-skip-fail/test.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.
+file=target/deployfile-snapshot-skip-fail-1.0.jar
+url=file:target/repo
\ No newline at end of file
diff --git a/src/it/deployfile-snapshot-skip-fail/verify.groovy b/src/it/deployfile-snapshot-skip-fail/verify.groovy
new file mode 100644
index 00000000..21ef0c72
--- /dev/null
+++ b/src/it/deployfile-snapshot-skip-fail/verify.groovy
@@ -0,0 +1,28 @@
+/*
+ * 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 deployedDir = new File(basedir, "target/repo/org/apache/maven/plugins/deploy/its/deployfile-snapshot-skip-fail/1.0-SNAPSHOT")
+assert deployedDir.exists()
+assert deployedDir.isDirectory()
+assert deployedDir.listFiles({ File file, String name -> name.matches("deployfile-snapshot-skip-fail-1\\.0-.*\\.jar") } as FilenameFilter).length == 1
+assert deployedDir.listFiles({ File file, String name -> name.matches("deployfile-snapshot-skip-fail-1\\.0-.*\\.pom") } as FilenameFilter).length == 1
+
+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/deployfile-snapshot-skip-fail/pom.xml as pomFile")
diff --git a/src/it/deployfile-snapshot-skip/invoker.properties b/src/it/deployfile-snapshot-skip/invoker.properties
new file mode 100644
index 00000000..44aca986
--- /dev/null
+++ b/src/it/deployfile-snapshot-skip/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.goals=package deploy:deploy-file
diff --git a/src/it/deployfile-snapshot-skip/pom.xml b/src/it/deployfile-snapshot-skip/pom.xml
new file mode 100644
index 00000000..cbedfd8c
--- /dev/null
+++ b/src/it/deployfile-snapshot-skip/pom.xml
@@ -0,0 +1,48 @@
+
+
+
+
+
+ 4.0.0
+
+ org.apache.maven.plugins.deploy.its
+ deployfile-snapshot-skip
+ 1.0
+
+
+ Test to verify that skip stops artifact deployment
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-deploy-plugin
+ @project.version@
+
+ 1.0-SNAPSHOT
+ snapshots
+
+
+
+
+
+
diff --git a/src/it/deployfile-snapshot-skip/test.properties b/src/it/deployfile-snapshot-skip/test.properties
new file mode 100644
index 00000000..b33c8181
--- /dev/null
+++ b/src/it/deployfile-snapshot-skip/test.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.
+file=target/deployfile-snapshot-skip-1.0.jar
+url=file:target/repo
\ No newline at end of file
diff --git a/src/it/deployfile-snapshot-skip/verify.groovy b/src/it/deployfile-snapshot-skip/verify.groovy
new file mode 100644
index 00000000..ab46c590
--- /dev/null
+++ b/src/it/deployfile-snapshot-skip/verify.groovy
@@ -0,0 +1,24 @@
+/*
+ * 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/deployfile-snapshot-skip").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/deployfile-snapshot-skip/pom.xml as pomFile")
diff --git a/src/it/external-release-jar/test.properties b/src/it/external-release-jar/test.properties
index 1be2c630..c8deb502 100644
--- a/src/it/external-release-jar/test.properties
+++ b/src/it/external-release-jar/test.properties
@@ -18,4 +18,3 @@
file = test-0.1.jar
pomFile = test-0.1.pom
url = file:target/repo
-updateReleaseInfo = true
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/it/mdeploy-45-test/pom.xml b/src/it/mdeploy-45-test/pom.xml
index 4cd030ed..cdefaade 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
+ @mavenResourcesPluginVersion@
+
+
+
+ resources
+
+
+
+ org.apache.maven.pluginsmaven-war-plugin
- 2.0.2
+ @mavenWarPluginVersion@
+
+
+
+ war
+
+
+ ${mdp45.artifact.classifier}
+
+ org.apache.maven.plugins
+ maven-deploy-plugin
+ @project.version@
+
+
+ mine::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..18944b67 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
@@ -48,14 +49,14 @@ under the License.
org.apache.maven.pluginsmaven-antrun-plugin
- 1.1
+ @mavenAntrunPluginVersion@
-
+
-
+
@@ -70,7 +71,7 @@ under the License.
org.apache.maven.pluginsmaven-compiler-plugin
- 2.0.2
+ @mavenCompilerPluginVersion@org.apache.maven.plugins
@@ -80,7 +81,7 @@ under the License.
org.apache.maven.pluginsmaven-jar-plugin
- 2.1
+ @mavenJarPluginVersion@it
@@ -88,17 +89,17 @@ under the License.
org.apache.maven.pluginsmaven-install-plugin
- 2.3
+ @mavenInstallPluginVersion@org.apache.maven.pluginsmaven-resources-plugin
- 2.2
+ @mavenResourcesPluginVersion@org.apache.maven.pluginsmaven-surefire-plugin
- 2.3.1
+ @mavenSurefirePluginVersion@
diff --git a/src/it/no-main-artifact-1/verify.groovy b/src/it/no-main-artifact-1/verify.groovy
new file mode 100644
index 00000000..9442aa7d
--- /dev/null
+++ b/src/it/no-main-artifact-1/verify.groovy
@@ -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.
+ */
+
+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/pom.xml b/src/it/no-main-artifact-2/pom.xml
index e063973c..f9644f9b 100644
--- a/src/it/no-main-artifact-2/pom.xml
+++ b/src/it/no-main-artifact-2/pom.xml
@@ -48,14 +48,14 @@ under the License.
org.apache.maven.pluginsmaven-antrun-plugin
- 1.1
+ @mavenAntrunPluginVersion@
-
+
-
+
@@ -70,7 +70,7 @@ under the License.
org.apache.maven.pluginsmaven-compiler-plugin
- 2.0.2
+ @mavenCompilerPluginVersion@org.apache.maven.plugins
@@ -80,7 +80,7 @@ under the License.
org.apache.maven.pluginsmaven-jar-plugin
- 2.1
+ @mavenJarPluginVersion@it
@@ -88,17 +88,17 @@ under the License.
org.apache.maven.pluginsmaven-install-plugin
- 2.2
+ @mavenInstallPluginVersion@org.apache.maven.pluginsmaven-resources-plugin
- 2.2
+ @mavenResourcesPluginVersion@org.apache.maven.pluginsmaven-surefire-plugin
- 2.3.1
+ @mavenSurefirePluginVersion@
diff --git a/src/it/no-main-artifact-2/verify.groovy b/src/it/no-main-artifact-2/verify.groovy
new file mode 100644
index 00000000..9442aa7d
--- /dev/null
+++ b/src/it/no-main-artifact-2/verify.groovy
@@ -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.
+ */
+
+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..89c4fc99 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
@@ -48,7 +48,14 @@ under the License.
org.apache.maven.pluginsmaven-compiler-plugin
- 2.0.2
+ @mavenCompilerPluginVersion@
+
+
+
+ compile
+
+
+ org.apache.maven.plugins
@@ -58,7 +65,14 @@ under the License.
org.apache.maven.pluginsmaven-jar-plugin
- 2.1
+ @mavenJarPluginVersion@
+
+
+
+ jar
+
+
+ it
@@ -66,17 +80,19 @@ under the License.
org.apache.maven.pluginsmaven-install-plugin
- 2.3
+ @mavenInstallPluginVersion@org.apache.maven.pluginsmaven-resources-plugin
- 2.2
-
-
- org.apache.maven.plugins
- maven-surefire-plugin
- 2.3.1
+ @mavenResourcesPluginVersion@
+
+
+
+ resources
+
+
+
diff --git a/src/it/non-default-pom/non-default-pom.xml b/src/it/non-default-pom/non-default-pom.xml
index 231a7c13..e97b2b9b 100644
--- a/src/it/non-default-pom/non-default-pom.xml
+++ b/src/it/non-default-pom/non-default-pom.xml
@@ -52,12 +52,7 @@ under the License.
org.apache.maven.pluginsmaven-install-plugin
- 2.2
-
-
- org.apache.maven.plugins
- maven-site-plugin
- 2.0-beta-5
+ @mavenInstallPluginVersion@
diff --git a/src/it/offline/pom.xml b/src/it/offline/pom.xml
index c6043142..cdad63cf 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
@@ -48,7 +47,7 @@ under the License.
org.apache.maven.pluginsmaven-compiler-plugin
- 2.0.2
+ @mavenCompilerPluginVersion@org.apache.maven.plugins
@@ -58,22 +57,22 @@ under the License.
org.apache.maven.pluginsmaven-install-plugin
- 2.2
+ @mavenInstallPluginVersion@org.apache.maven.pluginsmaven-jar-plugin
- 2.1
+ @mavenJarPluginVersion@org.apache.maven.pluginsmaven-resources-plugin
- 2.2
+ @mavenResourcesPluginVersion@org.apache.maven.pluginsmaven-surefire-plugin
- 2.3.1
+ @mavenSurefirePluginVersion@
diff --git a/src/it/release-jar/pom.xml b/src/it/release-jar/pom.xml
index a4e0eadc..1d275c9c 100644
--- a/src/it/release-jar/pom.xml
+++ b/src/it/release-jar/pom.xml
@@ -33,14 +33,12 @@ under the License.
true
- trueitfile:///${basedir}/target/repo
- false
@@ -49,7 +47,7 @@ under the License.
org.apache.maven.pluginsmaven-compiler-plugin
- 2.0.2
+ @mavenCompilerPluginVersion@org.apache.maven.plugins
@@ -59,22 +57,22 @@ under the License.
org.apache.maven.pluginsmaven-install-plugin
- 2.2
+ @mavenInstallPluginVersion@org.apache.maven.pluginsmaven-jar-plugin
- 2.1
+ @mavenJarPluginVersion@org.apache.maven.pluginsmaven-resources-plugin
- 2.2
+ @mavenResourcesPluginVersion@org.apache.maven.pluginsmaven-surefire-plugin
- 2.3.1
+ @mavenSurefirePluginVersion@
diff --git a/src/it/release-pom/pom.xml b/src/it/release-pom/pom.xml
index ec19a46f..fe9c110e 100644
--- a/src/it/release-pom/pom.xml
+++ b/src/it/release-pom/pom.xml
@@ -33,14 +33,12 @@ under the License.
true
- trueitfile:///${basedir}/target/repo
- false
@@ -49,7 +47,7 @@ under the License.
org.apache.maven.pluginsmaven-compiler-plugin
- 2.0.2
+ @mavenCompilerPluginVersion@org.apache.maven.plugins
@@ -59,22 +57,17 @@ under the License.
org.apache.maven.pluginsmaven-install-plugin
- 2.2
+ @mavenInstallPluginVersion@org.apache.maven.pluginsmaven-resources-plugin
- 2.2
+ @mavenResourcesPluginVersion@org.apache.maven.pluginsmaven-surefire-plugin
- 2.3.1
-
-
- org.apache.maven.plugins
- maven-site-plugin
- 2.0-beta-5
+ @mavenSurefirePluginVersion@
diff --git a/src/it/setup-mock-phase-maven-plugin/invoker.properties b/src/it/setup-mock-phase-maven-plugin/invoker.properties
new file mode 100644
index 00000000..d5d6ca5d
--- /dev/null
+++ b/src/it/setup-mock-phase-maven-plugin/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 = install
diff --git a/src/it/setup-mock-phase-maven-plugin/pom.xml b/src/it/setup-mock-phase-maven-plugin/pom.xml
new file mode 100644
index 00000000..4ebb8af5
--- /dev/null
+++ b/src/it/setup-mock-phase-maven-plugin/pom.xml
@@ -0,0 +1,57 @@
+
+
+
+
+
+ 4.0.0
+
+ org.apache.maven.its.deploy.mock
+ mock-phase-maven-plugin
+ 1.0
+ maven-plugin
+
+
+ @mavenVersion@
+
+
+ plugin with Maven phase without m-deploy-p
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-install-plugin
+ @mavenInstallPluginVersion@
+
+
+ org.apache.maven.plugins
+ maven-plugin-plugin
+ @mavenPluginToolsVersion@
+
+ true
+
+
+
+
+
+
+
diff --git a/src/it/setup-mock-phase-maven-plugin/src/main/resources/META-INF/plexus/components.xml b/src/it/setup-mock-phase-maven-plugin/src/main/resources/META-INF/plexus/components.xml
new file mode 100644
index 00000000..93e017ca
--- /dev/null
+++ b/src/it/setup-mock-phase-maven-plugin/src/main/resources/META-INF/plexus/components.xml
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
+ org.apache.maven.lifecycle.mapping.LifecycleMapping
+ without-deploy
+ org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping
+
+
+
+ default
+
+ org.apache.maven.plugins:maven-resources-plugin:resources
+
+
+
+
+
+
+
diff --git a/src/it/skip-release-jar/pom.xml b/src/it/skip-release-jar/pom.xml
new file mode 100644
index 00000000..2774462e
--- /dev/null
+++ b/src/it/skip-release-jar/pom.xml
@@ -0,0 +1,83 @@
+
+
+
+
+
+ 4.0.0
+
+ org.apache.maven.its.deploy.srj
+ test
+ 1.0
+ jar
+
+
+ Tests the deployment of a simple release JAR has been skipped.
+
+
+
+ true
+
+
+
+
+ it
+ file:///${basedir}/target/repo
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ @mavenCompilerPluginVersion@
+
+
+ org.apache.maven.plugins
+ maven-deploy-plugin
+ @project.version@
+
+ releases
+
+
+
+ org.apache.maven.plugins
+ maven-install-plugin
+ @mavenInstallPluginVersion@
+
+
+ org.apache.maven.plugins
+ maven-jar-plugin
+ @mavenJarPluginVersion@
+
+
+ org.apache.maven.plugins
+ maven-resources-plugin
+ @mavenResourcesPluginVersion@
+
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+ @mavenSurefirePluginVersion@
+
+
+
+
+
diff --git a/src/it/skip-release-jar/setup.bsh b/src/it/skip-release-jar/setup.bsh
new file mode 100644
index 00000000..bb1b4e86
--- /dev/null
+++ b/src/it/skip-release-jar/setup.bsh
@@ -0,0 +1,33 @@
+/*
+ * 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( localRepositoryPath, "org/apache/maven/its/deploy/srj" );
+System.out.println( "Deleting " + file );
+FileUtils.deleteDirectory( file );
+
+file = new File( basedir, "target/repo" );
+System.out.println( "Deleting " + file );
+FileUtils.deleteDirectory( file );
+
+return true;
diff --git a/src/it/no-main-artifact-1/verify.bsh b/src/it/skip-release-jar/verify.bsh
similarity index 77%
rename from src/it/no-main-artifact-1/verify.bsh
rename to src/it/skip-release-jar/verify.bsh
index c6d7a377..6fe57019 100644
--- a/src/it/no-main-artifact-1/verify.bsh
+++ b/src/it/skip-release-jar/verify.bsh
@@ -22,18 +22,18 @@ 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",
+ "org/apache/maven/its/deploy/srj/test/maven-metadata.xml",
+ "org/apache/maven/its/deploy/srj/test/1.0/test-1.0.pom",
+ "org/apache/maven/its/deploy/srj/test/1.0/test-1.0.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() )
+ if ( file.isFile() )
{
- throw new FileNotFoundException( "Missing: " + file.getAbsolutePath() );
+ throw new FileNotFoundException( "File has been deployed: " + file.getAbsolutePath() );
}
}
diff --git a/src/it/skip-snapshot-jar/pom.xml b/src/it/skip-snapshot-jar/pom.xml
new file mode 100644
index 00000000..a0099041
--- /dev/null
+++ b/src/it/skip-snapshot-jar/pom.xml
@@ -0,0 +1,83 @@
+
+
+
+
+
+ 4.0.0
+
+ org.apache.maven.its.deploy.ssj
+ test
+ 1.0.0-SNAPSHOT
+ jar
+
+
+ Tests the deployment of a simple snapshot JAR has been skipped.
+
+
+
+ true
+
+
+
+
+ it
+ file:///${basedir}/target/repo
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ @mavenCompilerPluginVersion@
+
+
+ org.apache.maven.plugins
+ maven-deploy-plugin
+ @project.version@
+
+ snapshots
+
+
+
+ org.apache.maven.plugins
+ maven-install-plugin
+ @mavenInstallPluginVersion@
+
+
+ org.apache.maven.plugins
+ maven-jar-plugin
+ @mavenJarPluginVersion@
+
+
+ org.apache.maven.plugins
+ maven-resources-plugin
+ @mavenResourcesPluginVersion@
+
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+ @mavenSurefirePluginVersion@
+
+
+
+
+
diff --git a/src/it/skip-snapshot-jar/setup.bsh b/src/it/skip-snapshot-jar/setup.bsh
new file mode 100644
index 00000000..f35751bf
--- /dev/null
+++ b/src/it/skip-snapshot-jar/setup.bsh
@@ -0,0 +1,33 @@
+/*
+ * 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( localRepositoryPath, "org/apache/maven/its/deploy/ssj" );
+System.out.println( "Deleting " + file );
+FileUtils.deleteDirectory( file );
+
+file = new File( basedir, "target/repo" );
+System.out.println( "Deleting " + file );
+FileUtils.deleteDirectory( file );
+
+return true;
diff --git a/src/it/skip-snapshot-jar/verify.bsh b/src/it/skip-snapshot-jar/verify.bsh
new file mode 100644
index 00000000..1c35d56b
--- /dev/null
+++ b/src/it/skip-snapshot-jar/verify.bsh
@@ -0,0 +1,46 @@
+/*
+ * 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/ssj/test/maven-metadata.xml",
+ "org/apache/maven/its/deploy/ssj/test/1.0.0-SNAPSHOT/test-1.0.0-SNAPSHOT.pom",
+ "org/apache/maven/its/deploy/ssj/test/1.0.0-SNAPSHOT/test-1.0.0-SNAPSHOT.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 IllegalStateException( "File has been deployed: " + file.getAbsolutePath() );
+ }
+}
+
+File directory = new File( new File( basedir, "target/repo" ), "org/apache/maven/its/deploy/ssj/test/1.0.0-SNAPSHOT/" );
+if ( directory.exists() )
+{
+ throw new IllegalStateException( "directory exists: " + directory.getAbsolutePath() );
+}
+
+return true;
diff --git a/src/it/skip/pom.xml b/src/it/skip/pom.xml
index 0b50d387..652b3080 100644
--- a/src/it/skip/pom.xml
+++ b/src/it/skip/pom.xml
@@ -42,7 +42,7 @@ under the License.
org.apache.maven.pluginsmaven-compiler-plugin
- 2.0.2
+ @mavenCompilerPluginVersion@org.apache.maven.plugins
@@ -55,22 +55,17 @@ under the License.
org.apache.maven.pluginsmaven-install-plugin
- 2.2
+ @mavenInstallPluginVersion@org.apache.maven.pluginsmaven-resources-plugin
- 2.2
+ @mavenResourcesPluginVersion@org.apache.maven.pluginsmaven-surefire-plugin
- 2.3.1
-
-
- org.apache.maven.plugins
- maven-site-plugin
- 2.0-beta-5
+ @mavenSurefirePluginVersion@
diff --git a/src/it/snapshot-jar/pom.xml b/src/it/snapshot-jar/pom.xml
index bd215e05..899b5832 100644
--- a/src/it/snapshot-jar/pom.xml
+++ b/src/it/snapshot-jar/pom.xml
@@ -47,7 +47,7 @@ under the License.
org.apache.maven.pluginsmaven-compiler-plugin
- 2.0.2
+ @mavenCompilerPluginVersion@org.apache.maven.plugins
@@ -57,22 +57,22 @@ under the License.
org.apache.maven.pluginsmaven-install-plugin
- 2.2
+ @mavenInstallPluginVersion@org.apache.maven.pluginsmaven-jar-plugin
- 2.1
+ @mavenJarPluginVersion@org.apache.maven.pluginsmaven-resources-plugin
- 2.2
+ @mavenResourcesPluginVersion@org.apache.maven.pluginsmaven-surefire-plugin
- 2.3.1
+ @mavenSurefirePluginVersion@
diff --git a/src/it/snapshot-pom/pom.xml b/src/it/snapshot-pom/pom.xml
index 735559d7..5ff795c7 100644
--- a/src/it/snapshot-pom/pom.xml
+++ b/src/it/snapshot-pom/pom.xml
@@ -47,7 +47,7 @@ under the License.
org.apache.maven.pluginsmaven-compiler-plugin
- 2.0.2
+ @mavenCompilerPluginVersion@org.apache.maven.plugins
@@ -57,22 +57,17 @@ under the License.
org.apache.maven.pluginsmaven-install-plugin
- 2.2
+ @mavenInstallPluginVersion@org.apache.maven.pluginsmaven-resources-plugin
- 2.2
+ @mavenResourcesPluginVersion@org.apache.maven.pluginsmaven-surefire-plugin
- 2.3.1
-
-
- org.apache.maven.plugins
- maven-site-plugin
- 2.0-beta-5
+ @mavenSurefirePluginVersion@
diff --git a/src/main/java/org/apache/maven/plugin/deploy/AbstractDeployMojo.java b/src/main/java/org/apache/maven/plugin/deploy/AbstractDeployMojo.java
deleted file mode 100644
index 33478746..00000000
--- a/src/main/java/org/apache/maven/plugin/deploy/AbstractDeployMojo.java
+++ /dev/null
@@ -1,193 +0,0 @@
-package org.apache.maven.plugin.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.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.layout.ArtifactRepositoryLayout;
-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;
-
-/**
- * @version $Id$
- */
-public abstract class AbstractDeployMojo
- extends AbstractMojo
-{
- /**
- */
- @Component
- private ArtifactDeployer deployer;
-
- /**
- * Component used to create an artifact.
- */
- @Component
- protected ArtifactFactory artifactFactory;
-
- /**
- * Component used to create a repository.
- */
- @Component
- ArtifactRepositoryFactory repositoryFactory;
-
- /**
- * Map that contains the layouts.
- */
- @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.
- */
- @Parameter( defaultValue = "${settings.offline}", readonly = true )
- private boolean offline;
-
- /**
- * Parameter used to update the metadata to make the artifact as release.
- */
- @Parameter( property = "updateReleaseInfo", defaultValue = "false" )
- protected boolean updateReleaseInfo;
-
- /**
- * Parameter used to control how many times a failed deployment will be retried before giving up and failing. If a
- * value outside the range 1-10 is specified it will be pulled to the nearest value within the range 1-10.
- *
- * @since 2.7
- */
- @Parameter( property = "retryFailedDeploymentCount", defaultValue = "1" )
- private int retryFailedDeploymentCount;
-
- /* Setters and Getters */
-
- public ArtifactDeployer getDeployer()
- {
- return deployer;
- }
-
- 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
- {
- if ( offline )
- {
- throw new MojoFailureException( "Cannot deploy artifacts when Maven is in offline mode" );
- }
- }
-
- 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;
- }
-
- int getRetryFailedDeploymentCount()
- {
- return retryFailedDeploymentCount;
- }
-
- /**
- * Deploy an artifact from a particular file.
- *
- * @param source the file to deploy
- * @param artifact the artifact definition
- * @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
- */
- protected void deploy( File source, Artifact artifact, ArtifactRepository deploymentRepository,
- ArtifactRepository localRepository, int retryFailedDeploymentCount )
- throws ArtifactDeploymentException
- {
- int retryFailedDeploymentCounter = Math.max( 1, Math.min( 10, retryFailedDeploymentCount ) );
- ArtifactDeploymentException exception = null;
- for ( int count = 0; count < retryFailedDeploymentCounter; count++ )
- {
- try
- {
- if ( count > 0 )
- {
- getLog().info( "Retrying deployment attempt " + ( count + 1 ) + " of " + retryFailedDeploymentCounter );
- }
- getDeployer().deploy( source, artifact, deploymentRepository, localRepository );
- exception = null;
- break;
- }
- catch ( ArtifactDeploymentException 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;
- }
- }
-}
diff --git a/src/main/java/org/apache/maven/plugin/deploy/DeployFileMojo.java b/src/main/java/org/apache/maven/plugin/deploy/DeployFileMojo.java
deleted file mode 100644
index 719e530b..00000000
--- a/src/main/java/org/apache/maven/plugin/deploy/DeployFileMojo.java
+++ /dev/null
@@ -1,610 +0,0 @@
-package org.apache.maven.plugin.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.FileNotFoundException;
-import java.io.IOException;
-import java.io.Reader;
-import java.io.Writer;
-import java.util.List;
-
-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.Model;
-import org.apache.maven.model.Parent;
-import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
-import org.apache.maven.model.io.xpp3.MavenXpp3Writer;
-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.Mojo;
-import org.apache.maven.plugins.annotations.Parameter;
-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.codehaus.plexus.util.FileUtils;
-import org.codehaus.plexus.util.IOUtil;
-import org.codehaus.plexus.util.ReaderFactory;
-import org.codehaus.plexus.util.StringUtils;
-import org.codehaus.plexus.util.WriterFactory;
-import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
-
-/**
- * Installs the artifact in the remote repository.
- *
- * @author Allan Ramirez
- */
-@Mojo( name = "deploy-file", requiresProject = false, threadSafe = true )
-public class DeployFileMojo
- extends AbstractDeployMojo
-{
- /**
- * The default Maven project created when building the plugin
- */
- @Parameter( defaultValue = "${project}", readonly = true, required = true )
- private MavenProject project;
-
- /**
- * Used for attaching the source and javadoc jars to the project.
- */
- @Component
- private MavenProjectHelper projectHelper;
-
- /**
- * GroupId of the artifact to be deployed. Retrieved from POM file if specified.
- */
- @Parameter( property = "groupId" )
- private String groupId;
-
- /**
- * ArtifactId of the artifact to be deployed. Retrieved from POM file if specified.
- */
- @Parameter( property = "artifactId" )
- private String artifactId;
-
- /**
- * Version of the artifact to be deployed. Retrieved from POM file if specified.
- */
- @Parameter( property = "version" )
- private String version;
-
- /**
- * Type of the artifact to be deployed. Retrieved from the <packaging> element of the POM file if a POM file
- * specified. Defaults to the file extension if it is not specified via command line or POM.
- * Maven uses two terms to refer to this datum: the <packaging> element for the entire POM, and the
- * <type> element in a dependency specification.
- */
- @Parameter( property = "packaging" )
- private String packaging;
-
- /**
- * Description passed to a generated POM file (in case of generatePom=true)
- */
- @Parameter( property = "generatePom.description" )
- private String description;
-
- /**
- * File to be deployed.
- */
- @Parameter( property = "file", required = true )
- private File file;
-
- /**
- * The bundled API docs for the artifact.
- *
- * @since 2.6
- */
- @Parameter( property = "javadoc" )
- private File javadoc;
-
- /**
- * The bundled sources for the artifact.
- *
- * @since 2.6
- */
- @Parameter( property = "sources" )
- private File sources;
-
- /**
- * Server Id to map on the <id> under <server> section of settings.xml In most cases, this parameter
- * will be required for authentication.
- */
- @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.
- */
- @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 )
- */
- @Parameter( property = "url", required = true )
- private String url;
-
- /**
- * Location of an existing POM file to be deployed alongside the main artifact, given by the ${file} parameter.
- */
- @Parameter( property = "pomFile" )
- private File pomFile;
-
- /**
- * Upload a POM for this artifact. Will generate a default POM if none is supplied with the pomFile argument.
- */
- @Parameter( property = "generatePom", defaultValue = "true" )
- private boolean generatePom;
-
- /**
- * Add classifier to the artifact
- */
- @Parameter( property = "classifier" )
- private String classifier;
-
- /**
- * Whether to deploy snapshots with a unique version or not.
- */
- @Parameter( property = "uniqueVersion", defaultValue = "true" )
- private boolean uniqueVersion;
-
- /**
- * The component used to validate the user-supplied artifact coordinates.
- */
- @Component
- private ModelValidator modelValidator;
-
- /**
- * A comma separated list of types for each of the extra side artifacts to deploy. If there is a mis-match in the
- * number of entries in {@link #files} or {@link #classifiers}, then an error will be raised.
- */
- @Parameter( property = "types" )
- private String types;
-
- /**
- * A comma separated list of classifiers for each of the extra side artifacts to deploy. If there is a mis-match in
- * the number of entries in {@link #files} or {@link #types}, then an error will be raised.
- */
- @Parameter( property = "classifiers" )
- private String classifiers;
-
- /**
- * A comma separated list of files for each of the extra side artifacts to deploy. If there is a mis-match in the
- * number of entries in {@link #types} or {@link #classifiers}, then an error will be raised.
- */
- @Parameter( property = "files" )
- private String files;
-
- void initProperties()
- throws MojoExecutionException
- {
- // Process the supplied POM (if there is one)
- if ( pomFile != null )
- {
- generatePom = false;
-
- Model model = readModel( pomFile );
-
- processModel( model );
- }
-
- if ( packaging == null && file != null )
- {
- packaging = FileUtils.getExtension( file.getName() );
- }
- }
-
- public void execute()
- throws MojoExecutionException, MojoFailureException
- {
- failIfOffline();
-
- if ( !file.exists() )
- {
- throw new MojoExecutionException( file.getPath() + " not found." );
- }
-
- initProperties();
-
- validateArtifactInformation();
-
- ArtifactRepositoryLayout layout = getLayout( repositoryLayout );
-
- ArtifactRepository deploymentRepository =
- repositoryFactory.createDeploymentArtifactRepository( repositoryId, url, layout, uniqueVersion );
-
- String protocol = deploymentRepository.getProtocol();
-
- if ( StringUtils.isEmpty( protocol ) )
- {
- throw new MojoExecutionException( "No transfer protocol found." );
- }
-
- // Create the artifact
- Artifact artifact =
- artifactFactory.createArtifactWithClassifier( groupId, artifactId, version, packaging, classifier );
-
- if ( file.equals( getLocalRepoFile( artifact ) ) )
- {
- throw new MojoFailureException( "Cannot deploy artifact from the local repository: " + file );
- }
-
- // Upload the POM if requested, generating one if need be
- if ( !"pom".equals( packaging ) )
- {
- if ( pomFile != null )
- {
- ArtifactMetadata metadata = new ProjectArtifactMetadata( artifact, pomFile );
- artifact.addMetadata( metadata );
- }
- else if ( generatePom )
- {
- ArtifactMetadata metadata = new ProjectArtifactMetadata( artifact, generatePomFile() );
- artifact.addMetadata( metadata );
- }
- }
-
- if ( updateReleaseInfo )
- {
- artifact.setRelease( true );
- }
-
- project.setArtifact( artifact );
-
- try
- {
- deploy( file, artifact, deploymentRepository, getLocalRepository(), getRetryFailedDeploymentCount() );
- }
- catch ( ArtifactDeploymentException e )
- {
- throw new MojoExecutionException( e.getMessage(), e );
- }
-
- if ( sources != null )
- {
- projectHelper.attachArtifact( project, "jar", "sources", sources );
- }
-
- if ( javadoc != null )
- {
- projectHelper.attachArtifact( project, "jar", "javadoc", javadoc );
- }
-
- if ( files != null )
- {
- if ( types == null )
- {
- throw new MojoExecutionException( "You must specify 'types' if you specify 'files'" );
- }
- if ( classifiers == null )
- {
- throw new MojoExecutionException( "You must specify 'classifiers' if you specify 'files'" );
- }
- int filesLength = StringUtils.countMatches( files, "," );
- int typesLength = StringUtils.countMatches( types, "," );
- int classifiersLength = StringUtils.countMatches( classifiers, "," );
- if ( typesLength != filesLength )
- {
- throw new MojoExecutionException( "You must specify the same number of entries in 'files' and "
- + "'types' (respectively " + filesLength + " and " + typesLength + " entries )" );
- }
- if ( classifiersLength != filesLength )
- {
- throw new MojoExecutionException( "You must specify the same number of entries in 'files' and "
- + "'classifiers' (respectively " + filesLength + " and " + classifiersLength + " entries )" );
- }
- int fi = 0;
- int ti = 0;
- int ci = 0;
- for ( int i = 0; i <= filesLength; i++ )
- {
- int nfi = files.indexOf( ',', fi );
- if ( nfi == -1 )
- {
- nfi = files.length();
- }
- int nti = types.indexOf( ',', ti );
- if ( nti == -1 )
- {
- nti = types.length();
- }
- int nci = classifiers.indexOf( ',', ci );
- if ( nci == -1 )
- {
- nci = classifiers.length();
- }
- File file = new File( files.substring( fi, nfi ) );
- if ( !file.isFile() )
- {
- // try relative to the project basedir just in case
- file = new File( project.getBasedir(), files.substring( fi, nfi ) );
- }
- if ( file.isFile() )
- {
- if ( StringUtils.isWhitespace( classifiers.substring( ci, nci ) ) )
- {
- projectHelper.attachArtifact( project, types.substring( ti, nti ).trim(), file );
- }
- else
- {
- projectHelper.attachArtifact( project, types.substring( ti, nti ).trim(),
- classifiers.substring( ci, nci ).trim(), file );
- }
- }
- else
- {
- throw new MojoExecutionException( "Specified side artifact " + file + " does not exist" );
- }
- fi = nfi + 1;
- ti = nti + 1;
- ci = nci + 1;
- }
- }
- else
- {
- if ( types != null )
- {
- throw new MojoExecutionException( "You must specify 'files' if you specify 'types'" );
- }
- if ( classifiers != null )
- {
- throw new MojoExecutionException( "You must specify 'files' if you specify 'classifiers'" );
- }
- }
-
- @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 );
- }
- }
-
- }
-
- /**
- * Gets the path of the specified artifact 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 )
- {
- String path = getLocalRepository().pathOf( artifact );
- return new File( getLocalRepository().getBasedir(), path );
- }
-
- /**
- * Process the supplied pomFile to get groupId, artifactId, version, and packaging
- *
- * @param model The POM to extract missing artifact coordinates from, must not be null.
- */
- private void processModel( Model model )
- {
- Parent parent = model.getParent();
-
- if ( this.groupId == null )
- {
- this.groupId = model.getGroupId();
- if ( this.groupId == null && parent != null )
- {
- this.groupId = parent.getGroupId();
- }
- }
- if ( this.artifactId == null )
- {
- this.artifactId = model.getArtifactId();
- }
- if ( this.version == null )
- {
- this.version = model.getVersion();
- if ( this.version == null && parent != null )
- {
- this.version = parent.getVersion();
- }
- }
- if ( this.packaging == null )
- {
- this.packaging = model.getPackaging();
- }
- }
-
- /**
- * Extract the model from the specified POM file.
- *
- * @param pomFile The path of the POM file to parse, must not be null.
- * @return The model from the POM file, never null.
- * @throws MojoExecutionException If the file doesn't exist of cannot be read.
- */
- Model readModel( File pomFile )
- throws MojoExecutionException
- {
- Reader reader = null;
- try
- {
- reader = ReaderFactory.newXmlReader( pomFile );
- return new MavenXpp3Reader().read( reader );
- }
- catch ( FileNotFoundException e )
- {
- throw new MojoExecutionException( "POM not found " + pomFile, e );
- }
- catch ( IOException e )
- {
- throw new MojoExecutionException( "Error reading POM " + pomFile, e );
- }
- catch ( XmlPullParserException e )
- {
- throw new MojoExecutionException( "Error parsing POM " + pomFile, e );
- }
- finally
- {
- IOUtil.close( reader );
- }
- }
-
- /**
- * Generates a minimal POM from the user-supplied artifact information.
- *
- * @return The path to the generated POM file, never null.
- * @throws MojoExecutionException If the generation failed.
- */
- private File generatePomFile()
- throws MojoExecutionException
- {
- Model model = generateModel();
-
- Writer fw = null;
- try
- {
- File tempFile = File.createTempFile( "mvndeploy", ".pom" );
- tempFile.deleteOnExit();
-
- fw = WriterFactory.newXmlWriter( tempFile );
- new MavenXpp3Writer().write( fw, model );
-
- return tempFile;
- }
- catch ( IOException e )
- {
- throw new MojoExecutionException( "Error writing temporary pom file: " + e.getMessage(), e );
- }
- finally
- {
- IOUtil.close( fw );
- }
- }
-
- /**
- * Validates the user-supplied artifact information.
- *
- * @throws MojoExecutionException If any artifact coordinate is invalid.
- */
- private void validateArtifactInformation()
- throws MojoExecutionException
- {
- Model model = generateModel();
-
- ModelValidationResult result = modelValidator.validate( model );
-
- if ( result.getMessageCount() > 0 )
- {
- throw new MojoExecutionException( "The artifact information is incomplete or not valid:\n"
- + result.render( " " ) );
- }
- }
-
- /**
- * Generates a minimal model from the user-supplied artifact information.
- *
- * @return The generated model, never null.
- */
- private Model generateModel()
- {
- Model model = new Model();
-
- model.setModelVersion( "4.0.0" );
-
- model.setGroupId( groupId );
- model.setArtifactId( artifactId );
- model.setVersion( version );
- model.setPackaging( packaging );
-
- model.setDescription( description );
-
- return model;
- }
-
- void setGroupId( String groupId )
- {
- this.groupId = groupId;
- }
-
- void setArtifactId( String artifactId )
- {
- this.artifactId = artifactId;
- }
-
- void setVersion( String version )
- {
- this.version = version;
- }
-
- void setPackaging( String packaging )
- {
- this.packaging = packaging;
- }
-
- void setPomFile( File pomFile )
- {
- this.pomFile = pomFile;
- }
-
- String getGroupId()
- {
- return groupId;
- }
-
- String getArtifactId()
- {
- return artifactId;
- }
-
- String getVersion()
- {
- return version;
- }
-
- String getPackaging()
- {
- return packaging;
- }
-
- File getFile()
- {
- return file;
- }
-
- String getClassifier()
- {
- return classifier;
- }
-
- void setClassifier( String classifier )
- {
- this.classifier = classifier;
- }
-}
diff --git a/src/main/java/org/apache/maven/plugin/deploy/DeployMojo.java b/src/main/java/org/apache/maven/plugin/deploy/DeployMojo.java
deleted file mode 100644
index a70b3db6..00000000
--- a/src/main/java/org/apache/maven/plugin/deploy/DeployMojo.java
+++ /dev/null
@@ -1,349 +0,0 @@
-package org.apache.maven.plugin.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.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;
-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.
- *
- * @author Emmanuel Venisse
- * @author John Casey (refactoring only)
- * @version $Id$
- */
-@Mojo( name = "deploy", defaultPhase = LifecyclePhase.DEPLOY, threadSafe = true )
-public class DeployMojo
- extends AbstractDeployMojo
-{
-
- 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
- * to be deployed
- */
- private static final AtomicInteger readyProjectsCounter = new AtomicInteger();
-
- private static final List deployRequests =
- Collections.synchronizedList( new ArrayList() );
-
- /**
- */
- @Parameter( defaultValue = "${project}", readonly = true, required = true )
- private MavenProject project;
-
- @Parameter( defaultValue = "${reactorProjects}", required = true, readonly = true )
- private List reactorProjects;
-
- /**
- * 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)
- *
- * @since 2.8
- */
- @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> ).
- * Format: id::layout::url
- *
- *
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
- *
- */
- @Parameter( property = "altDeploymentRepository" )
- private String altDeploymentRepository;
-
- /**
- * The alternative repository to use when the project has a snapshot version.
- *
- * @since 2.8
- * @see DeployMojo#altDeploymentRepository
- */
- @Parameter( property = "altSnapshotDeploymentRepository" )
- private String altSnapshotDeploymentRepository;
-
- /**
- * The alternative repository to use when the project has a final version.
- *
- * @since 2.8
- * @see DeployMojo#altDeploymentRepository
- */
- @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
- *
- * @since 2.4
- */
- @Parameter( property = "maven.deploy.skip", defaultValue = "false" )
- private boolean skip;
-
- public void execute()
- throws MojoExecutionException, MojoFailureException
- {
- boolean addedDeployRequest = false;
- if ( skip )
- {
- getLog().info( "Skipping artifact deployment" );
- }
- else
- {
- failIfOffline();
-
- DeployRequest currentExecutionDeployRequest =
- new DeployRequest().setProject( project ).setUpdateReleaseInfo( isUpdateReleaseInfo() ).setRetryFailedDeploymentCount( getRetryFailedDeploymentCount() ).setAltReleaseDeploymentRepository( altReleaseDeploymentRepository ).setAltSnapshotDeploymentRepository( altSnapshotDeploymentRepository ).setAltDeploymentRepository( altDeploymentRepository );
-
- if ( !deployAtEnd )
- {
- deployProject( currentExecutionDeployRequest );
- }
- else
- {
- deployRequests.add( currentExecutionDeployRequest );
- addedDeployRequest = true;
- }
- }
-
- boolean projectsReady = readyProjectsCounter.incrementAndGet() == reactorProjects.size();
- if ( projectsReady )
- {
- synchronized ( deployRequests )
- {
- while ( !deployRequests.isEmpty() )
- {
- deployProject( deployRequests.remove( 0 ) );
- }
- }
- }
- else if ( addedDeployRequest )
- {
- getLog().info( "Deploying " + project.getGroupId() + ":" + project.getArtifactId() + ":"
- + project.getVersion() + " at end" );
- }
- }
-
- private void deployProject( DeployRequest request )
- throws MojoExecutionException, MojoFailureException
- {
- Artifact artifact = request.getProject().getArtifact();
- String packaging = request.getProject().getPackaging();
- File pomFile = request.getProject().getFile();
-
- @SuppressWarnings( "unchecked" )
- 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 )
- {
- ArtifactMetadata metadata = new ProjectArtifactMetadata( artifact, pomFile );
- artifact.addMetadata( metadata );
- }
-
- if ( request.isUpdateReleaseInfo() )
- {
- artifact.setRelease( true );
- }
-
- int retryFailedDeploymentCount = request.getRetryFailedDeploymentCount();
-
- try
- {
- if ( isPomArtifact )
- {
- deploy( pomFile, artifact, repo, getLocalRepository(), retryFailedDeploymentCount );
- }
- else
- {
- File file = artifact.getFile();
-
- if ( file != null && file.isFile() )
- {
- deploy( file, artifact, repo, getLocalRepository(), retryFailedDeploymentCount );
- }
- 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 );
- }
-
- deploy( pomFile, pomArtifact, repo, getLocalRepository(), retryFailedDeploymentCount );
-
- // propagate the timestamped version to the main artifact for the attached artifacts to pick it up
- artifact.setResolvedVersion( pomArtifact.getVersion() );
- }
- else
- {
- String message = "The packaging for this project did not assign a file to the build artifact";
- throw new MojoExecutionException( message );
- }
- }
-
- for ( Artifact attached : attachedArtifacts )
- {
- deploy( attached.getFile(), attached, repo, getLocalRepository(), retryFailedDeploymentCount );
- }
- }
- catch ( ArtifactDeploymentException e )
- {
- throw new MojoExecutionException( e.getMessage(), e );
- }
- }
-
- ArtifactRepository getDeploymentRepository( MavenProject project, String altDeploymentRepository,
- String altReleaseDeploymentRepository,
- String altSnapshotDeploymentRepository )
- throws MojoExecutionException, MojoFailureException
- {
- ArtifactRepository repo = null;
-
- String altDeploymentRepo;
- if ( ArtifactUtils.isSnapshot( project.getVersion() ) && altSnapshotDeploymentRepository != null )
- {
- altDeploymentRepo = altSnapshotDeploymentRepository;
- }
- else if ( !ArtifactUtils.isSnapshot( project.getVersion() ) && altReleaseDeploymentRepository != null )
- {
- altDeploymentRepo = altReleaseDeploymentRepository;
- }
- else
- {
- altDeploymentRepo = altDeploymentRepository;
- }
-
- if ( altDeploymentRepo != null )
- {
- getLog().info( "Using alternate deployment repository " + altDeploymentRepo );
-
- Matcher matcher = ALT_REPO_SYNTAX_PATTERN.matcher( altDeploymentRepo );
-
- if ( !matcher.matches() )
- {
- throw new MojoFailureException( altDeploymentRepo, "Invalid syntax for repository.",
- "Invalid syntax for alternative repository. Use \"id::layout::url\"." );
- }
- else
- {
- String id = matcher.group( 1 ).trim();
- String layout = matcher.group( 2 ).trim();
- String url = matcher.group( 3 ).trim();
-
- ArtifactRepositoryLayout repoLayout = getLayout( layout );
-
- repo = repositoryFactory.createDeploymentArtifactRepository( id, url, repoLayout, true );
- }
- }
-
- if ( repo == null )
- {
- repo = project.getDistributionManagementArtifactRepository();
- }
-
- 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";
-
- throw new MojoExecutionException( msg );
- }
-
- return repo;
- }
-
-}
diff --git a/src/main/java/org/apache/maven/plugin/deploy/DeployRequest.java b/src/main/java/org/apache/maven/plugin/deploy/DeployRequest.java
deleted file mode 100644
index 02e96858..00000000
--- a/src/main/java/org/apache/maven/plugin/deploy/DeployRequest.java
+++ /dev/null
@@ -1,149 +0,0 @@
-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
- * 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.
- */
-
-/**
- *
- * @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/main/java/org/apache/maven/plugins/deploy/AbstractDeployMojo.java b/src/main/java/org/apache/maven/plugins/deploy/AbstractDeployMojo.java
new file mode 100644
index 00000000..d8da6922
--- /dev/null
+++ b/src/main/java/org/apache/maven/plugins/deploy/AbstractDeployMojo.java
@@ -0,0 +1,157 @@
+/*
+ * 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.
+ */
+package org.apache.maven.plugins.deploy;
+
+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.rtinfo.RuntimeInformation;
+import org.eclipse.aether.RepositorySystem;
+import org.eclipse.aether.deployment.DeployRequest;
+import org.eclipse.aether.deployment.DeploymentException;
+import org.eclipse.aether.repository.RemoteRepository;
+import org.eclipse.aether.util.version.GenericVersionScheme;
+import org.eclipse.aether.version.InvalidVersionSpecificationException;
+import org.eclipse.aether.version.Version;
+
+/**
+ * Abstract class for Deploy mojo's.
+ */
+public abstract class AbstractDeployMojo extends AbstractMojo {
+ /**
+ * Flag whether Maven is currently in online/offline mode.
+ */
+ @Parameter(defaultValue = "${settings.offline}", readonly = true)
+ private boolean offline;
+
+ /**
+ * Parameter used to control how many times a failed deployment will be retried before giving up and failing. If a
+ * value outside the range 1-10 is specified it will be pulled to the nearest value within the range 1-10.
+ *
+ * @since 2.7
+ */
+ @Parameter(property = "retryFailedDeploymentCount", defaultValue = "1")
+ private int retryFailedDeploymentCount;
+
+ @Component
+ private RuntimeInformation runtimeInformation;
+
+ @Parameter(defaultValue = "${session}", readonly = true, required = true)
+ protected MavenSession session;
+
+ @Component
+ protected RepositorySystem repositorySystem;
+
+ private static final String AFFECTED_MAVEN_PACKAGING = "maven-plugin";
+
+ private static final String FIXED_MAVEN_VERSION = "3.9.0";
+
+ /* Setters and Getters */
+
+ void failIfOffline() throws MojoFailureException {
+ if (offline) {
+ throw new MojoFailureException("Cannot deploy artifacts when Maven is in offline mode");
+ }
+ }
+
+ /**
+ * If this plugin used in pre-3.9.0 Maven, the packaging {@code maven-plugin} will not deploy G level metadata.
+ */
+ protected void warnIfAffectedPackagingAndMaven(final String packaging) {
+ if (AFFECTED_MAVEN_PACKAGING.equals(packaging)) {
+ try {
+ GenericVersionScheme versionScheme = new GenericVersionScheme();
+ Version fixedMavenVersion = versionScheme.parseVersion(FIXED_MAVEN_VERSION);
+ Version currentMavenVersion = versionScheme.parseVersion(runtimeInformation.getMavenVersion());
+ if (fixedMavenVersion.compareTo(currentMavenVersion) > 0) {
+ getLog().warn("");
+ getLog().warn("You are about to deploy a maven-plugin using Maven " + currentMavenVersion + ".");
+ getLog().warn("This plugin should be used ONLY with Maven 3.9.0 and newer, as MNG-7055");
+ getLog().warn("is fixed in those versions of Maven only!");
+ getLog().warn("");
+ }
+ } catch (InvalidVersionSpecificationException e) {
+ // skip it: Generic does not throw, only API contains this exception
+ }
+ }
+ }
+
+ /**
+ * Creates resolver {@link RemoteRepository} equipped with needed whistles and bells.
+ */
+ protected RemoteRepository getRemoteRepository(final String repositoryId, final String url) {
+ // TODO: RepositorySystem#newDeploymentRepository does this very same thing!
+ RemoteRepository result = new RemoteRepository.Builder(repositoryId, "default", url).build();
+
+ if (result.getAuthentication() == null || result.getProxy() == null) {
+ RemoteRepository.Builder builder = new RemoteRepository.Builder(result);
+
+ if (result.getAuthentication() == null) {
+ builder.setAuthentication(session.getRepositorySession()
+ .getAuthenticationSelector()
+ .getAuthentication(result));
+ }
+
+ if (result.getProxy() == null) {
+ builder.setProxy(
+ session.getRepositorySession().getProxySelector().getProxy(result));
+ }
+
+ result = builder.build();
+ }
+
+ return result;
+ }
+
+ // I'm not sure if retries will work with deploying on client level ...
+ // Most repository managers block a duplicate artifacts.
+
+ // Eg, when we have an artifact list, even simple pom and jar in one request with released version,
+ // next try can fail due to duplicate.
+
+ protected void deploy(DeployRequest deployRequest) throws MojoExecutionException {
+ int retryFailedDeploymentCounter = Math.max(1, Math.min(10, retryFailedDeploymentCount));
+ DeploymentException exception = null;
+ for (int count = 0; count < retryFailedDeploymentCounter; count++) {
+ try {
+ if (count > 0) {
+ getLog().info("Retrying deployment attempt " + (count + 1) + " of " + retryFailedDeploymentCounter);
+ }
+
+ repositorySystem.deploy(session.getRepositorySession(), deployRequest);
+ exception = null;
+ break;
+ } catch (DeploymentException 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 new MojoExecutionException(exception.getMessage(), exception);
+ }
+ }
+}
diff --git a/src/main/java/org/apache/maven/plugins/deploy/DeployFileMojo.java b/src/main/java/org/apache/maven/plugins/deploy/DeployFileMojo.java
new file mode 100644
index 00000000..7e6536f1
--- /dev/null
+++ b/src/main/java/org/apache/maven/plugins/deploy/DeployFileMojo.java
@@ -0,0 +1,585 @@
+/*
+ * 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.
+ */
+package org.apache.maven.plugins.deploy;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.Reader;
+import java.io.Writer;
+import java.nio.file.Files;
+import java.util.Enumeration;
+import java.util.Objects;
+import java.util.jar.JarEntry;
+import java.util.jar.JarFile;
+import java.util.regex.Pattern;
+
+import org.apache.maven.artifact.ArtifactUtils;
+import org.apache.maven.model.Model;
+import org.apache.maven.model.Parent;
+import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
+import org.apache.maven.model.io.xpp3.MavenXpp3Writer;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+import org.codehaus.plexus.util.FileUtils;
+import org.codehaus.plexus.util.IOUtil;
+import org.codehaus.plexus.util.StringUtils;
+import org.codehaus.plexus.util.xml.ReaderFactory;
+import org.codehaus.plexus.util.xml.WriterFactory;
+import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
+import org.eclipse.aether.RepositorySystemSession;
+import org.eclipse.aether.artifact.Artifact;
+import org.eclipse.aether.artifact.ArtifactType;
+import org.eclipse.aether.artifact.DefaultArtifact;
+import org.eclipse.aether.deployment.DeployRequest;
+import org.eclipse.aether.deployment.DeploymentException;
+import org.eclipse.aether.repository.RemoteRepository;
+import org.eclipse.aether.util.artifact.SubArtifact;
+
+/**
+ * Installs the artifact in the remote repository.
+ *
+ * @author Allan Ramirez
+ */
+@Mojo(name = "deploy-file", requiresProject = false, threadSafe = true)
+public class DeployFileMojo extends AbstractDeployMojo {
+ /**
+ * GroupId of the artifact to be deployed. Retrieved from POM file if specified.
+ */
+ @Parameter(property = "groupId")
+ private String groupId;
+
+ /**
+ * ArtifactId of the artifact to be deployed. Retrieved from POM file if specified.
+ */
+ @Parameter(property = "artifactId")
+ private String artifactId;
+
+ /**
+ * Version of the artifact to be deployed. Retrieved from POM file if specified.
+ */
+ @Parameter(property = "version")
+ private String version;
+
+ /**
+ * Type of the artifact to be deployed. Retrieved from the <packaging> element of the POM file if a POM file
+ * specified. Defaults to the file extension if it is not specified via command line or POM.
+ * Maven uses two terms to refer to this datum: the <packaging> element for the entire POM, and the
+ * <type> element in a dependency specification.
+ */
+ @Parameter(property = "packaging")
+ private String packaging;
+
+ /**
+ * Description passed to a generated POM file (in case of generatePom=true)
+ */
+ @Parameter(property = "generatePom.description")
+ private String description;
+
+ /**
+ * File to be deployed.
+ */
+ @Parameter(property = "file", required = true)
+ private File file;
+
+ /**
+ * The bundled API docs for the artifact.
+ *
+ * @since 2.6
+ */
+ @Parameter(property = "javadoc")
+ private File javadoc;
+
+ /**
+ * The bundled sources for the artifact.
+ *
+ * @since 2.6
+ */
+ @Parameter(property = "sources")
+ private File sources;
+
+ /**
+ * Server Id to map on the <id> under <server> section of settings.xml In most cases, this parameter
+ * will be required for authentication.
+ */
+ @Parameter(property = "repositoryId", defaultValue = "remote-repository", required = true)
+ private String repositoryId;
+
+ /**
+ * URL where the artifact will be deployed.
+ * ie ( file:///C:/m2-repo or scp://host.com/path/to/repo )
+ */
+ @Parameter(property = "url", required = true)
+ private String url;
+
+ /**
+ * Location of an existing POM file to be deployed alongside the main artifact, given by the ${file} parameter.
+ */
+ @Parameter(property = "pomFile")
+ private File pomFile;
+
+ /**
+ * Upload a POM for this artifact. Will generate a default POM if none is supplied with the pomFile argument.
+ */
+ @Parameter(property = "generatePom", defaultValue = "true")
+ private boolean generatePom;
+
+ /**
+ * Add classifier to the artifact
+ */
+ @Parameter(property = "classifier")
+ private String classifier;
+
+ /**
+ * A comma separated list of types for each of the extra side artifacts to deploy. If there is a mis-match in the
+ * number of entries in {@link #files} or {@link #classifiers}, then an error will be raised.
+ */
+ @Parameter(property = "types")
+ private String types;
+
+ /**
+ * A comma separated list of classifiers for each of the extra side artifacts to deploy. If there is a mis-match in
+ * the number of entries in {@link #files} or {@link #types}, then an error will be raised.
+ */
+ @Parameter(property = "classifiers")
+ private String classifiers;
+
+ /**
+ * A comma separated list of files for each of the extra side artifacts to deploy. If there is a mis-match in the
+ * number of entries in {@link #types} or {@link #classifiers}, then an error will be raised.
+ */
+ @Parameter(property = "files")
+ private String files;
+
+ /**
+ * Set this to 'true' to bypass artifact deploy
+ * It's not a real boolean as it can have more than 2 values:
+ *
+ *
true: will skip as usual
+ *
releases: will skip if current version of the project is a release
+ *
snapshots: will skip if current version of the project is a snapshot
+ *
any other values will be considered as false
+ *
+ * @since 3.1.0
+ */
+ @Parameter(property = "maven.deploy.file.skip", defaultValue = "false")
+ private String skip = Boolean.FALSE.toString();
+
+ void initProperties() throws MojoExecutionException {
+ if (pomFile == null) {
+ boolean foundPom = false;
+ try (JarFile jarFile = new JarFile(file)) {
+ Pattern pomEntry = Pattern.compile("META-INF/maven/.*/pom\\.xml");
+ 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;
+ String base = file.getName();
+ if (base.indexOf('.') > 0) {
+ base = base.substring(0, base.lastIndexOf('.'));
+ }
+ pomFile = new File(file.getParentFile(), base + ".pom");
+
+ try (InputStream pomInputStream = jarFile.getInputStream(entry)) {
+ try (OutputStream pomOutputStream = Files.newOutputStream(pomFile.toPath())) {
+ IOUtil.copy(pomInputStream, pomOutputStream);
+ }
+ processModel(readModel(pomFile));
+ break;
+ }
+ }
+ }
+
+ if (!foundPom) {
+ getLog().info("pom.xml not found in " + file.getName());
+ }
+ } catch (IOException e) {
+ // ignore, artifact not packaged by Maven
+ }
+ } else {
+ processModel(readModel(pomFile));
+ }
+
+ if (packaging == null && file != null) {
+ packaging = getExtension(file);
+ }
+ }
+
+ public void execute() throws MojoExecutionException, MojoFailureException {
+ if (Boolean.parseBoolean(skip)
+ || ("releases".equals(skip) && !ArtifactUtils.isSnapshot(version))
+ || ("snapshots".equals(skip) && ArtifactUtils.isSnapshot(version))) {
+ getLog().info("Skipping artifact deployment");
+ return;
+ }
+
+ if (!file.exists()) {
+ throw new MojoExecutionException(file.getPath() + " not found.");
+ }
+
+ initProperties();
+
+ RemoteRepository remoteRepository = getRemoteRepository(repositoryId, url);
+
+ if (StringUtils.isEmpty(remoteRepository.getProtocol())) {
+ throw new MojoExecutionException("No transfer protocol found.");
+ }
+
+ if (groupId == null || artifactId == null || version == null || packaging == null) {
+ throw new MojoExecutionException("The artifact information is incomplete: 'groupId', 'artifactId', "
+ + "'version' and 'packaging' are required.");
+ }
+
+ if (!isValidId(groupId) || !isValidId(artifactId) || !isValidVersion(version)) {
+ throw new MojoExecutionException("The artifact information is not valid: uses invalid characters.");
+ }
+
+ failIfOffline();
+ warnIfAffectedPackagingAndMaven(packaging);
+
+ DeployRequest deployRequest = new DeployRequest();
+ deployRequest.setRepository(remoteRepository);
+
+ boolean isFilePom = classifier == null && "pom".equals(packaging);
+ if (!isFilePom) {
+ ArtifactType artifactType =
+ session.getRepositorySession().getArtifactTypeRegistry().get(packaging);
+ if (artifactType != null
+ && (classifier == null || classifier.isEmpty())
+ && !StringUtils.isEmpty(artifactType.getClassifier())) {
+ classifier = artifactType.getClassifier();
+ }
+ }
+ Artifact mainArtifact = new DefaultArtifact(
+ groupId, artifactId, classifier, isFilePom ? "pom" : getExtension(file), version)
+ .setFile(file);
+ deployRequest.addArtifact(mainArtifact);
+
+ File artifactLocalFile = getLocalRepositoryFile(session.getRepositorySession(), mainArtifact);
+
+ if (file.equals(artifactLocalFile)) {
+ throw new MojoFailureException("Cannot deploy artifact from the local repository: " + file);
+ }
+
+ File temporaryPom = null;
+ if (!"pom".equals(packaging)) {
+ if (pomFile != null) {
+ deployRequest.addArtifact(new SubArtifact(mainArtifact, "", "pom", pomFile));
+ } else if (generatePom) {
+ temporaryPom = generatePomFile();
+ getLog().debug("Deploying generated POM");
+ deployRequest.addArtifact(new SubArtifact(mainArtifact, "", "pom", temporaryPom));
+ } else {
+ getLog().debug("Skipping deploying POM");
+ }
+ }
+
+ if (sources != null) {
+ deployRequest.addArtifact(new SubArtifact(mainArtifact, "sources", "jar", sources));
+ }
+
+ if (javadoc != null) {
+ deployRequest.addArtifact(new SubArtifact(mainArtifact, "javadoc", "jar", javadoc));
+ }
+
+ if (files != null) {
+ if (types == null) {
+ throw new MojoExecutionException("You must specify 'types' if you specify 'files'");
+ }
+ if (classifiers == null) {
+ throw new MojoExecutionException("You must specify 'classifiers' if you specify 'files'");
+ }
+ int filesLength = StringUtils.countMatches(files, ",");
+ int typesLength = StringUtils.countMatches(types, ",");
+ int classifiersLength = StringUtils.countMatches(classifiers, ",");
+ if (typesLength != filesLength) {
+ throw new MojoExecutionException("You must specify the same number of entries in 'files' and "
+ + "'types' (respectively " + filesLength + " and " + typesLength + " entries )");
+ }
+ if (classifiersLength != filesLength) {
+ throw new MojoExecutionException("You must specify the same number of entries in 'files' and "
+ + "'classifiers' (respectively " + filesLength + " and " + classifiersLength + " entries )");
+ }
+ int fi = 0;
+ int ti = 0;
+ int ci = 0;
+ for (int i = 0; i <= filesLength; i++) {
+ int nfi = files.indexOf(',', fi);
+ if (nfi == -1) {
+ nfi = files.length();
+ }
+ int nti = types.indexOf(',', ti);
+ if (nti == -1) {
+ nti = types.length();
+ }
+ int nci = classifiers.indexOf(',', ci);
+ if (nci == -1) {
+ nci = classifiers.length();
+ }
+ File file = new File(files.substring(fi, nfi));
+ if (!file.isFile()) {
+ // try relative to the project basedir just in case
+ file = new File(files.substring(fi, nfi));
+ }
+ if (file.isFile()) {
+ String extension = getExtension(file);
+ ArtifactType artifactType = session.getRepositorySession()
+ .getArtifactTypeRegistry()
+ .get(types.substring(ti, nti).trim());
+ if (artifactType != null && !Objects.equals(extension, artifactType.getExtension())) {
+ extension = artifactType.getExtension();
+ }
+
+ deployRequest.addArtifact(new SubArtifact(
+ mainArtifact, classifiers.substring(ci, nci).trim(), extension, file));
+ } else {
+ throw new MojoExecutionException("Specified side artifact " + file + " does not exist");
+ }
+ fi = nfi + 1;
+ ti = nti + 1;
+ ci = nci + 1;
+ }
+ } else {
+ if (types != null) {
+ throw new MojoExecutionException("You must specify 'files' if you specify 'types'");
+ }
+ if (classifiers != null) {
+ throw new MojoExecutionException("You must specify 'files' if you specify 'classifiers'");
+ }
+ }
+
+ try {
+ repositorySystem.deploy(session.getRepositorySession(), deployRequest);
+ } catch (DeploymentException e) {
+ throw new MojoExecutionException(e.getMessage(), e);
+ } finally {
+ if (temporaryPom != null) {
+ // noinspection ResultOfMethodCallIgnored
+ temporaryPom.delete();
+ }
+ }
+ }
+
+ /**
+ * Gets the path of the specified artifact within the local repository. Note that the returned path need not exist
+ * (yet).
+ */
+ private File getLocalRepositoryFile(RepositorySystemSession session, Artifact artifact) {
+ String path = session.getLocalRepositoryManager().getPathForLocalArtifact(artifact);
+ return new File(session.getLocalRepository().getBasedir(), path);
+ }
+
+ /**
+ * Process the supplied pomFile to get groupId, artifactId, version, and packaging
+ *
+ * @param model The POM to extract missing artifact coordinates from, must not be null.
+ */
+ private void processModel(Model model) {
+ Parent parent = model.getParent();
+
+ if (this.groupId == null) {
+ this.groupId = model.getGroupId();
+ if (this.groupId == null && parent != null) {
+ this.groupId = parent.getGroupId();
+ }
+ }
+ if (this.artifactId == null) {
+ this.artifactId = model.getArtifactId();
+ }
+ if (this.version == null) {
+ this.version = model.getVersion();
+ if (this.version == null && parent != null) {
+ this.version = parent.getVersion();
+ }
+ }
+ if (this.packaging == null) {
+ this.packaging = model.getPackaging();
+ }
+ }
+
+ /**
+ * Extract the model from the specified POM file.
+ *
+ * @param pomFile The path of the POM file to parse, must not be null.
+ * @return The model from the POM file, never null.
+ * @throws MojoExecutionException If the file doesn't exist or cannot be read.
+ */
+ Model readModel(File pomFile) throws MojoExecutionException {
+ try (Reader reader = ReaderFactory.newXmlReader(pomFile)) {
+ return new MavenXpp3Reader().read(reader);
+ } catch (FileNotFoundException e) {
+ throw new MojoExecutionException("POM not found " + pomFile, e);
+ } catch (IOException e) {
+ throw new MojoExecutionException("Error reading POM " + pomFile, e);
+ } catch (XmlPullParserException e) {
+ throw new MojoExecutionException("Error parsing POM " + pomFile, e);
+ }
+ }
+
+ /**
+ * Generates a minimal POM from the user-supplied artifact information.
+ *
+ * @return The path to the generated POM file, never null.
+ * @throws MojoExecutionException If the generation failed.
+ */
+ private File generatePomFile() throws MojoExecutionException {
+ Model model = generateModel();
+
+ try {
+ File tempFile = File.createTempFile("mvndeploy", ".pom");
+ tempFile.deleteOnExit();
+
+ try (Writer fw = WriterFactory.newXmlWriter(tempFile)) {
+ new MavenXpp3Writer().write(fw, model);
+ }
+
+ return tempFile;
+ } catch (IOException e) {
+ throw new MojoExecutionException("Error writing temporary pom file: " + e.getMessage(), e);
+ }
+ }
+
+ /**
+ * Generates a minimal model from the user-supplied artifact information.
+ *
+ * @return The generated model, never null.
+ */
+ private Model generateModel() {
+ Model model = new Model();
+
+ model.setModelVersion("4.0.0");
+
+ model.setGroupId(groupId);
+ model.setArtifactId(artifactId);
+ model.setVersion(version);
+ model.setPackaging(packaging);
+
+ model.setDescription(description);
+
+ return model;
+ }
+
+ void setGroupId(String groupId) {
+ this.groupId = groupId;
+ }
+
+ void setArtifactId(String artifactId) {
+ this.artifactId = artifactId;
+ }
+
+ void setVersion(String version) {
+ this.version = version;
+ }
+
+ void setPackaging(String packaging) {
+ this.packaging = packaging;
+ }
+
+ void setPomFile(File pomFile) {
+ this.pomFile = pomFile;
+ }
+
+ String getGroupId() {
+ return groupId;
+ }
+
+ String getArtifactId() {
+ return artifactId;
+ }
+
+ String getVersion() {
+ return version;
+ }
+
+ String getPackaging() {
+ return packaging;
+ }
+
+ File getFile() {
+ return file;
+ }
+
+ String getClassifier() {
+ return classifier;
+ }
+
+ void setClassifier(String classifier) {
+ this.classifier = classifier;
+ }
+
+ // these below should be shared (duplicated in m-install-p, m-deploy-p)
+
+ /**
+ * Specialization of {@link FileUtils#getExtension(String)} that honors various {@code tar.xxx} combinations.
+ */
+ private String getExtension(final File file) {
+ String filename = file.getName();
+ if (filename.contains(".tar.")) {
+ return "tar." + FileUtils.getExtension(filename);
+ } else {
+ return FileUtils.getExtension(filename);
+ }
+ }
+
+ /**
+ * Returns {@code true} if passed in string is "valid Maven ID" (groupId or artifactId).
+ */
+ private boolean isValidId(String id) {
+ if (id == null) {
+ return false;
+ }
+ for (int i = 0; i < id.length(); i++) {
+ char c = id.charAt(i);
+ if (!(c >= 'a' && c <= 'z'
+ || c >= 'A' && c <= 'Z'
+ || c >= '0' && c <= '9'
+ || c == '-'
+ || c == '_'
+ || c == '.')) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ private static final String ILLEGAL_VERSION_CHARS = "\\/:\"<>|?*[](){},";
+
+ /**
+ * Returns {@code true} if passed in string is "valid Maven (simple. non range, expression, etc) version".
+ */
+ private boolean isValidVersion(String version) {
+ if (version == null) {
+ return false;
+ }
+ for (int i = version.length() - 1; i >= 0; i--) {
+ if (ILLEGAL_VERSION_CHARS.indexOf(version.charAt(i)) >= 0) {
+ return false;
+ }
+ }
+ return true;
+ }
+}
diff --git a/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java b/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java
new file mode 100644
index 00000000..79ee1d87
--- /dev/null
+++ b/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java
@@ -0,0 +1,420 @@
+/*
+ * 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.
+ */
+package org.apache.maven.plugins.deploy;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.apache.maven.RepositoryUtils;
+import org.apache.maven.artifact.ArtifactUtils;
+import org.apache.maven.model.Plugin;
+import org.apache.maven.model.PluginExecution;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugin.descriptor.PluginDescriptor;
+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.ProjectArtifact;
+import org.eclipse.aether.artifact.Artifact;
+import org.eclipse.aether.deployment.DeployRequest;
+import org.eclipse.aether.repository.RemoteRepository;
+import org.eclipse.aether.util.artifact.ArtifactIdUtils;
+
+/**
+ * Deploys an artifact to remote repository.
+ *
+ * @author Emmanuel Venisse
+ * @author John Casey (refactoring only)
+ */
+@Mojo(name = "deploy", defaultPhase = LifecyclePhase.DEPLOY, threadSafe = true)
+public class DeployMojo extends AbstractDeployMojo {
+ private static final Pattern ALT_LEGACY_REPO_SYNTAX_PATTERN = Pattern.compile("(.+?)::(.+?)::(.+)");
+
+ private static final Pattern ALT_REPO_SYNTAX_PATTERN = Pattern.compile("(.+?)::(.+)");
+
+ @Parameter(defaultValue = "${project}", readonly = true, required = true)
+ private MavenProject project;
+
+ @Parameter(defaultValue = "${reactorProjects}", required = true, readonly = true)
+ private List reactorProjects;
+
+ @Parameter(defaultValue = "${plugin}", required = true, readonly = true)
+ private PluginDescriptor pluginDescriptor;
+
+ /**
+ * 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.
+ *
+ * @since 2.8
+ */
+ @Parameter(defaultValue = "false", property = "deployAtEnd")
+ private boolean deployAtEnd;
+
+ /**
+ * Specifies an alternative repository to which the project artifacts should be deployed (other than those specified
+ * in <distributionManagement>).
+ * 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: In version 2.x, the format was id::layout::url where layout
+ * could be default (ie. Maven 2) or legacy (ie. Maven 1), but since 3.0.0 the layout part
+ * has been removed because Maven 3 only supports Maven 2 repository layout.
+ */
+ @Parameter(property = "altDeploymentRepository")
+ private String altDeploymentRepository;
+
+ /**
+ * The alternative repository to use when the project has a snapshot version.
+ *
+ * Note: In version 2.x, the format was id::layout::url where layout
+ * could be default (ie. Maven 2) or legacy (ie. Maven 1), but since 3.0.0 the layout part
+ * has been removed because Maven 3 only supports Maven 2 repository layout.
+ * @since 2.8
+ * @see DeployMojo#altDeploymentRepository
+ */
+ @Parameter(property = "altSnapshotDeploymentRepository")
+ private String altSnapshotDeploymentRepository;
+
+ /**
+ * The alternative repository to use when the project has a final version.
+ *
+ * Note: In version 2.x, the format was id::layout::url where layout
+ * could be default (ie. Maven 2) or legacy (ie. Maven 1), but since 3.0.0 the layout part
+ * has been removed because Maven 3 only supports Maven 2 repository layout.
+ * @since 2.8
+ * @see DeployMojo#altDeploymentRepository
+ */
+ @Parameter(property = "altReleaseDeploymentRepository")
+ private String altReleaseDeploymentRepository;
+
+ /**
+ * Set this to 'true' to bypass artifact deploy
+ * Since since 3.0.0-M2 it's not anymore a real boolean as it can have more than 2 values:
+ *
+ *
true: will skip as usual
+ *
releases: will skip if current version of the project is a release
+ *
snapshots: will skip if current version of the project is a snapshot
- [if-any logo]
-
-
-
- [end]
- The currently selected mirror is
- [preferred].
- If you encounter a problem with this mirror,
- please select another mirror.
- If all mirrors are failing, there are
- backup
- mirrors
- (at the end of the mirrors list) that should be available.
-
+
Otherwise, simply use the ready-made binary artifacts from central repository.
It is essential that you verify the integrity of the downloaded file
+ using the checksum (.sha512 file)
+ or using the signature (.asc file) against the public KEYS used by the Apache Maven developers.
-
-
-
-
This is the current stable version of ${project.name}.