diff -Nru maven-antrun-plugin-1.8/.asf.yaml maven-antrun-plugin-3.1.0/.asf.yaml --- maven-antrun-plugin-1.8/.asf.yaml 1970-01-01 00:00:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/.asf.yaml 2022-04-18 19:39:57.000000000 +0000 @@ -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. +# +# see https://s.apache.org/asfyaml +github: + description: "Apache Maven AntRun Plugin" + homepage: https://maven.apache.org/plugins/maven-antrun-plugin/ + labels: + - java + - build-management + - maven-plugins + - maven-antrun-plugin + - maven diff -Nru maven-antrun-plugin-1.8/debian/changelog maven-antrun-plugin-3.1.0/debian/changelog --- maven-antrun-plugin-1.8/debian/changelog 2017-09-19 06:38:48.000000000 +0000 +++ maven-antrun-plugin-3.1.0/debian/changelog 2023-01-11 09:22:32.000000000 +0000 @@ -1,3 +1,16 @@ +maven-antrun-plugin (3.1.0-1) unstable; urgency=medium + + * New upstream release + - Restored the backward compatibility with the version 1.x + - Updated the maven-debian-helper rules + * Depend on libmaven-parent-java + * Standards-Version updated to 4.6.2 + * Switch to debhelper level 13 + * Use salsa.debian.org Vcs-* URLs + * Track and download the new releases from GitHub + + -- Emmanuel Bourg Wed, 11 Jan 2023 10:22:32 +0100 + maven-antrun-plugin (1.8-3) unstable; urgency=medium * Team upload. diff -Nru maven-antrun-plugin-1.8/debian/compat maven-antrun-plugin-3.1.0/debian/compat --- maven-antrun-plugin-1.8/debian/compat 2017-06-20 10:55:19.000000000 +0000 +++ maven-antrun-plugin-3.1.0/debian/compat 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -10 diff -Nru maven-antrun-plugin-1.8/debian/control maven-antrun-plugin-3.1.0/debian/control --- maven-antrun-plugin-1.8/debian/control 2017-09-19 06:32:47.000000000 +0000 +++ maven-antrun-plugin-3.1.0/debian/control 2023-01-10 17:55:36.000000000 +0000 @@ -7,16 +7,19 @@ Emmanuel Bourg Build-Depends: ant (>= 1.8.2), - debhelper (>= 10), + debhelper-compat (= 13), default-jdk, + libeclipse-sisu-maven-plugin-java, + libmaven-parent-java, libmaven-invoker-plugin-java (>= 1.3), libmaven-plugin-tools-java, libmaven3-core-java, + libmodello-maven-plugin-java, libplexus-utils-java, maven-debian-helper -Standards-Version: 4.1.0 -Vcs-Git: https://anonscm.debian.org/git/pkg-java/maven-antrun-plugin.git -Vcs-Browser: https://anonscm.debian.org/cgit/pkg-java/maven-antrun-plugin.git +Standards-Version: 4.6.2 +Vcs-Git: https://salsa.debian.org/java-team/maven-antrun-plugin.git +Vcs-Browser: https://salsa.debian.org/java-team/maven-antrun-plugin Homepage: http://maven.apache.org/plugins/maven-antrun-plugin/ Package: libmaven-antrun-plugin-java diff -Nru maven-antrun-plugin-1.8/debian/libmaven-antrun-plugin-java.poms maven-antrun-plugin-3.1.0/debian/libmaven-antrun-plugin-java.poms --- maven-antrun-plugin-1.8/debian/libmaven-antrun-plugin-java.poms 2017-09-19 06:33:12.000000000 +0000 +++ maven-antrun-plugin-3.1.0/debian/libmaven-antrun-plugin-java.poms 2023-01-10 17:55:36.000000000 +0000 @@ -25,4 +25,4 @@ # --site-xml=: Optional, the location for site.xml if it needs to be installed. # Empty by default. [mh_install] # -pom.xml --no-parent --has-package-version --relocate=org.apache.maven.plugins:maven-antrun-plugin:1.3 +pom.xml --has-package-version --relocate=org.apache.maven.plugins:maven-antrun-plugin:1.3 diff -Nru maven-antrun-plugin-1.8/debian/maven.ignoreRules maven-antrun-plugin-3.1.0/debian/maven.ignoreRules --- maven-antrun-plugin-1.8/debian/maven.ignoreRules 1970-01-01 00:00:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/debian/maven.ignoreRules 2023-01-10 17:58:08.000000000 +0000 @@ -0,0 +1,3 @@ + +org.apache.rat apache-rat-plugin +org.xmlunit * diff -Nru maven-antrun-plugin-1.8/debian/maven.rules maven-antrun-plugin-3.1.0/debian/maven.rules --- maven-antrun-plugin-1.8/debian/maven.rules 2017-07-31 14:50:31.000000000 +0000 +++ maven-antrun-plugin-3.1.0/debian/maven.rules 2023-01-10 17:55:36.000000000 +0000 @@ -3,3 +3,4 @@ s/ant/org.apache.ant/ * * s/.*/debian/ * * org.apache.maven s/maven-project/maven-core/ * s/.*/3.x/ * * org.apache.maven maven-* * s/.*/3.x/ * * +org.apache.maven.plugins maven-plugins pom s/.*/debian/ * * diff -Nru maven-antrun-plugin-1.8/debian/orig-tar.sh maven-antrun-plugin-3.1.0/debian/orig-tar.sh --- maven-antrun-plugin-1.8/debian/orig-tar.sh 2017-06-20 10:55:19.000000000 +0000 +++ maven-antrun-plugin-3.1.0/debian/orig-tar.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ -#!/bin/sh -e - -VERSION=$2 -TAR=../maven-antrun-plugin_$VERSION.orig.tar.xz -DIR=maven-antrun-plugin-$VERSION -TAG=$(echo "maven-antrun-plugin-$VERSION" | sed -re's/~(alpha|beta)/-\1-/') - -svn export http://svn.apache.org/repos/asf/maven/plugins/tags/${TAG} $DIR -XZ_OPT=--best tar -c -J -f $TAR --exclude '*.jar' --exclude '*.class' $DIR -rm -rf $DIR ../$TAG diff -Nru maven-antrun-plugin-1.8/debian/patches/01-backward-compatibility.patch maven-antrun-plugin-3.1.0/debian/patches/01-backward-compatibility.patch --- maven-antrun-plugin-1.8/debian/patches/01-backward-compatibility.patch 1970-01-01 00:00:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/debian/patches/01-backward-compatibility.patch 2023-01-11 09:21:53.000000000 +0000 @@ -0,0 +1,128 @@ +Description: Restores the backward compatibility with the version 1.x + (support the tasks, sourceRoot and testSourceRoot configuration elements) +Author: Emmanuel Bourg +Forwarded: not-needed +--- a/src/main/java/org/apache/maven/plugins/antrun/AntRunMojo.java ++++ b/src/main/java/org/apache/maven/plugins/antrun/AntRunMojo.java +@@ -253,15 +253,18 @@ + public void execute() + throws MojoExecutionException, MojoFailureException + { +- checkDeprecatedParameterUsage( tasks, "tasks", "target" ); +- checkDeprecatedParameterUsage( sourceRoot, "sourceRoot", "the build-helper-maven-plugin" ); +- checkDeprecatedParameterUsage( testSourceRoot, "testSourceRoot", "the build-helper-maven-plugin" ); + if ( skip ) + { + getLog().info( "Skipping Antrun execution" ); + return; + } + ++ if ( tasks != null ) ++ { ++ getLog().warn( "Parameter tasks is deprecated, use target instead" ); ++ target = tasks; ++ } ++ + if ( target == null ) + { + getLog().info( "No Ant target defined - SKIPPED" ); +@@ -322,6 +325,18 @@ + { + throw new MojoExecutionException( "Error executing Ant tasks: " + e.getMessage(), e ); + } ++ ++ if ( sourceRoot != null ) ++ { ++ getLog().info( "Registering compile source root " + sourceRoot ); ++ mavenProject.addCompileSourceRoot( sourceRoot.toString() ); ++ } ++ ++ if ( testSourceRoot != null ) ++ { ++ getLog().info( "Registering compile test source root " + testSourceRoot ); ++ mavenProject.addTestCompileSourceRoot( testSourceRoot.toString() ); ++ } + } + + private void checkDeprecatedParameterUsage( Object parameter, String name, String replacement ) +@@ -481,6 +496,15 @@ + versionsBuffer.append( artifact.getVersion() ).append( File.pathSeparator ); + } + antProject.setProperty( versionsPropertyName, versionsBuffer.toString() ); ++ ++ // Add properties in deprecated format to depenedency artifacts ++ // This should be removed in future versions of the antrun plugin. ++ for ( Artifact artifact : depArtifacts ) ++ { ++ String propName = getDependencyArtifactPropertyName( artifact ); ++ ++ antProject.setProperty( propName, artifact.getFile().getPath() ); ++ } + } + + /** +@@ -516,6 +540,28 @@ + } + + /** ++ * Prefix for legacy property format. ++ * ++ * @deprecated This should only be used for generating the old property format. ++ */ ++ public static final String DEPENDENCY_PREFIX = "maven.dependency."; ++ ++ /** ++ * Returns a property name for a dependency artifact. The name is in the format ++ * maven.dependency.groupId.artifactId[.classifier].type.path ++ * ++ * @param artifact {@link Artifact} ++ * @return property name ++ * @deprecated The dependency conflict ID should be used as the property name. ++ */ ++ public static String getDependencyArtifactPropertyName( Artifact artifact ) ++ { ++ return DEPENDENCY_PREFIX + artifact.getGroupId() + "." + artifact.getArtifactId() ++ + ( artifact.getClassifier() != null ? "." + artifact.getClassifier() : "" ) ++ + ( artifact.getType() != null ? "." + artifact.getType() : "" ) + ".path"; ++ } ++ ++ /** + * @param antProject {@link Project} + */ + public void initMavenTasks( Project antProject ) +--- a/src/main/java/org/apache/maven/plugins/antrun/AntrunXmlPlexusConfigurationWriter.java ++++ b/src/main/java/org/apache/maven/plugins/antrun/AntrunXmlPlexusConfigurationWriter.java +@@ -67,16 +67,16 @@ + serializer.startTag( null, "project" ); + serializer.attribute( null, "name", "maven-antrun-" ); + serializer.attribute( null, "default", antTargetName ); +- write( configuration, serializer ); ++ write( configuration, serializer, true ); + serializer.endTag( null, "project" ); + serializer.endDocument(); + } + } + +- private void write( PlexusConfiguration c, XmlSerializer serializer ) ++ private void write( PlexusConfiguration c, XmlSerializer serializer, boolean target ) + throws IOException + { +- serializer.startTag( null, c.getName() ); ++ serializer.startTag( null, target ? "target" : c.getName() ); + writeAttributes( c, serializer ); + + int count = c.getChildCount(); +@@ -93,11 +93,11 @@ + for ( int i = 0; i < count; i++ ) + { + PlexusConfiguration child = c.getChild( i ); +- write( child, serializer ); ++ write( child, serializer, false ); + } + } + +- serializer.endTag( null, c.getName() ); ++ serializer.endTag( null, target ? "target" : c.getName() ); + } + + private void writeAttributes( PlexusConfiguration c, XmlSerializer serializer ) diff -Nru maven-antrun-plugin-1.8/debian/patches/series maven-antrun-plugin-3.1.0/debian/patches/series --- maven-antrun-plugin-1.8/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/debian/patches/series 2023-01-11 07:09:28.000000000 +0000 @@ -0,0 +1 @@ +01-backward-compatibility.patch diff -Nru maven-antrun-plugin-1.8/debian/rules maven-antrun-plugin-3.1.0/debian/rules --- maven-antrun-plugin-1.8/debian/rules 2017-06-20 10:59:56.000000000 +0000 +++ maven-antrun-plugin-3.1.0/debian/rules 2023-01-10 17:55:36.000000000 +0000 @@ -2,6 +2,3 @@ %: dh $@ - -get-orig-source: - uscan --download-current-version --force-download --rename diff -Nru maven-antrun-plugin-1.8/debian/watch maven-antrun-plugin-3.1.0/debian/watch --- maven-antrun-plugin-1.8/debian/watch 2017-06-20 10:55:19.000000000 +0000 +++ maven-antrun-plugin-3.1.0/debian/watch 2023-01-10 17:55:36.000000000 +0000 @@ -1,4 +1,3 @@ -version=3 -opts="uversionmangle=s/-(alpha|beta)-/~$1/" \ - http://svn.apache.org/repos/asf/maven/plugins/tags/ \ - maven-antrun-plugin-(\d.*)/ debian debian/orig-tar.sh +version=4 +opts="mode=git" \ +https://github.com/apache/maven-antrun-plugin refs/tags/maven-antrun-plugin-([\d.]+) diff -Nru maven-antrun-plugin-1.8/.github/dependabot.yml maven-antrun-plugin-3.1.0/.github/dependabot.yml --- maven-antrun-plugin-1.8/.github/dependabot.yml 1970-01-01 00:00:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/.github/dependabot.yml 2022-04-18 19:39:57.000000000 +0000 @@ -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. +# +# Please see the documentation for all configuration options: +# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates +# +version: 2 +updates: + - package-ecosystem: "maven" + directory: "/" + schedule: + interval: "daily" + ignore: + - dependency-name: org.apache.maven:* + versions: + - "> 3.1.0" diff -Nru maven-antrun-plugin-1.8/.github/pull_request_template.md maven-antrun-plugin-3.1.0/.github/pull_request_template.md --- maven-antrun-plugin-1.8/.github/pull_request_template.md 1970-01-01 00:00:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/.github/pull_request_template.md 2022-04-18 19:39:57.000000000 +0000 @@ -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/MANTRUN) 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 `[MANTRUN-XXX] - Fixes bug in ApproximateQuantiles`, + where you replace `MANTRUN-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 -Nru maven-antrun-plugin-1.8/.github/workflows/maven-verify.yml maven-antrun-plugin-3.1.0/.github/workflows/maven-verify.yml --- maven-antrun-plugin-1.8/.github/workflows/maven-verify.yml 1970-01-01 00:00:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/.github/workflows/maven-verify.yml 2022-04-18 19:39:57.000000000 +0000 @@ -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. + +name: Verify + +on: + push: + pull_request: + +jobs: + build: + name: Verify + uses: apache/maven-gh-actions-shared/.github/workflows/maven-verify.yml@v2 + + diff -Nru maven-antrun-plugin-1.8/.gitignore maven-antrun-plugin-3.1.0/.gitignore --- maven-antrun-plugin-1.8/.gitignore 1970-01-01 00:00:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/.gitignore 2022-04-18 19:39:57.000000000 +0000 @@ -0,0 +1,16 @@ +target/ +.project +.classpath +.settings/ +.svn/ +bin/ +# Intellij +*.ipr +*.iml +.idea +out/ +.DS_Store +/bootstrap +/dependencies.xml +.java-version +.checkstyle diff -Nru maven-antrun-plugin-1.8/Jenkinsfile maven-antrun-plugin-3.1.0/Jenkinsfile --- maven-antrun-plugin-1.8/Jenkinsfile 1970-01-01 00:00:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/Jenkinsfile 2022-04-18 19:39:57.000000000 +0000 @@ -0,0 +1,20 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +asfMavenTlpPlgnBuild() diff -Nru maven-antrun-plugin-1.8/pom.xml maven-antrun-plugin-3.1.0/pom.xml --- maven-antrun-plugin-1.8/pom.xml 2014-12-20 14:29:44.000000000 +0000 +++ maven-antrun-plugin-3.1.0/pom.xml 2022-04-18 19:39:57.000000000 +0000 @@ -25,12 +25,12 @@ maven-plugins org.apache.maven.plugins - 27 - ../maven-plugins/pom.xml + 34 + maven-antrun-plugin - 1.8 + 3.1.0 maven-plugin Apache Maven AntRun Plugin @@ -41,23 +41,32 @@ - scm:svn:http://svn.apache.org/repos/asf/maven/plugins/tags/maven-antrun-plugin-1.8 - scm:svn:https://svn.apache.org/repos/asf/maven/plugins/tags/maven-antrun-plugin-1.8 - http://svn.apache.org/viewvc/maven/plugins/tags/maven-antrun-plugin-1.8 + scm:git:https://gitbox.apache.org/repos/asf/maven-antrun-plugin.git + scm:git:https://gitbox.apache.org/repos/asf/maven-antrun-plugin.git + https://github.com/apache/maven-antrun-plugin/tree/${project.scm.tag} + maven-antrun-plugin-3.1.0 jira - http://jira.codehaus.org/browse/MANTRUN + https://issues.apache.org/jira/browse/MANTRUN + + Jenkins + https://ci-maven.apache.org/job/Maven/job/maven-box/job/maven-antrun-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.5 + 8 + 2.22.2 + 3.6.4 + 2022-04-18T19:39:44Z @@ -65,16 +74,19 @@ org.apache.maven maven-plugin-api ${mavenVersion} + provided org.apache.maven - maven-project + maven-core ${mavenVersion} + provided org.apache.maven maven-artifact ${mavenVersion} + provided org.apache.maven.plugin-tools @@ -84,12 +96,160 @@ org.codehaus.plexus plexus-utils - 3.0.20 + 3.4.1 org.apache.ant ant - 1.9.4 + 1.10.12 + + + + org.junit.jupiter + junit-jupiter-engine + 5.8.2 + test + + + org.xmlunit + xmlunit-core + 2.8.4 + test + + + org.xmlunit + xmlunit-matchers + 2.8.4 + test + + + + + + org.apache.rat + apache-rat-plugin + + + src/test/resources/configuration-writer/*.xml + src/it/*/*.json + + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.0.0 + + + org.codehaus.mojo + extra-enforcer-rules + 1.5.1 + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.3.1 + + + + + + org.apache.maven.plugins + maven-plugin-plugin + ${mavenPluginToolsVersion} + + + org.apache.maven.plugins + maven-site-plugin + 3.10.0 + + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 3.1.2 + + + maven-checkstyle-plugin + 3.1.2 + + + com.puppycrawl.tools + checkstyle + 9.3 + + + org.apache.maven.shared + maven-shared-resources + 4 + + + + + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.0.0 + + + org.codehaus.mojo + extra-enforcer-rules + 1.5.1 + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + https://ant.apache.org/manual/api/ + + + + + org.codehaus.modello + modello-maven-plugin + 1.11 + + + src/main/mdo/antrun.mdo + + 1.0.0 + + + + sources + generate-sources + + java + + + + + + + + + + + + + + + + + + + + + + + diff -Nru maven-antrun-plugin-1.8/README.md maven-antrun-plugin-3.1.0/README.md --- maven-antrun-plugin-1.8/README.md 1970-01-01 00:00:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/README.md 2022-04-18 19:39:57.000000000 +0000 @@ -0,0 +1,100 @@ + +Contributing to [Apache Maven AntRun Plugin](https://maven.apache.org/plugins/maven-antrun-plugin/) +====================== + +[![ASF Jira](https://img.shields.io/endpoint?url=https%3A%2F%2Fmaven.apache.org%2Fbadges%2Fasf_jira-MANTRUN.json)][jira] +[![Apache License, Version 2.0, January 2004](https://img.shields.io/github/license/apache/maven.svg?label=License)][license] +[![Maven Central](https://img.shields.io/maven-central/v/org.apache.maven.plugins/maven-antrun-plugin.svg?label=Maven%20Central)](https://search.maven.org/artifact/org.apache.maven.plugins/maven-antrun-plugin) +[![Reproducible Builds](https://img.shields.io/badge/Reproducible_Builds-ok-green?labelColor=blue)](https://github.com/jvm-repo-rebuild/reproducible-central#org.apache.maven.plugins:maven-antrun-plugin) +[![Jenkins Status](https://img.shields.io/jenkins/s/https/ci-maven.apache.org/job/Maven/job/maven-box/job/maven-antrun-plugin/job/master.svg?)][build] +[![Jenkins tests](https://img.shields.io/jenkins/t/https/ci-maven.apache.org/job/Maven/job/maven-box/job/maven-antrun-plugin/job/master.svg?)][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. +``` +[MANTRUN-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 AntRun Plugin 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/MANTRUN/ +[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-antrun-plugin/job/master/lastCompletedBuild/testReport/ +[build]: https://ci-maven.apache.org/job/Maven/job/maven-box/job/maven-antrun-plugin/job/master/ diff -Nru maven-antrun-plugin-1.8/src/it/ant-1.7-features/pom.xml maven-antrun-plugin-3.1.0/src/it/ant-1.7-features/pom.xml --- maven-antrun-plugin-1.8/src/it/ant-1.7-features/pom.xml 2013-08-27 20:31:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/it/ant-1.7-features/pom.xml 2022-04-18 19:39:57.000000000 +0000 @@ -37,11 +37,11 @@ test - + - + run @@ -50,5 +50,51 @@ + + + + + org.apache.maven.plugins + maven-clean-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-site-plugin + 3.7.1 + + + + org.apache.maven.plugins + maven-resources-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-compiler-plugin + 3.7.0 + + + org.apache.maven.plugins + maven-surefire-plugin + 2.12 + + + org.apache.maven.plugins + maven-jar-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-install-plugin + 2.5.2 + + + org.apache.maven.plugins + maven-deploy-plugin + 2.8.2 + + + diff -Nru maven-antrun-plugin-1.8/src/it/antrun-default-test/pom.xml maven-antrun-plugin-3.1.0/src/it/antrun-default-test/pom.xml --- maven-antrun-plugin-1.8/src/it/antrun-default-test/pom.xml 2014-10-09 20:40:31.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/it/antrun-default-test/pom.xml 2022-04-18 19:39:57.000000000 +0000 @@ -32,9 +32,9 @@ http://maven.apache.org - junit - junit - 3.8.2 + org.junit.jupiter + junit-jupiter-engine + 5.7.2 test @@ -45,11 +45,57 @@ maven-antrun-plugin @pom.version@ - + - + + + + + + org.apache.maven.plugins + maven-clean-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-site-plugin + 3.7.1 + + + + org.apache.maven.plugins + maven-resources-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-compiler-plugin + 3.7.0 + + + org.apache.maven.plugins + maven-surefire-plugin + 2.12 + + + org.apache.maven.plugins + maven-jar-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-install-plugin + 2.5.2 + + + org.apache.maven.plugins + maven-deploy-plugin + 2.8.2 + + + diff -Nru maven-antrun-plugin-1.8/src/it/attach-artifact-from-ant-task/build.xml maven-antrun-plugin-3.1.0/src/it/attach-artifact-from-ant-task/build.xml --- maven-antrun-plugin-1.8/src/it/attach-artifact-from-ant-task/build.xml 1970-01-01 00:00:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/it/attach-artifact-from-ant-task/build.xml 2022-04-18 19:39:57.000000000 +0000 @@ -0,0 +1,26 @@ + + + + + + + + + diff -Nru maven-antrun-plugin-1.8/src/it/attach-artifact-from-ant-task/invoker.properties maven-antrun-plugin-3.1.0/src/it/attach-artifact-from-ant-task/invoker.properties --- maven-antrun-plugin-1.8/src/it/attach-artifact-from-ant-task/invoker.properties 1970-01-01 00:00:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/it/attach-artifact-from-ant-task/invoker.properties 2022-04-18 19:39:57.000000000 +0000 @@ -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=clean install diff -Nru maven-antrun-plugin-1.8/src/it/attach-artifact-from-ant-task/pom.xml maven-antrun-plugin-3.1.0/src/it/attach-artifact-from-ant-task/pom.xml --- maven-antrun-plugin-1.8/src/it/attach-artifact-from-ant-task/pom.xml 1970-01-01 00:00:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/it/attach-artifact-from-ant-task/pom.xml 2022-04-18 19:39:57.000000000 +0000 @@ -0,0 +1,103 @@ + + + + + + 4.0.0 + org.apache.maven.plugins.antrun + attach-artifact-from-ant-task + 1.0 + pom + https://issues.apache.org/jira/browse/MANTRUN-181 + + Checks that the attachartifact built-in task works correctly when invoked from an external Ant build through the + ant task. + + + + + maven-antrun-plugin + @pom.version@ + + + call-build + compile + + run + + + + + + + + + + + + + + + + org.apache.maven.plugins + maven-clean-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-site-plugin + 3.7.1 + + + + org.apache.maven.plugins + maven-resources-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-compiler-plugin + 3.7.0 + + + org.apache.maven.plugins + maven-surefire-plugin + 2.12 + + + org.apache.maven.plugins + maven-jar-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-install-plugin + 2.5.2 + + + org.apache.maven.plugins + maven-deploy-plugin + 2.8.2 + + + + + diff -Nru maven-antrun-plugin-1.8/src/it/attach-artifact-from-ant-task/test.txt maven-antrun-plugin-3.1.0/src/it/attach-artifact-from-ant-task/test.txt --- maven-antrun-plugin-1.8/src/it/attach-artifact-from-ant-task/test.txt 1970-01-01 00:00:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/it/attach-artifact-from-ant-task/test.txt 2022-04-18 19:39:57.000000000 +0000 @@ -0,0 +1,16 @@ +# 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. \ No newline at end of file diff -Nru maven-antrun-plugin-1.8/src/it/attach-artifact-from-ant-task/verify.bsh maven-antrun-plugin-3.1.0/src/it/attach-artifact-from-ant-task/verify.bsh --- maven-antrun-plugin-1.8/src/it/attach-artifact-from-ant-task/verify.bsh 1970-01-01 00:00:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/it/attach-artifact-from-ant-task/verify.bsh 2022-04-18 19:39:57.000000000 +0000 @@ -0,0 +1,37 @@ + +/* + * 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.*; + +String[] expectedFiles = { + "org/apache/maven/plugins/antrun/attach-artifact-from-ant-task/1.0/attach-artifact-from-ant-task-1.0.pom", + "org/apache/maven/plugins/antrun/attach-artifact-from-ant-task/1.0/attach-artifact-from-ant-task-1.0-from-pom.txt", + "org/apache/maven/plugins/antrun/attach-artifact-from-ant-task/1.0/attach-artifact-from-ant-task-1.0-from-build.txt" +}; + +for ( String expectedFile : expectedFiles ) +{ + File file = new File( localRepositoryPath, expectedFile ); + System.out.println( "Checking for existence of " + file ); + if ( !file.isFile() ) + { + throw new Exception( "Missing file " + file ); + } +} diff -Nru maven-antrun-plugin-1.8/src/it/attach-artifact-test/pom.xml maven-antrun-plugin-3.1.0/src/it/attach-artifact-test/pom.xml --- maven-antrun-plugin-1.8/src/it/attach-artifact-test/pom.xml 2013-08-27 20:31:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/it/attach-artifact-test/pom.xml 2022-04-18 19:39:57.000000000 +0000 @@ -44,18 +44,64 @@ run - + - + + + + + + org.apache.maven.plugins + maven-clean-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-site-plugin + 3.7.1 + + + + org.apache.maven.plugins + maven-resources-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-compiler-plugin + 3.7.0 + + + org.apache.maven.plugins + maven-surefire-plugin + 2.12 + + + org.apache.maven.plugins + maven-jar-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-install-plugin + 2.5.2 + + + org.apache.maven.plugins + maven-deploy-plugin + 2.8.2 + + + diff -Nru maven-antrun-plugin-1.8/src/it/attach-artifact-test-with-prefix-antlib/invoker.properties maven-antrun-plugin-3.1.0/src/it/attach-artifact-test-with-prefix-antlib/invoker.properties --- maven-antrun-plugin-1.8/src/it/attach-artifact-test-with-prefix-antlib/invoker.properties 1970-01-01 00:00:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/it/attach-artifact-test-with-prefix-antlib/invoker.properties 2022-04-18 19:39:57.000000000 +0000 @@ -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=clean install diff -Nru maven-antrun-plugin-1.8/src/it/attach-artifact-test-with-prefix-antlib/pom.xml maven-antrun-plugin-3.1.0/src/it/attach-artifact-test-with-prefix-antlib/pom.xml --- maven-antrun-plugin-1.8/src/it/attach-artifact-test-with-prefix-antlib/pom.xml 1970-01-01 00:00:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/it/attach-artifact-test-with-prefix-antlib/pom.xml 2022-04-18 19:39:57.000000000 +0000 @@ -0,0 +1,97 @@ + + + + + + 4.0.0 + org.apache.maven.plugins.antrun + attach-artifact-test-with-prefix + 1.0 + pom + + + + maven-antrun-plugin + @pom.version@ + + + call-build + compile + + run + + + + + + + + + + + + + + + org.apache.maven.plugins + maven-clean-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-site-plugin + 3.7.1 + + + + org.apache.maven.plugins + maven-resources-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-compiler-plugin + 3.7.0 + + + org.apache.maven.plugins + maven-surefire-plugin + 2.12 + + + org.apache.maven.plugins + maven-jar-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-install-plugin + 2.5.2 + + + org.apache.maven.plugins + maven-deploy-plugin + 2.8.2 + + + + + diff -Nru maven-antrun-plugin-1.8/src/it/attach-artifact-test-with-prefix-antlib/test.txt maven-antrun-plugin-3.1.0/src/it/attach-artifact-test-with-prefix-antlib/test.txt --- maven-antrun-plugin-1.8/src/it/attach-artifact-test-with-prefix-antlib/test.txt 1970-01-01 00:00:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/it/attach-artifact-test-with-prefix-antlib/test.txt 2022-04-18 19:39:57.000000000 +0000 @@ -0,0 +1,16 @@ +# 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. \ No newline at end of file diff -Nru maven-antrun-plugin-1.8/src/it/attach-artifact-test-with-prefix-antlib/verify.bsh maven-antrun-plugin-3.1.0/src/it/attach-artifact-test-with-prefix-antlib/verify.bsh --- maven-antrun-plugin-1.8/src/it/attach-artifact-test-with-prefix-antlib/verify.bsh 1970-01-01 00:00:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/it/attach-artifact-test-with-prefix-antlib/verify.bsh 2022-04-18 19:39:57.000000000 +0000 @@ -0,0 +1,36 @@ + +/* + * 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.*; + +String[] expectedFiles = { + "org/apache/maven/plugins/antrun/attach-artifact-test-with-prefix/1.0/attach-artifact-test-with-prefix-1.0.pom", + "org/apache/maven/plugins/antrun/attach-artifact-test-with-prefix/1.0/attach-artifact-test-with-prefix-1.0-cl.txt" +}; + +for ( String expectedFile : expectedFiles ) +{ + File file = new File( localRepositoryPath, expectedFile ); + System.out.println( "Checking for existence of " + file ); + if ( !file.isFile() ) + { + throw new Exception( "Missing file " + file ); + } +} diff -Nru maven-antrun-plugin-1.8/src/it/attach-artifact-test-with-prefix-antrun/invoker.properties maven-antrun-plugin-3.1.0/src/it/attach-artifact-test-with-prefix-antrun/invoker.properties --- maven-antrun-plugin-1.8/src/it/attach-artifact-test-with-prefix-antrun/invoker.properties 1970-01-01 00:00:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/it/attach-artifact-test-with-prefix-antrun/invoker.properties 2022-04-18 19:39:57.000000000 +0000 @@ -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=clean install diff -Nru maven-antrun-plugin-1.8/src/it/attach-artifact-test-with-prefix-antrun/pom.xml maven-antrun-plugin-3.1.0/src/it/attach-artifact-test-with-prefix-antrun/pom.xml --- maven-antrun-plugin-1.8/src/it/attach-artifact-test-with-prefix-antrun/pom.xml 1970-01-01 00:00:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/it/attach-artifact-test-with-prefix-antrun/pom.xml 2022-04-18 19:39:57.000000000 +0000 @@ -0,0 +1,52 @@ + + + + + + 4.0.0 + org.apache.maven.plugins.antrun + attach-artifact-test-with-prefix + 1.0 + pom + + + + maven-antrun-plugin + @pom.version@ + + + call-build + compile + + run + + + + + + + + + + + + diff -Nru maven-antrun-plugin-1.8/src/it/attach-artifact-test-with-prefix-antrun/test.txt maven-antrun-plugin-3.1.0/src/it/attach-artifact-test-with-prefix-antrun/test.txt --- maven-antrun-plugin-1.8/src/it/attach-artifact-test-with-prefix-antrun/test.txt 1970-01-01 00:00:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/it/attach-artifact-test-with-prefix-antrun/test.txt 2022-04-18 19:39:57.000000000 +0000 @@ -0,0 +1,16 @@ +# 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. \ No newline at end of file diff -Nru maven-antrun-plugin-1.8/src/it/attach-artifact-test-with-prefix-antrun/verify.bsh maven-antrun-plugin-3.1.0/src/it/attach-artifact-test-with-prefix-antrun/verify.bsh --- maven-antrun-plugin-1.8/src/it/attach-artifact-test-with-prefix-antrun/verify.bsh 1970-01-01 00:00:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/it/attach-artifact-test-with-prefix-antrun/verify.bsh 2022-04-18 19:39:57.000000000 +0000 @@ -0,0 +1,36 @@ + +/* + * 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.*; + +String[] expectedFiles = { + "org/apache/maven/plugins/antrun/attach-artifact-test-with-prefix/1.0/attach-artifact-test-with-prefix-1.0.pom", + "org/apache/maven/plugins/antrun/attach-artifact-test-with-prefix/1.0/attach-artifact-test-with-prefix-1.0-cl.txt" +}; + +for ( String expectedFile : expectedFiles ) +{ + File file = new File( localRepositoryPath, expectedFile ); + System.out.println( "Checking for existence of " + file ); + if ( !file.isFile() ) + { + throw new Exception( "Missing file " + file ); + } +} diff -Nru maven-antrun-plugin-1.8/src/it/attach-artifact-test-with-prefix-unknown/invoker.properties maven-antrun-plugin-3.1.0/src/it/attach-artifact-test-with-prefix-unknown/invoker.properties --- maven-antrun-plugin-1.8/src/it/attach-artifact-test-with-prefix-unknown/invoker.properties 1970-01-01 00:00:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/it/attach-artifact-test-with-prefix-unknown/invoker.properties 2022-04-18 19:39:57.000000000 +0000 @@ -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. + +invoker.goals = clean install +invoker.buildResult = failure diff -Nru maven-antrun-plugin-1.8/src/it/attach-artifact-test-with-prefix-unknown/pom.xml maven-antrun-plugin-3.1.0/src/it/attach-artifact-test-with-prefix-unknown/pom.xml --- maven-antrun-plugin-1.8/src/it/attach-artifact-test-with-prefix-unknown/pom.xml 1970-01-01 00:00:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/it/attach-artifact-test-with-prefix-unknown/pom.xml 2022-04-18 19:39:57.000000000 +0000 @@ -0,0 +1,98 @@ + + + + + + 4.0.0 + org.apache.maven.plugins.antrun + attach-artifact-test-with-prefix-unknown + 1.0 + pom + + + + maven-antrun-plugin + @pom.version@ + + + call-build + compile + + run + + + mvn + + + + + + + + + + + + + org.apache.maven.plugins + maven-clean-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-site-plugin + 3.7.1 + + + + org.apache.maven.plugins + maven-resources-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-compiler-plugin + 3.7.0 + + + org.apache.maven.plugins + maven-surefire-plugin + 2.12 + + + org.apache.maven.plugins + maven-jar-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-install-plugin + 2.5.2 + + + org.apache.maven.plugins + maven-deploy-plugin + 2.8.2 + + + + + diff -Nru maven-antrun-plugin-1.8/src/it/attach-artifact-test-with-prefix-unknown/test.txt maven-antrun-plugin-3.1.0/src/it/attach-artifact-test-with-prefix-unknown/test.txt --- maven-antrun-plugin-1.8/src/it/attach-artifact-test-with-prefix-unknown/test.txt 1970-01-01 00:00:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/it/attach-artifact-test-with-prefix-unknown/test.txt 2022-04-18 19:39:57.000000000 +0000 @@ -0,0 +1,16 @@ +# 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. \ No newline at end of file diff -Nru maven-antrun-plugin-1.8/src/it/classpath-ref-test/pom.xml maven-antrun-plugin-3.1.0/src/it/classpath-ref-test/pom.xml --- maven-antrun-plugin-1.8/src/it/classpath-ref-test/pom.xml 2013-08-27 20:31:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/it/classpath-ref-test/pom.xml 2022-04-18 19:39:57.000000000 +0000 @@ -32,9 +32,9 @@ - junit - junit - 3.8.2 + org.junit.jupiter + junit-jupiter-engine + 5.7.2 @@ -49,8 +49,7 @@ compile compile - target/generated/src/main/java - + @@ -67,7 +66,7 @@ - + run @@ -76,6 +75,52 @@ + + + + + org.apache.maven.plugins + maven-clean-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-site-plugin + 3.7.1 + + + + org.apache.maven.plugins + maven-resources-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-compiler-plugin + 3.7.0 + + + org.apache.maven.plugins + maven-surefire-plugin + 2.12 + + + org.apache.maven.plugins + maven-jar-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-install-plugin + 2.5.2 + + + org.apache.maven.plugins + maven-deploy-plugin + 2.8.2 + + + diff -Nru maven-antrun-plugin-1.8/src/it/classpath-test-scope-test/pom.xml maven-antrun-plugin-3.1.0/src/it/classpath-test-scope-test/pom.xml --- maven-antrun-plugin-1.8/src/it/classpath-test-scope-test/pom.xml 2013-08-27 20:31:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/it/classpath-test-scope-test/pom.xml 2022-04-18 19:39:57.000000000 +0000 @@ -32,9 +32,9 @@ - junit - junit - 3.8.2 + org.junit.jupiter + junit-jupiter-engine + 5.7.2 test @@ -48,7 +48,7 @@ test - + ${test.classpath} @@ -58,7 +58,7 @@ - + run @@ -67,6 +67,52 @@ + + + + + org.apache.maven.plugins + maven-clean-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-site-plugin + 3.7.1 + + + + org.apache.maven.plugins + maven-resources-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-compiler-plugin + 3.7.0 + + + org.apache.maven.plugins + maven-surefire-plugin + 2.12 + + + org.apache.maven.plugins + maven-jar-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-install-plugin + 2.5.2 + + + org.apache.maven.plugins + maven-deploy-plugin + 2.8.2 + + + diff -Nru maven-antrun-plugin-1.8/src/it/copy-fail-test/pom.xml maven-antrun-plugin-3.1.0/src/it/copy-fail-test/pom.xml --- maven-antrun-plugin-1.8/src/it/copy-fail-test/pom.xml 2013-08-27 20:31:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/it/copy-fail-test/pom.xml 2022-04-18 19:39:57.000000000 +0000 @@ -37,7 +37,7 @@ maven-antrun-plugin @pom.version@ - + @@ -49,9 +49,55 @@ - + + + + + + org.apache.maven.plugins + maven-clean-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-site-plugin + 3.7.1 + + + + org.apache.maven.plugins + maven-resources-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-compiler-plugin + 3.7.0 + + + org.apache.maven.plugins + maven-surefire-plugin + 2.12 + + + org.apache.maven.plugins + maven-jar-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-install-plugin + 2.5.2 + + + org.apache.maven.plugins + maven-deploy-plugin + 2.8.2 + + + diff -Nru maven-antrun-plugin-1.8/src/it/custom-ant-target-attributes/pom.xml maven-antrun-plugin-3.1.0/src/it/custom-ant-target-attributes/pom.xml --- maven-antrun-plugin-1.8/src/it/custom-ant-target-attributes/pom.xml 1970-01-01 00:00:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/it/custom-ant-target-attributes/pom.xml 2022-04-18 19:39:57.000000000 +0000 @@ -0,0 +1,96 @@ + + + + + + 4.0.0 + org.apache.maven.plugins.antrun + custom-ant-target-attributes + 1.0 + pom + + + + maven-antrun-plugin + @pom.version@ + + + validate + + run + + + + + + + + + + + + + + + org.apache.maven.plugins + maven-clean-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-site-plugin + 3.7.1 + + + + org.apache.maven.plugins + maven-resources-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-compiler-plugin + 3.7.0 + + + org.apache.maven.plugins + maven-surefire-plugin + 2.12 + + + org.apache.maven.plugins + maven-jar-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-install-plugin + 2.5.2 + + + org.apache.maven.plugins + maven-deploy-plugin + 2.8.2 + + + + + diff -Nru maven-antrun-plugin-1.8/src/it/custom-ant-target-attributes/verify.groovy maven-antrun-plugin-3.1.0/src/it/custom-ant-target-attributes/verify.groovy --- maven-antrun-plugin-1.8/src/it/custom-ant-target-attributes/verify.groovy 1970-01-01 00:00:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/it/custom-ant-target-attributes/verify.groovy 2022-04-18 19:39:57.000000000 +0000 @@ -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. + */ + +def antProject = new XmlSlurper().parse(new File(basedir, 'target/antrun/build-myname.xml')) + +assert antProject.@default == "myname" +assert antProject.target.size() == 1 +assert antProject.target[0].@name == "myname" +assert antProject.target[0].@description == "Foo" +assert antProject.target[0].attributes().size() == 2 diff -Nru maven-antrun-plugin-1.8/src/it/custom-task-test/pom.xml maven-antrun-plugin-3.1.0/src/it/custom-task-test/pom.xml --- maven-antrun-plugin-1.8/src/it/custom-task-test/pom.xml 2013-08-27 20:31:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/it/custom-task-test/pom.xml 2022-04-18 19:39:57.000000000 +0000 @@ -32,9 +32,9 @@ + org.apache.ant ant - ant - 1.6.5 + 1.10.12 @@ -47,7 +47,7 @@ test - + @@ -59,7 +59,7 @@ - + run @@ -68,6 +68,52 @@ + + + + + org.apache.maven.plugins + maven-clean-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-site-plugin + 3.7.1 + + + + org.apache.maven.plugins + maven-resources-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-compiler-plugin + 3.7.0 + + + org.apache.maven.plugins + maven-surefire-plugin + 2.12 + + + org.apache.maven.plugins + maven-jar-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-install-plugin + 2.5.2 + + + org.apache.maven.plugins + maven-deploy-plugin + 2.8.2 + + + diff -Nru maven-antrun-plugin-1.8/src/it/env-var-test/pom.xml maven-antrun-plugin-3.1.0/src/it/env-var-test/pom.xml --- maven-antrun-plugin-1.8/src/it/env-var-test/pom.xml 2013-08-27 20:31:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/it/env-var-test/pom.xml 2022-04-18 19:39:57.000000000 +0000 @@ -32,9 +32,9 @@ - junit - junit - 3.8.2 + org.junit.jupiter + junit-jupiter-engine + 5.7.2 test @@ -48,7 +48,7 @@ test - + user.home = ${user.home} @@ -60,7 +60,7 @@ - + run @@ -69,6 +69,52 @@ + + + + + org.apache.maven.plugins + maven-clean-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-site-plugin + 3.7.1 + + + + org.apache.maven.plugins + maven-resources-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-compiler-plugin + 3.7.0 + + + org.apache.maven.plugins + maven-surefire-plugin + 2.12 + + + org.apache.maven.plugins + maven-jar-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-install-plugin + 2.5.2 + + + org.apache.maven.plugins + maven-deploy-plugin + 2.8.2 + + + diff -Nru maven-antrun-plugin-1.8/src/it/export-ant-properties/invoker.properties maven-antrun-plugin-3.1.0/src/it/export-ant-properties/invoker.properties --- maven-antrun-plugin-1.8/src/it/export-ant-properties/invoker.properties 1970-01-01 00:00:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/it/export-ant-properties/invoker.properties 2022-04-18 19:39:57.000000000 +0000 @@ -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 = clean validate diff -Nru maven-antrun-plugin-1.8/src/it/export-ant-properties/pom.xml maven-antrun-plugin-3.1.0/src/it/export-ant-properties/pom.xml --- maven-antrun-plugin-1.8/src/it/export-ant-properties/pom.xml 1970-01-01 00:00:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/it/export-ant-properties/pom.xml 2022-04-18 19:39:57.000000000 +0000 @@ -0,0 +1,127 @@ + + + + + + 4.0.0 + org.apache.maven.plugins.antrun + export-ant-propertie + pom + 1.0 + Checks that exportAntProperties correctly generates the Maven properties + + val1-from-maven + + + + + maven-antrun-plugin + @pom.version@ + + + validate + + run + + + + + + true + + + + + + maven-enforcer-plugin + 1.4.1 + + + enforce-properties + + enforce + + validate + + + + prop1 + val1-from-maven + + + prop2 + val2-from-ant + + + + + + + + + + + + org.apache.maven.plugins + maven-clean-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-site-plugin + 3.7.1 + + + + org.apache.maven.plugins + maven-resources-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-compiler-plugin + 3.7.0 + + + org.apache.maven.plugins + maven-surefire-plugin + 2.12 + + + org.apache.maven.plugins + maven-jar-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-install-plugin + 2.5.2 + + + org.apache.maven.plugins + maven-deploy-plugin + 2.8.2 + + + + + diff -Nru maven-antrun-plugin-1.8/src/it/filesets-test/pom.xml maven-antrun-plugin-3.1.0/src/it/filesets-test/pom.xml --- maven-antrun-plugin-1.8/src/it/filesets-test/pom.xml 2013-08-27 20:31:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/it/filesets-test/pom.xml 2022-04-18 19:39:57.000000000 +0000 @@ -44,12 +44,12 @@ run - + - + @@ -58,24 +58,70 @@ - + + + + + + org.apache.maven.plugins + maven-clean-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-site-plugin + 3.7.1 + + + + org.apache.maven.plugins + maven-resources-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-compiler-plugin + 3.7.0 + + + org.apache.maven.plugins + maven-surefire-plugin + 2.12 + + + org.apache.maven.plugins + maven-jar-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-install-plugin + 2.5.2 + + + org.apache.maven.plugins + maven-deploy-plugin + 2.8.2 + + + org.apache.ant ant - 1.7.1 + 1.10.10 - junit - junit - 3.8.2 + org.junit.jupiter + junit-jupiter-engine + 5.7.2 diff -Nru maven-antrun-plugin-1.8/src/it/filesets-test/verify.bsh maven-antrun-plugin-3.1.0/src/it/filesets-test/verify.bsh --- maven-antrun-plugin-1.8/src/it/filesets-test/verify.bsh 2013-07-31 21:12:11.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/it/filesets-test/verify.bsh 2022-04-18 19:39:57.000000000 +0000 @@ -27,8 +27,8 @@ try { File depsDir = new File( basedir, "target/dependencies" ); - File antJar = new File( depsDir, "ant-1.7.1.jar" ); - File junitJar = new File( depsDir, "junit-3.8.2.jar" ); + File antJar = new File( depsDir, "ant-1.10.10.jar" ); + File junitJar = new File( depsDir, "junit-jupiter-engine-5.7.2.jar" ); if ( ! antJar.exists() || antJar.isDirectory() ) { @@ -42,8 +42,8 @@ } File deps2Dir = new File( basedir, "target/dependencies2" ); - antJar = new File( deps2Dir, "ant-1.7.1.jar" ); - junitJar = new File( deps2Dir, "junit-3.8.2.jar" ); + antJar = new File( deps2Dir, "ant-1.10.10.jar" ); + junitJar = new File( deps2Dir, "junit-jupiter-api-5.7.2.jar" ); if ( ! antJar.exists() || antJar.isDirectory() ) { diff -Nru maven-antrun-plugin-1.8/src/it/local-repo-prop-test/pom.xml maven-antrun-plugin-3.1.0/src/it/local-repo-prop-test/pom.xml --- maven-antrun-plugin-1.8/src/it/local-repo-prop-test/pom.xml 2013-08-27 20:31:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/it/local-repo-prop-test/pom.xml 2022-04-18 19:39:57.000000000 +0000 @@ -32,9 +32,9 @@ http://maven.apache.org - junit - junit - 3.8.2 + org.junit.jupiter + junit-jupiter-engine + 5.7.2 test @@ -45,7 +45,7 @@ maven-antrun-plugin @pom.version@ - + @@ -62,9 +62,55 @@ - + + + + + + org.apache.maven.plugins + maven-clean-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-site-plugin + 3.7.1 + + + + org.apache.maven.plugins + maven-resources-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-compiler-plugin + 3.7.0 + + + org.apache.maven.plugins + maven-surefire-plugin + 2.12 + + + org.apache.maven.plugins + maven-jar-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-install-plugin + 2.5.2 + + + org.apache.maven.plugins + maven-deploy-plugin + 2.8.2 + + + diff -Nru maven-antrun-plugin-1.8/src/it/MANTRUN-172/build.xml maven-antrun-plugin-3.1.0/src/it/MANTRUN-172/build.xml --- maven-antrun-plugin-1.8/src/it/MANTRUN-172/build.xml 1970-01-01 00:00:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/it/MANTRUN-172/build.xml 2022-04-18 19:39:57.000000000 +0000 @@ -0,0 +1,26 @@ + + + + + + + + + diff -Nru maven-antrun-plugin-1.8/src/it/MANTRUN-172/invoker.properties maven-antrun-plugin-3.1.0/src/it/MANTRUN-172/invoker.properties --- maven-antrun-plugin-1.8/src/it/MANTRUN-172/invoker.properties 1970-01-01 00:00:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/it/MANTRUN-172/invoker.properties 2022-04-18 19:39:57.000000000 +0000 @@ -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. + +invoker.goals = clean validate -Dmy.test.property="from commandline" +invoker.profiles = test-profile diff -Nru maven-antrun-plugin-1.8/src/it/MANTRUN-172/pom.xml maven-antrun-plugin-3.1.0/src/it/MANTRUN-172/pom.xml --- maven-antrun-plugin-1.8/src/it/MANTRUN-172/pom.xml 1970-01-01 00:00:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/it/MANTRUN-172/pom.xml 2022-04-18 19:39:57.000000000 +0000 @@ -0,0 +1,111 @@ + + + + + + 4.0.0 + org.apache.maven.plugins.antrun + MANTRUN-172 + pom + 1.0 + https://issues.apache.org/jira/browse/MANTRUN-172 + + ${my.test.property} + + + + test-profile + + from profile + + + + + + + maven-antrun-plugin + @pom.version@ + + + validate + + run + + + + + + + + + + + + + + + + + org.apache.maven.plugins + maven-clean-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-site-plugin + 3.7.1 + + + + org.apache.maven.plugins + maven-resources-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-compiler-plugin + 3.7.0 + + + org.apache.maven.plugins + maven-surefire-plugin + 2.12 + + + org.apache.maven.plugins + maven-jar-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-install-plugin + 2.5.2 + + + org.apache.maven.plugins + maven-deploy-plugin + 2.8.2 + + + + + diff -Nru maven-antrun-plugin-1.8/src/it/MANTRUN-172/verify.bsh maven-antrun-plugin-3.1.0/src/it/MANTRUN-172/verify.bsh --- maven-antrun-plugin-1.8/src/it/MANTRUN-172/verify.bsh 1970-01-01 00:00:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/it/MANTRUN-172/verify.bsh 2022-04-18 19:39:57.000000000 +0000 @@ -0,0 +1,45 @@ + +/* + * 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 org.codehaus.plexus.util.FileUtils; + +try +{ + File buildLog = new File( basedir, "build.log" ); + String log = FileUtils.fileRead( buildLog ); + + if ( !log.contains( "[echo] pom.xml: ptest = from commandline" ) || + !log.contains( "[echo] pom.xml: my.test.property = from commandline" ) || + !log.contains( "[echo] build.xml: ptest = from commandline" ) || + !log.contains( "[echo] build.xml: my.test.property = from commandline" ) ) + { + System.err.println( "Generated console output does not contain [echo] output: " + buildLog ); + return false; + } +} +catch( Throwable t ) +{ + t.printStackTrace(); + return false; +} + +return true; diff -Nru maven-antrun-plugin-1.8/src/it/MANTRUN-178/build.xml maven-antrun-plugin-3.1.0/src/it/MANTRUN-178/build.xml --- maven-antrun-plugin-1.8/src/it/MANTRUN-178/build.xml 1970-01-01 00:00:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/it/MANTRUN-178/build.xml 2022-04-18 19:39:57.000000000 +0000 @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + prop1=${prop1} is not equal to val1-pom + + + prop2=${prop2} is not equal to val2-cli + + + prop3=${prop3} was set + + + + \ No newline at end of file diff -Nru maven-antrun-plugin-1.8/src/it/MANTRUN-178/invoker.properties maven-antrun-plugin-3.1.0/src/it/MANTRUN-178/invoker.properties --- maven-antrun-plugin-1.8/src/it/MANTRUN-178/invoker.properties 1970-01-01 00:00:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/it/MANTRUN-178/invoker.properties 2022-04-18 19:39:57.000000000 +0000 @@ -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 = clean validate -Dprop2=val2-cli -Dprop3=val3-cli diff -Nru maven-antrun-plugin-1.8/src/it/MANTRUN-178/pom.xml maven-antrun-plugin-3.1.0/src/it/MANTRUN-178/pom.xml --- maven-antrun-plugin-1.8/src/it/MANTRUN-178/pom.xml 1970-01-01 00:00:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/it/MANTRUN-178/pom.xml 2022-04-18 19:39:57.000000000 +0000 @@ -0,0 +1,107 @@ + + + + + + 4.0.0 + org.apache.maven.plugins.antrun + MANTRUN-178 + pom + 1.0 + https://issues.apache.org/jira/browse/MANTRUN-178 + + Checks that only POM properties are passed to Ant invocation, and that their values can be overriden by a user + property. + + + val1-pom + val2-pom + + + + + + maven-antrun-plugin + @pom.version@ + + + validate + + run + + + + + + + + + + + + + + + org.apache.maven.plugins + maven-clean-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-site-plugin + 3.7.1 + + + + org.apache.maven.plugins + maven-resources-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-compiler-plugin + 3.7.0 + + + org.apache.maven.plugins + maven-surefire-plugin + 2.12 + + + org.apache.maven.plugins + maven-jar-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-install-plugin + 2.5.2 + + + org.apache.maven.plugins + maven-deploy-plugin + 2.8.2 + + + + + diff -Nru maven-antrun-plugin-1.8/src/it/MANTRUN-179/pom.xml maven-antrun-plugin-3.1.0/src/it/MANTRUN-179/pom.xml --- maven-antrun-plugin-1.8/src/it/MANTRUN-179/pom.xml 1970-01-01 00:00:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/it/MANTRUN-179/pom.xml 2022-04-18 19:39:57.000000000 +0000 @@ -0,0 +1,108 @@ + + + + + + 4.0.0 + org.apache.maven.plugins.antrun + MANTRUN-179 + pom + 1.0 + https://issues.apache.org/jira/browse/MANTRUN-179 + Checks that combine.* attributes in target do not interfere with Ant execution. + + + + + maven-antrun-plugin + @pom.version@ + + + From the pluginManagement + + + + + + org.apache.maven.plugins + maven-clean-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-site-plugin + 3.7.1 + + + + org.apache.maven.plugins + maven-resources-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-compiler-plugin + 3.7.0 + + + org.apache.maven.plugins + maven-surefire-plugin + 2.12 + + + org.apache.maven.plugins + maven-jar-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-install-plugin + 2.5.2 + + + org.apache.maven.plugins + maven-deploy-plugin + 2.8.2 + + + + + + maven-antrun-plugin + + + test + + run + + validate + + + From the exec config + + + + + + + + diff -Nru maven-antrun-plugin-1.8/src/it/MANTRUN-179/verify.bsh maven-antrun-plugin-3.1.0/src/it/MANTRUN-179/verify.bsh --- maven-antrun-plugin-1.8/src/it/MANTRUN-179/verify.bsh 1970-01-01 00:00:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/it/MANTRUN-179/verify.bsh 2022-04-18 19:39:57.000000000 +0000 @@ -0,0 +1,43 @@ + +/* + * 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 org.codehaus.plexus.util.FileUtils; + +try +{ + File buildLog = new File( basedir, "build.log" ); + String log = FileUtils.fileRead( buildLog ); + + if ( !log.contains( "[echo] From the pluginManagement" ) || + !log.contains( "[echo] From the exec config" ) ) + { + System.err.println( "Generated console output does not contain [echo] output: " + buildLog ); + return false; + } +} +catch( Throwable t ) +{ + t.printStackTrace(); + return false; +} + +return true; diff -Nru maven-antrun-plugin-1.8/src/it/MANTRUN-192/pom.xml maven-antrun-plugin-3.1.0/src/it/MANTRUN-192/pom.xml --- maven-antrun-plugin-1.8/src/it/MANTRUN-192/pom.xml 1970-01-01 00:00:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/it/MANTRUN-192/pom.xml 2022-04-18 19:39:57.000000000 +0000 @@ -0,0 +1,107 @@ + + + + + + 4.0.0 + org.apache.maven.plugins.antrun + MANTRUN-192 + pom + 1.0 + https://issues.apache.org/jira/browse/MANTRUN-192 + Checks that creating a FileSet of the project dependencies also works when there are no dependencies. + + + + maven-antrun-plugin + @pom.version@ + + + + run + + validate + + + + + + + + + + + + + + + + + + + + + + org.apache.maven.plugins + maven-clean-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-site-plugin + 3.7.1 + + + + org.apache.maven.plugins + maven-resources-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-compiler-plugin + 3.7.0 + + + org.apache.maven.plugins + maven-surefire-plugin + 2.12 + + + org.apache.maven.plugins + maven-jar-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-install-plugin + 2.5.2 + + + org.apache.maven.plugins + maven-deploy-plugin + 2.8.2 + + + + + diff -Nru maven-antrun-plugin-1.8/src/it/MANTRUN-208/pom.xml maven-antrun-plugin-3.1.0/src/it/MANTRUN-208/pom.xml --- maven-antrun-plugin-1.8/src/it/MANTRUN-208/pom.xml 1970-01-01 00:00:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/it/MANTRUN-208/pom.xml 2022-04-18 19:39:57.000000000 +0000 @@ -0,0 +1,117 @@ + + + + + + 4.0.0 + antrun-plugin.test + antrun-plugin-test + jar + mantrun-208 + 2006 + Maven Antrun Plugin Test + http://maven.apache.org + + + org.junit.jupiter + junit-jupiter-engine + 5.7.2 + test + + + + + + org.apache.maven.plugins + maven-antrun-plugin + @pom.version@ + + + compile + compile + + + + + + + + + + + + + + run + + + + + + + + + + org.apache.maven.plugins + maven-clean-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-site-plugin + 3.7.1 + + + + org.apache.maven.plugins + maven-resources-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-compiler-plugin + 3.7.0 + + + org.apache.maven.plugins + maven-surefire-plugin + 2.12 + + + org.apache.maven.plugins + maven-jar-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-install-plugin + 2.5.2 + + + org.apache.maven.plugins + maven-deploy-plugin + 2.8.2 + + + + + diff -Nru maven-antrun-plugin-1.8/src/it/MANTRUN-208/verify.bsh maven-antrun-plugin-3.1.0/src/it/MANTRUN-208/verify.bsh --- maven-antrun-plugin-1.8/src/it/MANTRUN-208/verify.bsh 1970-01-01 00:00:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/it/MANTRUN-208/verify.bsh 2022-04-18 19:39:57.000000000 +0000 @@ -0,0 +1,44 @@ + +/* + * 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 java.util.regex.*; + +import org.codehaus.plexus.util.*; + +try +{ + File buildLog = new File( basedir, "build.log" ); + String log = FileUtils.fileRead( buildLog ); + + if ( log.indexOf( "compile classpath: |" ) < 0 || log.indexOf( "compile classpath: ||" ) >= 0 ) + { + System.err.println( "Generated console output does not contain compile classpath: " + buildLog ); + return false; + } +} +catch( Throwable t ) +{ + t.printStackTrace(); + return false; +} + +return true; diff -Nru maven-antrun-plugin-1.8/src/it/MANTRUN-221/build.xml maven-antrun-plugin-3.1.0/src/it/MANTRUN-221/build.xml --- maven-antrun-plugin-1.8/src/it/MANTRUN-221/build.xml 1970-01-01 00:00:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/it/MANTRUN-221/build.xml 2022-04-18 19:39:57.000000000 +0000 @@ -0,0 +1,32 @@ + + + + + + + + + + + prop1=${prop1} is not equal to 3.2.1 + + + + diff -Nru maven-antrun-plugin-1.8/src/it/MANTRUN-221/invoker.properties maven-antrun-plugin-3.1.0/src/it/MANTRUN-221/invoker.properties --- maven-antrun-plugin-1.8/src/it/MANTRUN-221/invoker.properties 1970-01-01 00:00:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/it/MANTRUN-221/invoker.properties 2022-04-18 19:39:57.000000000 +0000 @@ -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 = clean validate diff -Nru maven-antrun-plugin-1.8/src/it/MANTRUN-221/package.json maven-antrun-plugin-3.1.0/src/it/MANTRUN-221/package.json --- maven-antrun-plugin-1.8/src/it/MANTRUN-221/package.json 1970-01-01 00:00:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/it/MANTRUN-221/package.json 2022-04-18 19:39:57.000000000 +0000 @@ -0,0 +1,4 @@ +{ + "_license": "Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements; and to You under the Apache License, Version 2.0. ", + "version": "3.2.1" +} diff -Nru maven-antrun-plugin-1.8/src/it/MANTRUN-221/pom.xml maven-antrun-plugin-3.1.0/src/it/MANTRUN-221/pom.xml --- maven-antrun-plugin-1.8/src/it/MANTRUN-221/pom.xml 1970-01-01 00:00:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/it/MANTRUN-221/pom.xml 2022-04-18 19:39:57.000000000 +0000 @@ -0,0 +1,121 @@ + + + + + + 4.0.0 + org.apache.maven.plugins.antrun + MANTRUN-221 + pom + 1.0 + https://issues.apache.org/jira/browse/MANTRUN-221 + + Checks that properties defined at build time are passed to Ant invocation + + + + + ca.szc.maven + jsonpath-maven-plugin + 1.0.0 + + + read-properties + validate + + set-properties + + + package.json + + $.version + + + + + + + maven-antrun-plugin + @pom.version@ + + + validate + + run + + + + + + + + + + + + + + + org.apache.maven.plugins + maven-clean-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-site-plugin + 3.7.1 + + + + org.apache.maven.plugins + maven-resources-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-compiler-plugin + 3.7.0 + + + org.apache.maven.plugins + maven-surefire-plugin + 2.12 + + + org.apache.maven.plugins + maven-jar-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-install-plugin + 2.5.2 + + + org.apache.maven.plugins + maven-deploy-plugin + 2.8.2 + + + + + diff -Nru maven-antrun-plugin-1.8/src/it/multiple-phase-test/pom.xml maven-antrun-plugin-3.1.0/src/it/multiple-phase-test/pom.xml --- maven-antrun-plugin-1.8/src/it/multiple-phase-test/pom.xml 2013-08-27 20:31:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/it/multiple-phase-test/pom.xml 2022-04-18 19:39:57.000000000 +0000 @@ -43,9 +43,9 @@ validate - + - + @@ -55,13 +55,59 @@ generate-resources - + - + + + + + + org.apache.maven.plugins + maven-clean-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-site-plugin + 3.7.1 + + + + org.apache.maven.plugins + maven-resources-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-compiler-plugin + 3.7.0 + + + org.apache.maven.plugins + maven-surefire-plugin + 2.12 + + + org.apache.maven.plugins + maven-jar-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-install-plugin + 2.5.2 + + + org.apache.maven.plugins + maven-deploy-plugin + 2.8.2 + + + diff -Nru maven-antrun-plugin-1.8/src/it/never-fail-test/pom.xml maven-antrun-plugin-3.1.0/src/it/never-fail-test/pom.xml --- maven-antrun-plugin-1.8/src/it/never-fail-test/pom.xml 2013-08-27 20:31:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/it/never-fail-test/pom.xml 2022-04-18 19:39:57.000000000 +0000 @@ -38,11 +38,57 @@ @pom.version@ false - + This is a failure - + + + + + + org.apache.maven.plugins + maven-clean-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-site-plugin + 3.7.1 + + + + org.apache.maven.plugins + maven-resources-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-compiler-plugin + 3.7.0 + + + org.apache.maven.plugins + maven-surefire-plugin + 2.12 + + + org.apache.maven.plugins + maven-jar-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-install-plugin + 2.5.2 + + + org.apache.maven.plugins + maven-deploy-plugin + 2.8.2 + + + diff -Nru maven-antrun-plugin-1.8/src/it/plugin-classpath-test/pom.xml maven-antrun-plugin-3.1.0/src/it/plugin-classpath-test/pom.xml --- maven-antrun-plugin-1.8/src/it/plugin-classpath-test/pom.xml 2013-08-27 20:31:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/it/plugin-classpath-test/pom.xml 2022-04-18 19:39:57.000000000 +0000 @@ -44,11 +44,11 @@ compile compile - + - + run @@ -69,6 +69,52 @@ + + + + + org.apache.maven.plugins + maven-clean-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-site-plugin + 3.7.1 + + + + org.apache.maven.plugins + maven-resources-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-compiler-plugin + 3.7.0 + + + org.apache.maven.plugins + maven-surefire-plugin + 2.12 + + + org.apache.maven.plugins + maven-jar-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-install-plugin + 2.5.2 + + + org.apache.maven.plugins + maven-deploy-plugin + 2.8.2 + + + diff -Nru maven-antrun-plugin-1.8/src/it/properties-attributes-test/pom.xml maven-antrun-plugin-3.1.0/src/it/properties-attributes-test/pom.xml --- maven-antrun-plugin-1.8/src/it/properties-attributes-test/pom.xml 2013-08-27 20:31:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/it/properties-attributes-test/pom.xml 2022-04-18 19:39:57.000000000 +0000 @@ -46,7 +46,7 @@ test - + @@ -81,7 +81,7 @@ - + run @@ -90,6 +90,52 @@ + + + + + org.apache.maven.plugins + maven-clean-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-site-plugin + 3.7.1 + + + + org.apache.maven.plugins + maven-resources-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-compiler-plugin + 3.7.0 + + + org.apache.maven.plugins + maven-surefire-plugin + 2.12 + + + org.apache.maven.plugins + maven-jar-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-install-plugin + 2.5.2 + + + org.apache.maven.plugins + maven-deploy-plugin + 2.8.2 + + + diff -Nru maven-antrun-plugin-1.8/src/it/properties-test/build.xml maven-antrun-plugin-3.1.0/src/it/properties-test/build.xml --- maven-antrun-plugin-1.8/src/it/properties-test/build.xml 2013-08-27 20:31:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/it/properties-test/build.xml 2022-04-18 19:39:57.000000000 +0000 @@ -40,11 +40,8 @@ - - - - + + diff -Nru maven-antrun-plugin-1.8/src/it/properties-test/pom.xml maven-antrun-plugin-3.1.0/src/it/properties-test/pom.xml --- maven-antrun-plugin-1.8/src/it/properties-test/pom.xml 2013-08-27 20:31:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/it/properties-test/pom.xml 2022-04-18 19:39:57.000000000 +0000 @@ -32,9 +32,9 @@ - junit - junit - 3.8.2 + org.junit.jupiter + junit-jupiter-engine + 5.7.2 @@ -53,18 +53,64 @@ run - + - + + + + + + org.apache.maven.plugins + maven-clean-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-site-plugin + 3.7.1 + + + + org.apache.maven.plugins + maven-resources-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-compiler-plugin + 3.7.0 + + + org.apache.maven.plugins + maven-surefire-plugin + 2.12 + + + org.apache.maven.plugins + maven-jar-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-install-plugin + 2.5.2 + + + org.apache.maven.plugins + maven-deploy-plugin + 2.8.2 + + + diff -Nru maven-antrun-plugin-1.8/src/it/task-encoding-test/pom.xml maven-antrun-plugin-3.1.0/src/it/task-encoding-test/pom.xml --- maven-antrun-plugin-1.8/src/it/task-encoding-test/pom.xml 2013-08-27 20:31:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/it/task-encoding-test/pom.xml 2022-04-18 19:39:57.000000000 +0000 @@ -48,16 +48,62 @@ run - + - + + + + + + org.apache.maven.plugins + maven-clean-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-site-plugin + 3.7.1 + + + + org.apache.maven.plugins + maven-resources-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-compiler-plugin + 3.7.0 + + + org.apache.maven.plugins + maven-surefire-plugin + 2.12 + + + org.apache.maven.plugins + maven-jar-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-install-plugin + 2.5.2 + + + org.apache.maven.plugins + maven-deploy-plugin + 2.8.2 + + + diff -Nru maven-antrun-plugin-1.8/src/it/tasksattributes-test/pom.xml maven-antrun-plugin-3.1.0/src/it/tasksattributes-test/pom.xml --- maven-antrun-plugin-1.8/src/it/tasksattributes-test/pom.xml 2014-10-09 20:40:31.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/it/tasksattributes-test/pom.xml 2022-04-18 19:39:57.000000000 +0000 @@ -43,9 +43,9 @@ if compile - + [ANTRUN-OUTPUT-MARKER:IF] - + run @@ -55,9 +55,9 @@ unless compile - + [ANTRUN-OUTPUT-MARKER:UNLESS] - + run @@ -66,5 +66,51 @@ + + + + + org.apache.maven.plugins + maven-clean-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-site-plugin + 3.7.1 + + + + org.apache.maven.plugins + maven-resources-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-compiler-plugin + 3.7.0 + + + org.apache.maven.plugins + maven-surefire-plugin + 2.12 + + + org.apache.maven.plugins + maven-jar-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-install-plugin + 2.5.2 + + + org.apache.maven.plugins + maven-deploy-plugin + 2.8.2 + + + diff -Nru maven-antrun-plugin-1.8/src/main/java/org/apache/maven/ant/tasks/AttachArtifactTask.java maven-antrun-plugin-3.1.0/src/main/java/org/apache/maven/ant/tasks/AttachArtifactTask.java --- maven-antrun-plugin-1.8/src/main/java/org/apache/maven/ant/tasks/AttachArtifactTask.java 2014-12-13 17:56:59.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/main/java/org/apache/maven/ant/tasks/AttachArtifactTask.java 2022-04-18 19:39:57.000000000 +0000 @@ -19,7 +19,9 @@ * under the License. */ -import org.apache.maven.plugin.antrun.AntRunMojo; +import org.apache.maven.plugins.antrun.AntRunMojo; +import org.apache.maven.plugins.antrun.MavenAntRunProject; +import org.apache.maven.plugins.antrun.taskconfig.AttachArtifactConfiguration; import org.apache.maven.project.MavenProject; import org.apache.maven.project.MavenProjectHelper; import org.apache.tools.ant.BuildException; @@ -39,31 +41,20 @@ /** * The refId of the Maven project. */ - private String mavenProjectRefId = AntRunMojo.DEFAULT_MAVEN_PROJECT_REFID; + private String mavenProjectRefId = AntRunMojo.DEFAULT_MAVEN_PROJECT_REF_REFID; /** * The refId of the Maven project helper component. */ + @SuppressWarnings( "FieldCanBeLocal" ) private String mavenProjectHelperRefId = AntRunMojo.DEFAULT_MAVEN_PROJECT_HELPER_REFID; - /** - * The file to attach. - */ - private File file; - - /** - * The classifier of the artifact to attach - */ - private String classifier; + private AttachArtifactConfiguration configuration = new AttachArtifactConfiguration(); - /** - * The type of the artifact to attach. Defaults to file extension. - */ - private String type; - - /** {@inheritDoc} */ + @Override public void execute() { + File file = configuration.getFile(); if ( file == null ) { throw new BuildException( "File is a required parameter." ); @@ -79,40 +70,27 @@ throw new BuildException( "Maven project reference not found: " + mavenProjectRefId ); } + String type = configuration.getType(); if ( type == null ) { type = FileUtils.getExtension( file.getName() ); } - MavenProject mavenProject = (MavenProject) this.getProject().getReference( mavenProjectRefId ); + MavenProject mavenProject = + ( (MavenAntRunProject) this.getProject().getReference( mavenProjectRefId ) ).getMavenProject(); if ( this.getProject().getReference( mavenProjectHelperRefId ) == null ) { throw new BuildException( "Maven project helper reference not found: " + mavenProjectHelperRefId ); } + String classifier = configuration.getClassifier(); log( "Attaching " + file + " as an attached artifact", Project.MSG_VERBOSE ); - MavenProjectHelper projectHelper = (MavenProjectHelper) getProject().getReference( mavenProjectHelperRefId ); + MavenProjectHelper projectHelper = getProject().getReference( mavenProjectHelperRefId ); projectHelper.attachArtifact( mavenProject, type, classifier, file ); } /** - * @return {@link #file} - */ - public File getFile() - { - return file; - } - - /** - * @param file {@link #file} - */ - public void setFile( File file ) - { - this.file = file; - } - - /** * @return {@link #mavenProjectRefId} */ public String getMavenProjectRefId() @@ -128,35 +106,35 @@ this.mavenProjectRefId = mavenProjectRefId; } - /** - * @return {@link #classifier} - */ + /* Fields delegated to AttachArtifactConfiguration */ + + public File getFile() + { + return this.configuration.getFile(); + } + + public void setFile( File file ) + { + this.configuration.setFile( file ); + } + public String getClassifier() { - return classifier; + return this.configuration.getClassifier(); } - /** - * @param classifier {@link #classifier} - */ public void setClassifier( String classifier ) { - this.classifier = classifier; + this.configuration.setClassifier( classifier ); } - /** - * @return {@link #type} - */ public String getType() { - return type; + return this.configuration.getType(); } - /** - * @param type {@link #type} - */ public void setType( String type ) { - this.type = type; + this.configuration.setType( type ); } } diff -Nru maven-antrun-plugin-1.8/src/main/java/org/apache/maven/ant/tasks/DependencyFilesetsTask.java maven-antrun-plugin-3.1.0/src/main/java/org/apache/maven/ant/tasks/DependencyFilesetsTask.java --- maven-antrun-plugin-1.8/src/main/java/org/apache/maven/ant/tasks/DependencyFilesetsTask.java 2014-12-13 17:56:59.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/main/java/org/apache/maven/ant/tasks/DependencyFilesetsTask.java 2022-04-18 19:39:57.000000000 +0000 @@ -24,7 +24,8 @@ import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.repository.ArtifactRepository; import org.apache.maven.artifact.resolver.filter.AndArtifactFilter; -import org.apache.maven.plugin.antrun.AntRunMojo; +import org.apache.maven.plugins.antrun.AntRunMojo; +import org.apache.maven.plugins.antrun.taskconfig.DependencyFilesetsConfiguration; import org.apache.maven.project.MavenProject; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.Task; @@ -43,62 +44,15 @@ public class DependencyFilesetsTask extends Task { - - /** - * The default project dependencies id. - */ - public static final String DEFAULT_PROJECT_DEPENDENCIES_ID = "maven.project.dependencies"; - /** * The project ref Id of the project being used. */ private String mavenProjectId = AntRunMojo.DEFAULT_MAVEN_PROJECT_REFID; - /** - * The id to store the dependencies fileset. - */ - private String projectDependenciesId = DEFAULT_PROJECT_DEPENDENCIES_ID; - - /** - * @return {@link #projectDependenciesId} - */ - public String getProjectDependenciesId() - { - return projectDependenciesId; - } - - /** - * @param projectDependenciesId {@link #projectDependenciesId} - */ - public void setProjectDependenciesId( String projectDependenciesId ) - { - this.projectDependenciesId = projectDependenciesId; - } - - /** - * The string to prepend to all dependency filesets. - */ - private String prefix = ""; - - /** - * A comma separated list of artifact types to include. - */ - private String types = ""; - - /** - * A comma separated list of dependency scopes to include. - */ - private String scopes = ""; - - /** - * Create instance. - */ - public DependencyFilesetsTask() - { - - } + private DependencyFilesetsConfiguration configuration = new DependencyFilesetsConfiguration(); /** {@inheritDoc} */ + @Override public void execute() { if ( this.getProject().getReference( mavenProjectId ) == null ) @@ -106,16 +60,24 @@ throw new BuildException( "Maven project reference not found: " + mavenProjectId ); } - MavenProject mavenProject = (MavenProject) this.getProject().getReference( "maven.project" ); + MavenProject mavenProject = this.getProject().getReference( "maven.project" ); // Add filesets for depenedency artifacts - @SuppressWarnings( "unchecked" ) Set depArtifacts = filterArtifacts( mavenProject.getArtifacts() ); + Set depArtifacts = filterArtifacts( mavenProject.getArtifacts() ); FileSet dependenciesFileSet = new FileSet(); dependenciesFileSet.setProject( getProject() ); - ArtifactRepository localRepository = (ArtifactRepository) getProject().getReference( "maven.local.repository" ); + ArtifactRepository localRepository = getProject().getReference( "maven.local.repository" ); dependenciesFileSet.setDir( new File( localRepository.getBasedir() ) ); + if ( depArtifacts.isEmpty() ) + { + // For performance reasons in case of huge local repo, tell Ant to include a single thing, otherwise the + // whole directory is scanned (even though ** is excluded). + dependenciesFileSet.createInclude().setName( "." ); + dependenciesFileSet.createExclude().setName( "**" ); + } + for ( Artifact artifact : depArtifacts ) { String relativeArtifactPath = localRepository.pathOf( artifact ); @@ -129,7 +91,7 @@ getProject().addReference( fileSetName, singleArtifactFileSet ); } - getProject().addReference( ( getPrefix() + projectDependenciesId ), dependenciesFileSet ); + getProject().addReference( ( getPrefix() + getProjectDependenciesId() ), dependenciesFileSet ); } /** @@ -149,10 +111,11 @@ } /** - * @return {@link #prefix} + * @return prefix Prefix to be added to each of the dependency filesets */ public String getPrefix() { + String prefix = configuration.getPrefix(); if ( prefix == null ) { prefix = ""; @@ -162,43 +125,59 @@ /** * Prefix to be added to each of the dependency filesets. Default is empty string. - * @param prefix {@link #prefix} + * @param prefix String to prepend to all fileset IDs. */ public void setPrefix( String prefix ) { - this.prefix = prefix; + this.configuration.setPrefix( prefix ); } /** - * @return {@link #types} + * @return types Comma separated list of artifact types to include. */ public String getTypes() { - return types; + return this.configuration.getTypes(); } /** - * @param types {@link #types} + * @param types Comma separated list of artifact types to include. */ public void setTypes( String types ) { - this.types = types; + this.configuration.setTypes( types ); } /** - * @return {@link #scopes} + * @return scopes Comma separated list of artifact scopes to include. */ public String getScopes() { - return scopes; + return this.configuration.getScopes(); } /** - * @param scopes {@link #scopes} + * @param scopes Comma separated list of artifact scopes to include. */ public void setScopes( String scopes ) { - this.scopes = scopes; + this.configuration.setScopes( scopes ); + } + + /** + * @return RefId for the fileset containing all project dependencies - default maven.project.dependencies + */ + public String getProjectDependenciesId() + { + return this.configuration.getProjectDependenciesId(); + } + + /** + * @param projectDependenciesId RefId for the fileset containing all project dependencies + */ + public void setProjectDependenciesId( String projectDependenciesId ) + { + this.configuration.setProjectDependenciesId( projectDependenciesId ); } /** @@ -209,31 +188,34 @@ */ public Set filterArtifacts( Set artifacts ) { + String scopes = getScopes(); if ( scopes == null ) { scopes = ""; } + + String types = getTypes(); if ( types == null ) { types = ""; } - if ( scopes.equals( "" ) && types.equals( "" ) ) + if ( "".equals( scopes ) && "".equals( types ) ) { return artifacts; } AndArtifactFilter filter = new AndArtifactFilter(); - if ( !scopes.equals( "" ) ) + if ( !"".equals( scopes ) ) { filter.add( new SpecificScopesArtifactFilter( getScopes() ) ); } - if ( !types.equals( "" ) ) + if ( !"".equals( types ) ) { filter.add( new TypesArtifactFilter( getTypes() ) ); } - Set artifactsResult = new LinkedHashSet(); + Set artifactsResult = new LinkedHashSet<>(); for ( Artifact artifact : artifacts ) { if ( filter.include( artifact ) ) diff -Nru maven-antrun-plugin-1.8/src/main/java/org/apache/maven/ant/tasks/support/SpecificScopesArtifactFilter.java maven-antrun-plugin-3.1.0/src/main/java/org/apache/maven/ant/tasks/support/SpecificScopesArtifactFilter.java --- maven-antrun-plugin-1.8/src/main/java/org/apache/maven/ant/tasks/support/SpecificScopesArtifactFilter.java 2014-12-13 17:56:59.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/main/java/org/apache/maven/ant/tasks/support/SpecificScopesArtifactFilter.java 2022-04-18 19:39:57.000000000 +0000 @@ -20,14 +20,12 @@ */ import org.apache.maven.artifact.Artifact; -import org.apache.maven.artifact.DefaultArtifact; import org.apache.maven.artifact.resolver.filter.ArtifactFilter; /** * Filter to only retain objects in the given scope(s). * * @author pgier - * @version $Id: SpecificScopesArtifactFilter.java 1645339 2014-12-13 17:56:59Z khmarbaise $ */ public class SpecificScopesArtifactFilter implements ArtifactFilter @@ -53,23 +51,23 @@ for ( String aScopeList : scopeList ) { - if ( aScopeList.trim().equals( DefaultArtifact.SCOPE_COMPILE ) ) + if ( aScopeList.trim().equals( Artifact.SCOPE_COMPILE ) ) { compileScope = true; } - else if ( aScopeList.trim().equals( DefaultArtifact.SCOPE_PROVIDED ) ) + else if ( aScopeList.trim().equals( Artifact.SCOPE_PROVIDED ) ) { providedScope = true; } - else if ( aScopeList.trim().equals( DefaultArtifact.SCOPE_RUNTIME ) ) + else if ( aScopeList.trim().equals( Artifact.SCOPE_RUNTIME ) ) { runtimeScope = true; } - else if ( aScopeList.trim().equals( DefaultArtifact.SCOPE_SYSTEM ) ) + else if ( aScopeList.trim().equals( Artifact.SCOPE_SYSTEM ) ) { systemScope = true; } - else if ( aScopeList.trim().equals( DefaultArtifact.SCOPE_TEST ) ) + else if ( aScopeList.trim().equals( Artifact.SCOPE_TEST ) ) { testScope = true; } @@ -77,6 +75,7 @@ } /** {@inheritDoc} */ + @Override public boolean include( Artifact artifact ) { if ( Artifact.SCOPE_COMPILE.equals( artifact.getScope() ) ) diff -Nru maven-antrun-plugin-1.8/src/main/java/org/apache/maven/ant/tasks/support/TypesArtifactFilter.java maven-antrun-plugin-3.1.0/src/main/java/org/apache/maven/ant/tasks/support/TypesArtifactFilter.java --- maven-antrun-plugin-1.8/src/main/java/org/apache/maven/ant/tasks/support/TypesArtifactFilter.java 2014-12-13 17:56:59.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/main/java/org/apache/maven/ant/tasks/support/TypesArtifactFilter.java 2022-04-18 19:39:57.000000000 +0000 @@ -31,7 +31,7 @@ public class TypesArtifactFilter implements ArtifactFilter { - private List types = new ArrayList(); + private List types = new ArrayList<>(); /** * Accepts a comma separated list of types @@ -50,6 +50,7 @@ } /** {@inheritDoc} */ + @Override public boolean include( Artifact artifact ) { String artifactType = artifact.getType(); diff -Nru maven-antrun-plugin-1.8/src/main/java/org/apache/maven/ant/tasks/support/VersionMapper.java maven-antrun-plugin-3.1.0/src/main/java/org/apache/maven/ant/tasks/support/VersionMapper.java --- maven-antrun-plugin-1.8/src/main/java/org/apache/maven/ant/tasks/support/VersionMapper.java 2014-12-13 17:56:59.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/main/java/org/apache/maven/ant/tasks/support/VersionMapper.java 2022-04-18 19:39:57.000000000 +0000 @@ -31,7 +31,6 @@ * Ant filename mapper to remove version info from filename when copying dependencies. * * @author Herve Boutemy - * @version $Id: VersionMapper.java 1645339 2014-12-13 17:56:59Z khmarbaise $ */ public class VersionMapper implements FileNameMapper, Comparator @@ -41,6 +40,7 @@ private String to; /** {@inheritDoc} */ + @Override public String[] mapFileName( String sourceFileName ) { String originalFileName = new File( sourceFileName ).getName(); @@ -68,6 +68,7 @@ * separator, as used by dependencies task when setting versionsId property value. * @param from The string from which we set. */ + @Override public void setFrom( String from ) { String[] split = StringUtils.split( from, File.pathSeparator ); @@ -80,12 +81,14 @@ * By default, only filename is changed, but if this attribute is set to flatten, directory is removed. * @param to {@link #to} */ + @Override public void setTo( String to ) { this.to = to; } /** {@inheritDoc} */ + @Override public int compare( String s1, String s2 ) { int lengthDiff = s2.length() - s1.length(); diff -Nru maven-antrun-plugin-1.8/src/main/java/org/apache/maven/plugin/antrun/AntRunMojo.java maven-antrun-plugin-3.1.0/src/main/java/org/apache/maven/plugin/antrun/AntRunMojo.java --- maven-antrun-plugin-1.8/src/main/java/org/apache/maven/plugin/antrun/AntRunMojo.java 2014-12-13 17:56:59.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/main/java/org/apache/maven/plugin/antrun/AntRunMojo.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,674 +0,0 @@ -package org.apache.maven.plugin.antrun; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import java.io.File; -import java.io.IOException; -import java.io.LineNumberReader; -import java.io.StringWriter; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import java.util.Map; -import java.util.Properties; -import java.util.Set; - -import org.apache.maven.artifact.Artifact; -import org.apache.maven.artifact.DependencyResolutionRequiredException; -import org.apache.maven.artifact.repository.ArtifactRepository; -import org.apache.maven.plugin.AbstractMojo; -import org.apache.maven.plugin.MojoExecutionException; -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.plugins.annotations.ResolutionScope; -import org.apache.maven.project.MavenProject; -import org.apache.maven.project.MavenProjectHelper; -import org.apache.tools.ant.BuildException; -import org.apache.tools.ant.DefaultLogger; -import org.apache.tools.ant.Project; -import org.apache.tools.ant.ProjectHelper; -import org.apache.tools.ant.taskdefs.Typedef; -import org.apache.tools.ant.types.Path; -import org.codehaus.plexus.configuration.PlexusConfiguration; -import org.codehaus.plexus.configuration.PlexusConfigurationException; -import org.codehaus.plexus.util.FileUtils; -import org.codehaus.plexus.util.IOUtil; -import org.codehaus.plexus.util.ReaderFactory; -import org.codehaus.plexus.util.StringUtils; - -/** - * Maven AntRun Mojo.
- * This plugin provides the capability of calling Ant tasks from a POM by running the nested Ant tasks inside the - * <tasks/> parameter. It is encouraged to move the actual tasks to a separate build.xml file and call that file - * with an <ant/> task. - * - * @author Kenney Westerhof - * @author Vincent Siveton - * @version $Id: AntRunMojo.java 1645339 2014-12-13 17:56:59Z khmarbaise $ - */ -@Mojo( name = "run", threadSafe = true, requiresDependencyResolution = ResolutionScope.TEST ) -public class AntRunMojo - extends AbstractMojo -{ - /** - * The refid used to store the Maven project object in the Ant build. - */ - public static final String DEFAULT_MAVEN_PROJECT_REFID = "maven.project"; - - /** - * The refid used to store the Maven project object in the Ant build. - */ - public static final String DEFAULT_MAVEN_PROJECT_HELPER_REFID = "maven.project.helper"; - - /** - * The default target name. - */ - public static final String DEFAULT_ANT_TARGET_NAME = "main"; - - /** - * The default encoding to use for the generated Ant build. - */ - public static final String UTF_8 = "UTF-8"; - - /** - * The name used for the Ant target - */ - private String antTargetName; - - /** - * The path to The XML file containing the definition of the Maven tasks. - */ - public static final String ANTLIB = "org/apache/maven/ant/tasks/antlib.xml"; - - /** - * The URI which defines the built in Ant tasks - */ - public static final String TASK_URI = "antlib:org.apache.maven.ant.tasks"; - - /** - * The Maven project object - */ - @Parameter( defaultValue = "${project}", readonly = true, required = true ) - private MavenProject project; - - /** - * The Maven project helper object - */ - @Component - private MavenProjectHelper projectHelper; - - /** - * The plugin dependencies. - */ - @Parameter( property = "plugin.artifacts", required = true, readonly = true ) - private List pluginArtifacts; - - /** - * The local Maven repository - */ - @Parameter( property = "localRepository", readonly = true ) - protected ArtifactRepository localRepository; - - /** - * String to prepend to project and dependency property names. - * - * @since 1.4 - */ - @Parameter( defaultValue = "" ) - private String propertyPrefix; - - /** - * The xml tag prefix to use for the built in Ant tasks. This prefix needs to be prepended to each task referenced - * in the antrun target config. For example, a prefix of "mvn" means that the attachartifact task is referenced by - * "<mvn:attachartifact>" The default value of an empty string means that no prefix is used for the tasks. - * - * @since 1.5 - */ - @Parameter( defaultValue = "" ) - private String customTaskPrefix = ""; - - /** - * The name of a property containing the list of all dependency versions. This is used for the removing the versions - * from the filenames. - */ - @Parameter( defaultValue = "maven.project.dependencies.versions" ) - private String versionsPropertyName; - - /** - * The XML for the Ant task. You can add anything you can add between <target> and </target> in a - * build.xml. - * - * @deprecated Use target instead - */ - @Parameter - private PlexusConfiguration tasks; - - /** - * The XML for the Ant target. You can add anything you can add between <target> and </target> in a - * build.xml. - * - * @since 1.5 - */ - @Parameter - private PlexusConfiguration target; - - /** - * This folder is added to the list of those folders containing source to be compiled. Use this if your Ant script - * generates source code. - * - * @deprecated Use the build-helper-maven-plugin to bind source directories - */ - @Parameter( property = "sourceRoot" ) - private File sourceRoot; - - /** - * This folder is added to the list of those folders containing source to be compiled for testing. Use this if your - * Ant script generates test source code. - * - * @deprecated Use the build-helper-maven-plugin to bind test source directories - */ - @Parameter( property = "testSourceRoot" ) - private File testSourceRoot; - - /** - * Specifies whether the Antrun execution should be skipped. - * - * @since 1.7 - */ - @Parameter( property = "maven.antrun.skip", defaultValue = "false" ) - private boolean skip; - - /** - * Specifies whether the Ant properties should be propagated to the Maven properties. - * - * @since 1.7 - */ - @Parameter( defaultValue = "false" ) - private boolean exportAntProperties; - - /** - * Specifies whether a failure in the Ant build leads to a failure of the Maven build. If this - * value is {@code false}, the Maven build will proceed even if the Ant build fails. If it is - * {@code true}, then the Maven build fails if the Ant build fails. - * - * @since 1.7 - */ - @Parameter( defaultValue = "true" ) - private boolean failOnError; - - /** {@inheritDoc} */ - public void execute() - throws MojoExecutionException - { - if ( skip ) - { - getLog().info( "Skipping Antrun execution" ); - return; - } - - MavenProject mavenProject = getMavenProject(); - - if ( tasks != null ) - { - getLog().warn( "Parameter tasks is deprecated, use target instead" ); - target = tasks; - } - - if ( target == null ) - { - getLog().info( "No Ant target defined - SKIPPED" ); - return; - } - - if ( propertyPrefix == null ) - { - propertyPrefix = ""; - } - - try - { - Project antProject = new Project(); - File antBuildFile = this.writeTargetToProjectFile(); - ProjectHelper.configureProject( antProject, antBuildFile ); - antProject.init(); - - DefaultLogger antLogger = new DefaultLogger(); - antLogger.setOutputPrintStream( System.out ); - antLogger.setErrorPrintStream( System.err ); - - if ( getLog().isDebugEnabled() ) - { - antLogger.setMessageOutputLevel( Project.MSG_DEBUG ); - } - else if ( getLog().isInfoEnabled() ) - { - antLogger.setMessageOutputLevel( Project.MSG_INFO ); - } - else if ( getLog().isWarnEnabled() ) - { - antLogger.setMessageOutputLevel( Project.MSG_WARN ); - } - else if ( getLog().isErrorEnabled() ) - { - antLogger.setMessageOutputLevel( Project.MSG_ERR ); - } - else - { - antLogger.setMessageOutputLevel( Project.MSG_VERBOSE ); - } - - antProject.addBuildListener( antLogger ); - antProject.setBaseDir( mavenProject.getBasedir() ); - - Path p = new Path( antProject ); - p.setPath( StringUtils.join( mavenProject.getCompileClasspathElements().iterator(), File.pathSeparator ) ); - - /* maven.dependency.classpath it's deprecated as it's equal to maven.compile.classpath */ - antProject.addReference( "maven.dependency.classpath", p ); - antProject.addReference( "maven.compile.classpath", p ); - - p = new Path( antProject ); - p.setPath( StringUtils.join( mavenProject.getRuntimeClasspathElements().iterator(), File.pathSeparator ) ); - antProject.addReference( "maven.runtime.classpath", p ); - - p = new Path( antProject ); - p.setPath( StringUtils.join( mavenProject.getTestClasspathElements().iterator(), File.pathSeparator ) ); - antProject.addReference( "maven.test.classpath", p ); - - /* set maven.plugin.classpath with plugin dependencies */ - antProject.addReference( "maven.plugin.classpath", getPathFromArtifacts( pluginArtifacts, antProject ) ); - - antProject.addReference( DEFAULT_MAVEN_PROJECT_REFID, getMavenProject() ); - antProject.addReference( DEFAULT_MAVEN_PROJECT_HELPER_REFID, projectHelper ); - antProject.addReference( "maven.local.repository", localRepository ); - initMavenTasks( antProject ); - - // The Ant project needs actual properties vs. using expression evaluator when calling an external build - // file. - copyProperties( mavenProject, antProject ); - - if ( getLog().isInfoEnabled() ) - { - getLog().info( "Executing tasks" ); - } - - antProject.executeTarget( antTargetName ); - - if ( getLog().isInfoEnabled() ) - { - getLog().info( "Executed tasks" ); - } - - copyProperties( antProject, mavenProject ); - } - catch ( DependencyResolutionRequiredException e ) - { - throw new MojoExecutionException( "DependencyResolutionRequiredException: " + e.getMessage(), e ); - } - catch ( BuildException e ) - { - StringBuilder sb = new StringBuilder(); - sb.append( "An Ant BuildException has occured: " ).append( e.getMessage() ); - String fragment = findFragment( e ); - if ( fragment != null ) - { - sb.append( "\n" ).append( fragment ); - } - if ( !failOnError ) - { - getLog().info( sb.toString(), e ); - return; // do not register roots. - } - else - { - throw new MojoExecutionException( sb.toString(), e ); - } - } - catch ( Throwable e ) - { - throw new MojoExecutionException( "Error executing Ant tasks: " + e.getMessage(), e ); - } - - if ( sourceRoot != null ) - { - getLog().info( "Registering compile source root " + sourceRoot ); - getMavenProject().addCompileSourceRoot( sourceRoot.toString() ); - } - - if ( testSourceRoot != null ) - { - getLog().info( "Registering compile test source root " + testSourceRoot ); - getMavenProject().addTestCompileSourceRoot( testSourceRoot.toString() ); - } - } - - /** - * @param artifacts {@link Artifact} collection. - * @param antProject {@link Project} - * @return {@link Path} - * @throws DependencyResolutionRequiredException In case of a failure. - * - */ - public Path getPathFromArtifacts( Collection artifacts, Project antProject ) - throws DependencyResolutionRequiredException - { - if ( artifacts == null ) - { - return new Path( antProject ); - } - - List list = new ArrayList( artifacts.size() ); - for ( Artifact a : artifacts ) - { - File file = a.getFile(); - if ( file == null ) - { - throw new DependencyResolutionRequiredException( a ); - } - list.add( file.getPath() ); - } - - Path p = new Path( antProject ); - p.setPath( StringUtils.join( list.iterator(), File.pathSeparator ) ); - - return p; - } - - /** - * Copy properties from the Maven project to the Ant project. - * - * @param mavenProject {@link MavenProject} - * @param antProject {@link Project} - */ - public void copyProperties( MavenProject mavenProject, Project antProject ) - { - Properties mavenProps = mavenProject.getProperties(); - for ( Map.Entry entry : mavenProps.entrySet() ) - { - antProject.setProperty( (String) entry.getKey(), (String) entry.getValue() ); - } - - // Set the POM file as the ant.file for the tasks run directly in Maven. - antProject.setProperty( "ant.file", mavenProject.getFile().getAbsolutePath() ); - - // Add some of the common Maven properties - getLog().debug( "Setting properties with prefix: " + propertyPrefix ); - antProject.setProperty( ( propertyPrefix + "project.groupId" ), mavenProject.getGroupId() ); - antProject.setProperty( ( propertyPrefix + "project.artifactId" ), mavenProject.getArtifactId() ); - antProject.setProperty( ( propertyPrefix + "project.name" ), mavenProject.getName() ); - if ( mavenProject.getDescription() != null ) - { - antProject.setProperty( ( propertyPrefix + "project.description" ), mavenProject.getDescription() ); - } - antProject.setProperty( ( propertyPrefix + "project.version" ), mavenProject.getVersion() ); - antProject.setProperty( ( propertyPrefix + "project.packaging" ), mavenProject.getPackaging() ); - antProject.setProperty( ( propertyPrefix + "project.build.directory" ), - mavenProject.getBuild().getDirectory() ); - antProject.setProperty( ( propertyPrefix + "project.build.outputDirectory" ), - mavenProject.getBuild().getOutputDirectory() ); - antProject.setProperty( ( propertyPrefix + "project.build.testOutputDirectory" ), - mavenProject.getBuild().getTestOutputDirectory() ); - antProject.setProperty( ( propertyPrefix + "project.build.sourceDirectory" ), - mavenProject.getBuild().getSourceDirectory() ); - antProject.setProperty( ( propertyPrefix + "project.build.testSourceDirectory" ), - mavenProject.getBuild().getTestSourceDirectory() ); - antProject.setProperty( ( propertyPrefix + "localRepository" ), localRepository.toString() ); - antProject.setProperty( ( propertyPrefix + "settings.localRepository" ), localRepository.getBasedir() ); - - // Add properties for depenedency artifacts - @SuppressWarnings( "unchecked" ) - Set depArtifacts = mavenProject.getArtifacts(); - for ( Artifact artifact : depArtifacts ) - { - String propName = artifact.getDependencyConflictId(); - - antProject.setProperty( propertyPrefix + propName, artifact.getFile().getPath() ); - } - - // Add a property containing the list of versions for the mapper - StringBuilder versionsBuffer = new StringBuilder(); - for ( Artifact artifact : depArtifacts ) - { - versionsBuffer.append( artifact.getVersion() ).append( File.pathSeparator ); - } - antProject.setProperty( versionsPropertyName, versionsBuffer.toString() ); - - // Add properties in deprecated format to depenedency artifacts - // This should be removed in future versions of the antrun plugin. - for ( Artifact artifact : depArtifacts ) - { - String propName = getDependencyArtifactPropertyName( artifact ); - - antProject.setProperty( propName, artifact.getFile().getPath() ); - } - } - - /** - * Copy properties from the Ant project to the Maven project. - * - * @param antProject not null - * @param mavenProject not null - * @since 1.7 - */ - public void copyProperties( Project antProject, MavenProject mavenProject ) - { - if ( !exportAntProperties ) - { - return; - } - - getLog().debug( "Propagated Ant properties to Maven properties" ); - Map antProps = antProject.getProperties(); - Properties mavenProperties = mavenProject.getProperties(); - - for ( Map.Entry entry : antProps.entrySet() ) - { - String key = (String) entry.getKey(); - if ( mavenProperties.getProperty( key ) != null ) - { - getLog().debug( "Ant property '" + key + "=" + mavenProperties.getProperty( key ) - + "' clashs with an existing Maven property, " - + "SKIPPING this Ant property propagation." ); - continue; - } - mavenProperties.setProperty( key, (String) entry.getValue() ); - } - } - - /** - * Prefix for legacy property format. - * - * @deprecated This should only be used for generating the old property format. - */ - public static final String DEPENDENCY_PREFIX = "maven.dependency."; - - /** - * Returns a property name for a dependency artifact. The name is in the format - * maven.dependency.groupId.artifactId[.classifier].type.path - * - * @param artifact {@link Artifact} - * @return property name - * @deprecated The dependency conflict ID should be used as the property name. - */ - public static String getDependencyArtifactPropertyName( Artifact artifact ) - { - return DEPENDENCY_PREFIX + artifact.getGroupId() + "." + artifact.getArtifactId() - + ( artifact.getClassifier() != null ? "." + artifact.getClassifier() : "" ) - + ( artifact.getType() != null ? "." + artifact.getType() : "" ) + ".path"; - } - - /** - * Get the current Maven project - * - * @return current Maven project - */ - public MavenProject getMavenProject() - { - return this.project; - } - - /** - * @param antProject {@link Project} - */ - public void initMavenTasks( Project antProject ) - { - getLog().debug( "Initialize Maven Ant Tasks" ); - Typedef typedef = new Typedef(); - typedef.setProject( antProject ); - typedef.setResource( ANTLIB ); - if ( !customTaskPrefix.equals( "" ) ) - { - typedef.setURI( TASK_URI ); - } - typedef.execute(); - } - - /** - * Write the Ant target and surrounding tags to a temporary file - * - * @throws PlexusConfigurationException - */ - private File writeTargetToProjectFile() - throws IOException, PlexusConfigurationException - { - // Have to use an XML writer because in Maven 2.x the PlexusConfig toString() method loses XML attributes - StringWriter writer = new StringWriter(); - AntrunXmlPlexusConfigurationWriter xmlWriter = new AntrunXmlPlexusConfigurationWriter(); - xmlWriter.write( target, writer ); - - StringBuilder antProjectConfig = new StringBuilder( writer.getBuffer() ); - - // replace deprecated tasks tag with standard Ant target - stringReplace( antProjectConfig, "\n"; - antProjectConfig.insert( 0, xmlHeader ); - final String projectOpen = - "\n"; - int index = antProjectConfig.indexOf( " + * Maven AntRun Mojo. + *

+ * This plugin provides the capability of calling Ant tasks from a POM by running the nested Ant tasks inside the + * <target/> parameter. It is encouraged to move the actual tasks to a separate build.xml file and call that file + * with an <ant/> task. + * + * @author Kenney Westerhof + * @author Vincent Siveton + */ +@Mojo( name = "run", threadSafe = true, requiresDependencyResolution = ResolutionScope.TEST ) +public class AntRunMojo + extends AbstractMojo +{ + + /** + * The prefix of all refid used by the plugin. + */ + public static final String MAVEN_REFID_PREFIX = "maven."; + + /** + * The refid used to store the Maven project object in the Ant build. If this reference is retrieved in a custom + * task, note that this will be a clone of the Maven project, and not the project itself, when the task is called + * through an ant task. + */ + public static final String DEFAULT_MAVEN_PROJECT_REFID = MAVEN_REFID_PREFIX + "project"; + + /** + * The refid used to store an object of type {@link MavenAntRunProject} containing the Maven project object in the + * Ant build. This is useful when a custom task needs to change the Maven project, because, unlike + * {@link #DEFAULT_MAVEN_PROJECT_REFID}, this makes sure to reference the same instance of the Maven project in all + * cases. + */ + public static final String DEFAULT_MAVEN_PROJECT_REF_REFID = MAVEN_REFID_PREFIX + "project.ref"; + + /** + * The refid used to store the Maven project object in the Ant build. + */ + public static final String DEFAULT_MAVEN_PROJECT_HELPER_REFID = MAVEN_REFID_PREFIX + "project.helper"; + + /** + * The default target name. + */ + public static final String DEFAULT_ANT_TARGET_NAME = "main"; + + /** + * The default encoding to use for the generated Ant build. + */ + public static final String UTF_8 = "UTF-8"; + + /** + * The path to The XML file containing the definition of the Maven tasks. + */ + public static final String ANTLIB = "org/apache/maven/ant/tasks/antlib.xml"; + + /** + * The URI which defines the built in Ant tasks + */ + public static final String TASK_URI = "antlib:org.apache.maven.ant.tasks"; + + /** + * The Maven project object + */ + @Parameter( defaultValue = "${project}", readonly = true, required = true ) + private MavenProject mavenProject; + + /** + * The Maven session object + */ + @Parameter( defaultValue = "${session}", readonly = true, required = true ) + private MavenSession session; + + /** + * The Maven project helper object + */ + @Component + private MavenProjectHelper projectHelper; + + /** + * The plugin dependencies. + */ + @Parameter( property = "plugin.artifacts", required = true, readonly = true ) + private List pluginArtifacts; + + /** + * The local Maven repository + */ + @Parameter( property = "localRepository", readonly = true ) + protected ArtifactRepository localRepository; + + /** + * String to prepend to project and dependency property names. + * + * @since 1.4 + */ + @Parameter( defaultValue = "" ) + private String propertyPrefix; + + /** + * Maven will look in the target-tag for the namespace of http://maven.apache.org/ANTRUN + * or antlib:org.apache.maven.ant.tasks + * + *

+     *   <configuration>
+     *     <target xmlns:mvn="http://maven.apache.org/ANTRUN">
+     *       <mvn:attachartifact/>
+     *       <mvn:dependencyfilesets/>
+     *     </target>
+     *   </configuration>
+     * 
+ * + * @deprecated only here for backwards compatibility + * @since 1.5 + */ + @Deprecated + @Parameter + private String customTaskPrefix; + + /** + * The name of a property containing the list of all dependency versions. This is used for the removing the versions + * from the filenames. + */ + @Parameter( defaultValue = "maven.project.dependencies.versions" ) + private String versionsPropertyName; + + /** + * The XML for the Ant task. You can add anything you can add between <target> and </target> in a + * build.xml. + * + * @deprecated Use {@link #target} instead. For version 3.0.0, this parameter is only defined to break the build if + * you use it! + */ + @Deprecated + @Parameter + private PlexusConfiguration tasks; + + /** + * The XML for the Ant target. You can add anything you can add between <target> and </target> in a + * build.xml. + * + * @since 1.5 + */ + @Parameter + private PlexusConfiguration target; + + /** + * This folder is added to the list of those folders containing source to be compiled. Use this if your Ant script + * generates source code. + * + * @deprecated Use the build-helper-maven-plugin to bind source directories. For version 3.0.0, this + * parameter is only defined to break the build if you use it! + */ + @SuppressWarnings( "DeprecatedIsStillUsed" ) + @Deprecated + @Parameter( property = "sourceRoot" ) + private File sourceRoot; + + /** + * This folder is added to the list of those folders containing source to be compiled for testing. Use this if your + * Ant script generates test source code. + * + * @deprecated Use the build-helper-maven-plugin to bind test source directories. For version 3.0.0, + * this parameter is only defined to break the build if you use it! + */ + @SuppressWarnings( "DeprecatedIsStillUsed" ) + @Deprecated + @Parameter( property = "testSourceRoot" ) + private File testSourceRoot; + + /** + * Specifies whether the Antrun execution should be skipped. + * + * @since 1.7 + */ + @Parameter( property = "maven.antrun.skip", defaultValue = "false" ) + private boolean skip; + + /** + * Specifies whether the Ant properties should be propagated to the Maven properties. + * + * @since 1.7 + */ + @Parameter( defaultValue = "false" ) + private boolean exportAntProperties; + + /** + * Specifies whether a failure in the Ant build leads to a failure of the Maven build. If this value is + * {@code false}, the Maven build will proceed even if the Ant build fails. If it is {@code true}, then the Maven + * build fails if the Ant build fails. + * + * @since 1.7 + */ + @Parameter( defaultValue = "true" ) + private boolean failOnError; + + @Override + public void execute() + throws MojoExecutionException, MojoFailureException + { + checkDeprecatedParameterUsage( tasks, "tasks", "target" ); + checkDeprecatedParameterUsage( sourceRoot, "sourceRoot", "the build-helper-maven-plugin" ); + checkDeprecatedParameterUsage( testSourceRoot, "testSourceRoot", "the build-helper-maven-plugin" ); + if ( skip ) + { + getLog().info( "Skipping Antrun execution" ); + return; + } + + if ( target == null ) + { + getLog().info( "No Ant target defined - SKIPPED" ); + return; + } + + if ( propertyPrefix == null ) + { + propertyPrefix = ""; + } + + String antTargetName = target.getAttribute( "name", DEFAULT_ANT_TARGET_NAME ); + target.setAttribute( "name", antTargetName ); + + Project antProject = new Project(); + antProject.addBuildListener( getConfiguredBuildLogger() ); + try + { + File antBuildFile = writeTargetToProjectFile( antTargetName ); + ProjectHelper.configureProject( antProject, antBuildFile ); + antProject.init(); + + antProject.setBaseDir( mavenProject.getBasedir() ); + + addAntProjectReferences( mavenProject, antProject ); + initMavenTasks( antProject ); + + // The Ant project needs actual properties vs. using expression evaluator when calling an external build + // file. + copyProperties( mavenProject, antProject ); + + getLog().info( "Executing tasks" ); + antProject.executeTarget( antTargetName ); + getLog().info( "Executed tasks" ); + + copyProperties( antProject, mavenProject ); + } + catch ( BuildException e ) + { + StringBuilder sb = new StringBuilder(); + sb.append( "An Ant BuildException has occured: " ).append( e.getMessage() ); + String fragment = findFragment( e ); + if ( fragment != null ) + { + sb.append( "\n" ).append( fragment ); + } + if ( !failOnError ) + { + getLog().info( sb.toString(), e ); + return; // do not register roots. + } + else + { + throw new MojoExecutionException( sb.toString(), e ); + } + } + catch ( Throwable e ) + { + throw new MojoExecutionException( "Error executing Ant tasks: " + e.getMessage(), e ); + } + } + + private void checkDeprecatedParameterUsage( Object parameter, String name, String replacement ) + throws MojoFailureException + { + if ( parameter != null ) + { + throw new MojoFailureException( "You are using '" + name + "' which has been removed" + + " from the maven-antrun-plugin. Please use '" + replacement + + "' and refer to the >>Major Version Upgrade to version 3.0.0<< " + "on the plugin site." ); + } + } + + private DefaultLogger getConfiguredBuildLogger() + { + DefaultLogger antLogger = new MavenLogger( getLog() ); + if ( getLog().isDebugEnabled() ) + { + antLogger.setMessageOutputLevel( Project.MSG_DEBUG ); + } + else if ( getLog().isInfoEnabled() ) + { + antLogger.setMessageOutputLevel( Project.MSG_INFO ); + } + else if ( getLog().isWarnEnabled() ) + { + antLogger.setMessageOutputLevel( Project.MSG_WARN ); + } + else if ( getLog().isErrorEnabled() ) + { + antLogger.setMessageOutputLevel( Project.MSG_ERR ); + } + else + { + antLogger.setMessageOutputLevel( Project.MSG_VERBOSE ); + } + return antLogger; + } + + private void addAntProjectReferences( MavenProject mavenProject, Project antProject ) + throws DependencyResolutionRequiredException + { + Path p = new Path( antProject ); + p.setPath( StringUtils.join( mavenProject.getCompileClasspathElements().iterator(), File.pathSeparator ) ); + + /* maven.dependency.classpath it's deprecated as it's equal to maven.compile.classpath */ + antProject.addReference( MAVEN_REFID_PREFIX + "dependency.classpath", p ); + antProject.addReference( MAVEN_REFID_PREFIX + "compile.classpath", p ); + + p = new Path( antProject ); + p.setPath( StringUtils.join( mavenProject.getRuntimeClasspathElements().iterator(), File.pathSeparator ) ); + antProject.addReference( MAVEN_REFID_PREFIX + "runtime.classpath", p ); + + p = new Path( antProject ); + p.setPath( StringUtils.join( mavenProject.getTestClasspathElements().iterator(), File.pathSeparator ) ); + antProject.addReference( MAVEN_REFID_PREFIX + "test.classpath", p ); + + /* set maven.plugin.classpath with plugin dependencies */ + antProject.addReference( MAVEN_REFID_PREFIX + "plugin.classpath", + getPathFromArtifacts( pluginArtifacts, antProject ) ); + + antProject.addReference( DEFAULT_MAVEN_PROJECT_REFID, mavenProject ); + antProject.addReference( DEFAULT_MAVEN_PROJECT_REF_REFID, new MavenAntRunProject( mavenProject ) ); + antProject.addReference( DEFAULT_MAVEN_PROJECT_HELPER_REFID, projectHelper ); + antProject.addReference( MAVEN_REFID_PREFIX + "local.repository", localRepository ); + } + + /** + * @param artifacts {@link Artifact} collection. + * @param antProject {@link Project} + * @return {@link Path} + * @throws DependencyResolutionRequiredException In case of a failure. + */ + private Path getPathFromArtifacts( Collection artifacts, Project antProject ) + throws DependencyResolutionRequiredException + { + if ( artifacts == null ) + { + return new Path( antProject ); + } + + List list = new ArrayList<>( artifacts.size() ); + for ( Artifact a : artifacts ) + { + File file = a.getFile(); + if ( file == null ) + { + throw new DependencyResolutionRequiredException( a ); + } + list.add( file.getPath() ); + } + + Path p = new Path( antProject ); + p.setPath( StringUtils.join( list.iterator(), File.pathSeparator ) ); + + return p; + } + + /** + * Copy properties from the Maven project to the Ant project. + * + * @param mavenProject {@link MavenProject} + * @param antProject {@link Project} + */ + public void copyProperties( MavenProject mavenProject, Project antProject ) + { + Properties mavenProps = mavenProject.getProperties(); + Properties userProps = session.getUserProperties(); + List allPropertyKeys = new ArrayList<>( mavenProps.stringPropertyNames() ); + allPropertyKeys.addAll( userProps.stringPropertyNames() ); + for ( String key : allPropertyKeys ) + { + String value = userProps.getProperty( key, mavenProps.getProperty( key ) ); + antProject.setProperty( key, value ); + } + + // Set the POM file as the ant.file for the tasks run directly in Maven. + antProject.setProperty( "ant.file", mavenProject.getFile().getAbsolutePath() ); + + // Add some of the common Maven properties + getLog().debug( "Setting properties with prefix: " + propertyPrefix ); + antProject.setProperty( ( propertyPrefix + "project.groupId" ), mavenProject.getGroupId() ); + antProject.setProperty( ( propertyPrefix + "project.artifactId" ), mavenProject.getArtifactId() ); + antProject.setProperty( ( propertyPrefix + "project.name" ), mavenProject.getName() ); + if ( mavenProject.getDescription() != null ) + { + antProject.setProperty( ( propertyPrefix + "project.description" ), mavenProject.getDescription() ); + } + antProject.setProperty( ( propertyPrefix + "project.version" ), mavenProject.getVersion() ); + antProject.setProperty( ( propertyPrefix + "project.packaging" ), mavenProject.getPackaging() ); + antProject.setProperty( ( propertyPrefix + "project.build.directory" ), + mavenProject.getBuild().getDirectory() ); + antProject.setProperty( ( propertyPrefix + "project.build.outputDirectory" ), + mavenProject.getBuild().getOutputDirectory() ); + antProject.setProperty( ( propertyPrefix + "project.build.testOutputDirectory" ), + mavenProject.getBuild().getTestOutputDirectory() ); + antProject.setProperty( ( propertyPrefix + "project.build.sourceDirectory" ), + mavenProject.getBuild().getSourceDirectory() ); + antProject.setProperty( ( propertyPrefix + "project.build.testSourceDirectory" ), + mavenProject.getBuild().getTestSourceDirectory() ); + antProject.setProperty( ( propertyPrefix + "localRepository" ), localRepository.toString() ); + antProject.setProperty( ( propertyPrefix + "settings.localRepository" ), localRepository.getBasedir() ); + + // Add properties for dependency artifacts + Set depArtifacts = mavenProject.getArtifacts(); + for ( Artifact artifact : depArtifacts ) + { + String propName = artifact.getDependencyConflictId(); + + antProject.setProperty( propertyPrefix + propName, artifact.getFile().getPath() ); + } + + // Add a property containing the list of versions for the mapper + StringBuilder versionsBuffer = new StringBuilder(); + for ( Artifact artifact : depArtifacts ) + { + versionsBuffer.append( artifact.getVersion() ).append( File.pathSeparator ); + } + antProject.setProperty( versionsPropertyName, versionsBuffer.toString() ); + } + + /** + * Copy properties from the Ant project to the Maven project. + * + * @param antProject not null + * @param mavenProject not null + * @since 1.7 + */ + public void copyProperties( Project antProject, MavenProject mavenProject ) + { + if ( !exportAntProperties ) + { + return; + } + + getLog().debug( "Propagated Ant properties to Maven properties" ); + Hashtable antProps = antProject.getProperties(); + Properties mavenProperties = mavenProject.getProperties(); + + for ( Map.Entry entry : antProps.entrySet() ) + { + String key = entry.getKey(); + if ( mavenProperties.getProperty( key ) != null ) + { + getLog().debug( "Ant property '" + key + "=" + mavenProperties.getProperty( key ) + + "' clashs with an existing Maven property, SKIPPING this Ant property propagation." ); + continue; + } + // it is safe to call toString directly since the value cannot be null in Hashtable + mavenProperties.setProperty( key, entry.getValue().toString() ); + } + } + + /** + * @param antProject {@link Project} + */ + public void initMavenTasks( Project antProject ) + { + getLog().debug( "Initialize Maven Ant Tasks" ); + Typedef typedef = new Typedef(); + typedef.setProject( antProject ); + typedef.setResource( ANTLIB ); + + if ( getTaskPrefix() != null ) + { + typedef.setURI( TASK_URI ); + } + typedef.execute(); + } + + /** + * Write the Ant target and surrounding tags to a temporary file + * + * @throws IOException problem with write to file + */ + private File writeTargetToProjectFile( String targetName ) + throws IOException + { + // The fileName should probably use the plugin executionId instead of the targetName + File buildFile = new File( mavenProject.getBuild().getDirectory(), "antrun/build-" + targetName + ".xml" ); + // noinspection ResultOfMethodCallIgnored + buildFile.getParentFile().mkdirs(); + + AntrunXmlPlexusConfigurationWriter xmlWriter = new AntrunXmlPlexusConfigurationWriter(); + + String taskPrefix = getTaskPrefix(); + if ( taskPrefix != null ) + { + // replace namespace as Ant expects it to be + target.setAttribute( "xmlns:" + taskPrefix, TASK_URI ); + } + + xmlWriter.write( target, buildFile, "", targetName ); + + return buildFile; + } + + private String getTaskPrefix() + { + String taskPrefix = this.customTaskPrefix; + if ( taskPrefix == null ) + { + for ( String name : target.getAttributeNames() ) + { + if ( name.startsWith( "xmlns:" ) + && "http://maven.apache.org/ANTRUN".equals( target.getAttribute( name ) ) ) + { + taskPrefix = name.substring( "xmlns:".length() ); + break; + } + } + } + return taskPrefix; + } + + /** + * @param buildException not null + * @return the fragment XML part where the buildException occurs. + * @since 1.7 + */ + private String findFragment( BuildException buildException ) + { + if ( buildException == null || buildException.getLocation() == null + || buildException.getLocation().getFileName() == null ) + { + return null; + } + + File antFile = new File( buildException.getLocation().getFileName() ); + if ( !antFile.exists() ) + { + return null; + } + + try ( LineNumberReader reader = new LineNumberReader( ReaderFactory.newXmlReader( antFile ) ) ) + { + for ( String line = reader.readLine(); line != null; line = reader.readLine() ) + { + if ( reader.getLineNumber() == buildException.getLocation().getLineNumber() ) + { + return "around Ant part ..." + line.trim() + "... @ " + buildException.getLocation().getLineNumber() + + ":" + buildException.getLocation().getColumnNumber() + " in " + antFile.getAbsolutePath(); + + } + } + } + catch ( Exception e ) + { + getLog().debug( e.getMessage(), e ); + } + + return null; + } +} diff -Nru maven-antrun-plugin-1.8/src/main/java/org/apache/maven/plugins/antrun/AntrunXmlPlexusConfigurationWriter.java maven-antrun-plugin-3.1.0/src/main/java/org/apache/maven/plugins/antrun/AntrunXmlPlexusConfigurationWriter.java --- maven-antrun-plugin-1.8/src/main/java/org/apache/maven/plugins/antrun/AntrunXmlPlexusConfigurationWriter.java 1970-01-01 00:00:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/main/java/org/apache/maven/plugins/antrun/AntrunXmlPlexusConfigurationWriter.java 2022-04-18 19:39:57.000000000 +0000 @@ -0,0 +1,118 @@ +package org.apache.maven.plugins.antrun; + +/* + * 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.codehaus.plexus.configuration.PlexusConfiguration; +import org.codehaus.plexus.util.xml.Xpp3DomUtils; +import org.codehaus.plexus.util.xml.pull.MXSerializer; +import org.codehaus.plexus.util.xml.pull.XmlSerializer; + +import java.io.BufferedOutputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** + * Write the Ant target Plexus configuration to an XML file. + */ +class AntrunXmlPlexusConfigurationWriter +{ + + private static final Set EXCLUDED_ATTRIBUTES = + new HashSet<>( Arrays.asList( Xpp3DomUtils.CHILDREN_COMBINATION_MODE_ATTRIBUTE, + Xpp3DomUtils.SELF_COMBINATION_MODE_ATTRIBUTE ) ); + + /** + * @param configuration {@link PlexusConfiguration} + * @param file File to write the Plexus configuration to. + * @param customTaskPrefix Prefix to use for the custom Ant tasks. Empty if no prefix should be used. + * @param antTargetName Name of the default Ant target. + * @throws IOException In case of problems. + */ + public void write( PlexusConfiguration configuration, File file, String customTaskPrefix, String antTargetName ) + throws IOException + { + MXSerializer serializer = new MXSerializer(); + serializer.setProperty( "http://xmlpull.org/v1/doc/properties.html#serializer-line-separator", + System.getProperty( "line.separator" ) ); + serializer.setProperty( "http://xmlpull.org/v1/doc/properties.html#serializer-indentation", " " ); + try ( BufferedOutputStream bos = new BufferedOutputStream( new FileOutputStream( file ) ) ) + { + serializer.setOutput( bos, AntRunMojo.UTF_8 ); + serializer.startDocument( AntRunMojo.UTF_8, null ); + if ( !customTaskPrefix.isEmpty() ) + { + serializer.setPrefix( customTaskPrefix, AntRunMojo.TASK_URI ); + } + serializer.startTag( null, "project" ); + serializer.attribute( null, "name", "maven-antrun-" ); + serializer.attribute( null, "default", antTargetName ); + write( configuration, serializer ); + serializer.endTag( null, "project" ); + serializer.endDocument(); + } + } + + private void write( PlexusConfiguration c, XmlSerializer serializer ) + throws IOException + { + serializer.startTag( null, c.getName() ); + writeAttributes( c, serializer ); + + int count = c.getChildCount(); + if ( count == 0 ) + { + String value = c.getValue(); + if ( value != null ) + { + serializer.text( value ); + } + } + else + { + for ( int i = 0; i < count; i++ ) + { + PlexusConfiguration child = c.getChild( i ); + write( child, serializer ); + } + } + + serializer.endTag( null, c.getName() ); + } + + private void writeAttributes( PlexusConfiguration c, XmlSerializer serializer ) + throws IOException + { + String[] names = c.getAttributeNames(); + + for ( String name : names ) + { + if ( !EXCLUDED_ATTRIBUTES.contains( name ) ) + { + serializer.attribute( null, name, c.getAttribute( name ) ); + } + } + } + +} + diff -Nru maven-antrun-plugin-1.8/src/main/java/org/apache/maven/plugins/antrun/MavenAntRunProject.java maven-antrun-plugin-3.1.0/src/main/java/org/apache/maven/plugins/antrun/MavenAntRunProject.java --- maven-antrun-plugin-1.8/src/main/java/org/apache/maven/plugins/antrun/MavenAntRunProject.java 1970-01-01 00:00:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/main/java/org/apache/maven/plugins/antrun/MavenAntRunProject.java 2022-04-18 19:39:57.000000000 +0000 @@ -0,0 +1,46 @@ +package org.apache.maven.plugins.antrun; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import org.apache.maven.project.MavenProject; + +/** + * Encapsulates a Maven project with an unsupported clone operation. This makes sure that, when used as a reference in + * an Ant project, it is passed by reference to sub-projects when inheritRefs is set to true + * (which would otherwise pass a clone). + * + * @author gboue + */ +public class MavenAntRunProject +{ + + private MavenProject mavenProject; + + public MavenAntRunProject( MavenProject mavenProject ) + { + this.mavenProject = mavenProject; + } + + public MavenProject getMavenProject() + { + return mavenProject; + } + +} diff -Nru maven-antrun-plugin-1.8/src/main/java/org/apache/maven/plugins/antrun/MavenLogger.java maven-antrun-plugin-3.1.0/src/main/java/org/apache/maven/plugins/antrun/MavenLogger.java --- maven-antrun-plugin-1.8/src/main/java/org/apache/maven/plugins/antrun/MavenLogger.java 1970-01-01 00:00:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/main/java/org/apache/maven/plugins/antrun/MavenLogger.java 2022-04-18 19:39:57.000000000 +0000 @@ -0,0 +1,64 @@ +package org.apache.maven.plugins.antrun; + +/* + * 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.PrintStream; + +import org.apache.maven.plugin.logging.Log; +import org.apache.tools.ant.DefaultLogger; +import org.apache.tools.ant.Project; + +/** + * Redirects build events from {@link DefaultLogger} to {@link Log}. + */ +public class MavenLogger + extends DefaultLogger +{ + + private final Log log; + + public MavenLogger( Log log ) + { + this.log = log; + } + + @Override + protected void printMessage( final String message, final PrintStream stream, final int priority ) + { + switch ( priority ) + { + case Project.MSG_ERR: + log.error( message ); + break; + case Project.MSG_WARN: + log.warn( message ); + break; + case Project.MSG_DEBUG: + case Project.MSG_VERBOSE: + log.debug( message ); + break; + case Project.MSG_INFO: + default: + log.info( message ); + break; + } + } + +} diff -Nru maven-antrun-plugin-1.8/src/main/mdo/antrun.mdo maven-antrun-plugin-3.1.0/src/main/mdo/antrun.mdo --- maven-antrun-plugin-1.8/src/main/mdo/antrun.mdo 1970-01-01 00:00:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/main/mdo/antrun.mdo 2022-04-18 19:39:57.000000000 +0000 @@ -0,0 +1,104 @@ + + + + + + antrun + AntRun + + + + package + org.apache.maven.plugins.antrun.taskconfig + + + + + + AttachArtifactConfiguration + + + + _file_placeholder + String + true + The file to attach to the project + + + classifier + String + A classifier assigned to the artifact + + + type + String + The type of the artifact, zip, war, etc + + + + + + + + + + + DependencyFilesetsConfiguration + + + prefix + String + String to prepend to all fileset IDs + + + projectDependenciesId + String + maven.project.dependencies + RefId for the fileset containing all project dependencies + + + scopes + String + Comma separated list of artifact scopes to include + + + types + String + Comma separated list of artifact types to include + + + + + \ No newline at end of file diff -Nru maven-antrun-plugin-1.8/src/site/apt/examples/classpaths.apt.vm maven-antrun-plugin-3.1.0/src/site/apt/examples/classpaths.apt.vm --- maven-antrun-plugin-1.8/src/site/apt/examples/classpaths.apt.vm 2010-11-29 20:16:10.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/site/apt/examples/classpaths.apt.vm 2022-04-18 19:39:57.000000000 +0000 @@ -3,7 +3,7 @@ ------ Carlos Sanchez, Franz Allan Valencia See ------ - 27 July 2006 + 2006-07-27 ------ ~~ Licensed to the Apache Software Foundation (ASF) under one @@ -24,7 +24,7 @@ ~~ under the License. ~~ NOTE: For help with the syntax of this file, see: - ~~ http://maven.apache.org/doxia/references/apt-format.html + ~~ https://maven.apache.org/doxia/references/apt-format.html Referencing the Maven Classpaths @@ -32,21 +32,21 @@ <>. For example, to show the path to a jar dependency with groupId "org.apache" and artifactId "common-util", the following could be used. ------- ++---+ #set( $D = '$' ) ------- - ++---+ + If the dependency includes a classifier, the classifier is appended to the property name. For example, groupId "org.apache", artifactId "common-util", type "jar", and classifier "jdk14". ------- ++---+ #set( $D = '$' ) ------- ++---+ - <> the old format "maven.dependency.groupId.artifactId[.classifier].type.path" has - been deprecated and should no longer be used. + <> the old format "maven.dependency.groupId.artifactId[.classifier].type.path" is not supported as of version + 3.0.0 of the plugin. You can also use these classpath references: @@ -61,7 +61,7 @@ For example, to display Maven's classpaths using antrun, we can do this ------- ++---+ 4.0.0 my-test-app @@ -102,11 +102,11 @@ ------- ++---+ or alternatively, we can use an external <<>>. ------- ++---+ 4.0.0 my-test-app @@ -145,11 +145,11 @@ ------- ++---+ The <<>>: ------- ++---+ @@ -163,5 +163,4 @@ ------- - ++---+ \ No newline at end of file diff -Nru maven-antrun-plugin-1.8/src/site/apt/examples/customTasks.apt.vm maven-antrun-plugin-3.1.0/src/site/apt/examples/customTasks.apt.vm --- maven-antrun-plugin-1.8/src/site/apt/examples/customTasks.apt.vm 2010-10-09 15:59:06.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/site/apt/examples/customTasks.apt.vm 2022-04-18 19:39:57.000000000 +0000 @@ -3,7 +3,7 @@ ------ Carlos Sanchez ------ - 15 July 2008 + 2008-07-15 ------ ~~ Licensed to the Apache Software Foundation (ASF) under one @@ -24,14 +24,14 @@ ~~ under the License. ~~ NOTE: For help with the syntax of this file, see: - ~~ http://maven.apache.org/doxia/references/apt-format.html + ~~ https://maven.apache.org/doxia/references/apt-format.html Using tasks not included in Ant's default jar To use Ant tasks not included in the Ant jar, like Ant optional or custom tasks you need to add the dependencies needed for the task to run to the plugin classpath and use the <<>> reference if needed. ------- ++---+ 4.0.0 my-test-app @@ -69,20 +69,59 @@ - commons-net - commons-net - 1.4.1 - - org.apache.ant ant-commons-net - 1.8.1 + 1.10.10 ++---+ ------- + Another example of this is the use of {{{http://ant-contrib.sourceforge.net/}Ant-Contrib}} tasks: ++---+ + + [...] + + [...] + + [...] + + org.apache.maven.plugins + maven-antrun-plugin + ${project.version} + + + [...] + + + + [...] + + + + run + + + + + + ant-contrib + ant-contrib + 1.0b3 + + + ant + ant + + + + + + + + ++---+ \ No newline at end of file diff -Nru maven-antrun-plugin-1.8/src/site/apt/examples/tasksAttributes.apt.vm maven-antrun-plugin-3.1.0/src/site/apt/examples/tasksAttributes.apt.vm --- maven-antrun-plugin-1.8/src/site/apt/examples/tasksAttributes.apt.vm 2014-10-27 20:08:22.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/site/apt/examples/tasksAttributes.apt.vm 2022-04-18 19:39:57.000000000 +0000 @@ -3,7 +3,7 @@ ------ Vincent Siveton ------ - September 2006 + 2006-09-30 ------ ~~ Licensed to the Apache Software Foundation (ASF) under one @@ -24,14 +24,14 @@ ~~ under the License. ~~ NOTE: For help with the syntax of this file, see: - ~~ http://maven.apache.org/doxia/references/apt-format.html + ~~ https://maven.apache.org/doxia/references/apt-format.html Using <<<\>>> Attributes You can specify attributes in the <<<\>>> configuration to execute or not Ant tasks depending some conditions. For example, to skip Ant call, you could add the following: ------- ++---+ ... @@ -62,4 +62,4 @@ ... ------- ++---+ diff -Nru maven-antrun-plugin-1.8/src/site/apt/index.apt.vm maven-antrun-plugin-3.1.0/src/site/apt/index.apt.vm --- maven-antrun-plugin-1.8/src/site/apt/index.apt.vm 2013-07-21 23:02:24.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/site/apt/index.apt.vm 2022-04-18 19:39:57.000000000 +0000 @@ -24,7 +24,7 @@ ~~ under the License. ~~ NOTE: For help with the syntax of this file, see: - ~~ http://maven.apache.org/doxia/references/apt-format.html + ~~ https://maven.apache.org/doxia/references/apt-format.html ${project.name} @@ -34,7 +34,7 @@ It is the intention of this plugin to provide a means of polluting the POM, so it's encouraged to move all your Ant tasks to a <<>> file and just call it from the POM using Ant's - {{{http://ant.apache.org/manual/Tasks/ant.html}\ task}}. + {{{https://ant.apache.org/manual/Tasks/ant.html}\ task}}. One of the main purposes of this plugin is to facilitate the migration from Ant based projects to Maven. Some projects may not currently be able to migrate @@ -45,25 +45,37 @@ * {{{./run-mojo.html}antrun:run}} runs Ant tasks for Maven. +* Major Version Upgrade to version 3.0.0 + + Please note that the following parameters have been completely removed from the plugin configuration: + + * <<>>: use <<>> instead; + + * <<>> and <<>>: you can use the + {{{https://www.mojohaus.org/build-helper-maven-plugin/}build-helper-maven-plugin}} instead, with its + {{{https://www.mojohaus.org/build-helper-maven-plugin/add-source-mojo.html}add-source}} and + {{{https://www.mojohaus.org/build-helper-maven-plugin/add-test-source-mojo.html}add-test-source}} goals. + + The format <<>> to reference the path of a project + dependency as an Ant property has been removed: use <<>> instead. + * Usage General instructions on how to use the AntRun Plugin can be found on the {{{./usage.html}usage page}}. Some more - specific use cases are described in the examples given below. Last but not least, users occasionally contribute - additional examples, tips or errata to the - {{{http://docs.codehaus.org/display/MAVENUSER/Antrun+Plugin}plugin's wiki page}}. + specific use cases are described in the examples given below. In case you still have questions regarding the plugin's usage, please have a look at the {{{./faq.html}FAQ}} and feel - free to contact the {{{./mail-lists.html}user mailing list}}. The posts to the mailing list are archived and could + free to contact the {{{./mailing-lists.html}user mailing list}}. The posts to the mailing list are archived and could already contain the answer to your question as part of an older thread. Hence, it is also worth browsing/searching - the {{{./mail-lists.html}mail archive}}. + the {{{./mailing-lists.html}mail archive}}. If you feel like the plugin is missing a feature or has a defect, you can fill a feature request or bug report in our - {{{./issue-tracking.html}issue tracker}}. When creating a new issue, please provide a comprehensive description of your + {{{./issue-management.html}issue tracker}}. When creating a new issue, please provide a comprehensive description of your concern. Especially for fixing bugs it is crucial that the developers can reproduce your problem. For this reason, entire debug logs, POMs or most preferably little demo projects attached to the issue are very much appreciated. Of course, patches are welcome, too. Contributors can check out the project from our - {{{./source-repository.html}source repository}} and will find supplementary information in the - {{{http://maven.apache.org/guides/development/guide-helping.html}guide to helping with Maven}}. + {{{./scm.html}source repository}} and will find supplementary information in the + {{{/guides/development/guide-helping.html}guide to helping with Maven}}. * Examples diff -Nru maven-antrun-plugin-1.8/src/site/apt/tasks/attachArtifact.apt.vm maven-antrun-plugin-3.1.0/src/site/apt/tasks/attachArtifact.apt.vm --- maven-antrun-plugin-1.8/src/site/apt/tasks/attachArtifact.apt.vm 2010-09-15 20:56:14.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/site/apt/tasks/attachArtifact.apt.vm 2022-04-18 19:39:57.000000000 +0000 @@ -3,7 +3,7 @@ ------ Paul Gier ------ - May 2010 + 2010-05-21 ------ ~~ Licensed to the Apache Software Foundation (ASF) under one @@ -24,7 +24,7 @@ ~~ under the License. ~~ NOTE: For help with the syntax of this file, see: - ~~ http://maven.apache.org/doxia/references/apt-format.html + ~~ https://maven.apache.org/doxia/references/apt-format.html AttachArtifact Task @@ -47,8 +47,8 @@ * Example This example shows how to use the <<>> task. - ------- + ++---+ org.apache.maven.plugins maven-antrun-plugin @@ -72,6 +72,4 @@ - ------- - ++---+ \ No newline at end of file diff -Nru maven-antrun-plugin-1.8/src/site/apt/tasks/dependencyFilesets.apt.vm maven-antrun-plugin-3.1.0/src/site/apt/tasks/dependencyFilesets.apt.vm --- maven-antrun-plugin-1.8/src/site/apt/tasks/dependencyFilesets.apt.vm 2010-09-15 20:56:14.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/site/apt/tasks/dependencyFilesets.apt.vm 2022-04-18 19:39:57.000000000 +0000 @@ -3,7 +3,7 @@ ------ Paul Gier ------ - March 2010 + 2010-03-19 ------ ~~ Licensed to the Apache Software Foundation (ASF) under one @@ -24,7 +24,7 @@ ~~ under the License. ~~ NOTE: For help with the syntax of this file, see: - ~~ http://maven.apache.org/doxia/references/apt-format.html + ~~ https://maven.apache.org/doxia/references/apt-format.html DependencyFilesets Task @@ -54,8 +54,8 @@ * Example This example shows how to access individual dependencies and the combined dependency fileset. - ------- + ++---+ org.apache.maven.plugins maven-antrun-plugin @@ -69,23 +69,23 @@
- + - + - + ------- ++---+ diff -Nru maven-antrun-plugin-1.8/src/site/apt/tasks/tasks.apt.vm maven-antrun-plugin-3.1.0/src/site/apt/tasks/tasks.apt.vm --- maven-antrun-plugin-1.8/src/site/apt/tasks/tasks.apt.vm 2010-05-21 21:04:32.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/site/apt/tasks/tasks.apt.vm 2022-04-18 19:39:57.000000000 +0000 @@ -3,7 +3,7 @@ ------ Paul Gier ------ - March 2010 + 2010-03-19 ------ ~~ Licensed to the Apache Software Foundation (ASF) under one @@ -24,7 +24,7 @@ ~~ under the License. ~~ NOTE: For help with the syntax of this file, see: - ~~ http://maven.apache.org/doxia/references/apt-format.html + ~~ https://maven.apache.org/doxia/references/apt-format.html Ant Tasks diff -Nru maven-antrun-plugin-1.8/src/site/apt/tasks/versionMapper.apt.vm maven-antrun-plugin-3.1.0/src/site/apt/tasks/versionMapper.apt.vm --- maven-antrun-plugin-1.8/src/site/apt/tasks/versionMapper.apt.vm 2010-09-15 20:56:14.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/site/apt/tasks/versionMapper.apt.vm 2022-04-18 19:39:57.000000000 +0000 @@ -3,7 +3,7 @@ ------ Paul Gier ------ - May 2010 + 2010-05-21 ------ ~~ Licensed to the Apache Software Foundation (ASF) under one @@ -24,7 +24,7 @@ ~~ under the License. ~~ NOTE: For help with the syntax of this file, see: - ~~ http://maven.apache.org/doxia/references/apt-format.html + ~~ https://maven.apache.org/doxia/references/apt-format.html VersionMapper @@ -34,8 +34,8 @@ * Example This example shows how to use the version mapper. - ------- + ++---+ org.apache.maven.plugins maven-antrun-plugin @@ -51,7 +51,7 @@ @@ -65,5 +65,5 @@ ------- ++---+ diff -Nru maven-antrun-plugin-1.8/src/site/apt/usage.apt.vm maven-antrun-plugin-3.1.0/src/site/apt/usage.apt.vm --- maven-antrun-plugin-1.8/src/site/apt/usage.apt.vm 2014-10-27 20:31:50.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/site/apt/usage.apt.vm 2022-04-18 19:39:57.000000000 +0000 @@ -3,7 +3,7 @@ ------ Kenney Westerhof, Franz Allan Valencia See, Vincent Siveton ------ - September 2006 + 2006-09-30 ------ ~~ Licensed to the Apache Software Foundation (ASF) under one @@ -24,7 +24,7 @@ ~~ under the License. ~~ NOTE: For help with the syntax of this file, see: - ~~ http://maven.apache.org/doxia/references/apt-format.html + ~~ https://maven.apache.org/doxia/references/apt-format.html Usage @@ -38,7 +38,7 @@ it would not do anything). Below is the template for <<>>'s <<>>. ------- ++---+ [...] @@ -70,7 +70,7 @@ [...] ------- ++---+ Moreover, you can add a script to each lifecycle phase, by duplicating the <<<\>>> section and specifying a new phase. @@ -78,7 +78,7 @@ Ultimately, you could specify some Ant {{{http://ant.apache.org/manual/using.html#targets}<<<\>>>}} attributes in the <<<\>>> tag. Only <<>> attribute in Ant <<<\>>> is not wrapped. ------- ++---+ [...] [...] ------- ++----+ * Additional source directories If your Ant tasks generate additional source code that needs to be added to the build, you can use the - {{{http://mojo.codehaus.org/build-helper-maven-plugin/}build-helper-maven-plugin}}. - The sourceRoot and testSourceRoot options of the antrun plugin have been deprecated. + {{{http://www.mojohaus.org/build-helper-maven-plugin/}build-helper-maven-plugin}}. + The <<>> and <<>> options of the antrun plugin are removed as of version 3.0.0. * Using Maven properties @@ -123,10 +123,10 @@ If the Maven property you want to use is not available in an external file, you will have to redefine the property before calling . ------- ++---+ ------- ++---+ * Ant Expressions to Maven Expressions Mapping @@ -143,7 +143,7 @@ *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-antrun-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ -| <<>> | {{{http://maven.apache.org/guides/introduction/introduction-to-profiles.html}<<>>}} | +| <<>> | {{{/guides/introduction/introduction-to-profiles.html}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-assembly-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ @@ -151,7 +151,7 @@ *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-assembly-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ -| <<>> | {{{http://maven.apache.org/guides/introduction/introduction-to-profiles.html}<<>>}} | +| <<>> | {{{/guides/introduction/introduction-to-profiles.html}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-resources-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ diff -Nru maven-antrun-plugin-1.8/src/site/fml/faq.fml maven-antrun-plugin-3.1.0/src/site/fml/faq.fml --- maven-antrun-plugin-1.8/src/site/fml/faq.fml 2009-08-05 12:34:33.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/site/fml/faq.fml 2022-04-18 19:39:57.000000000 +0000 @@ -35,18 +35,6 @@ corresponding Maven expressions.

- - Why is antrun not correctly handling my plugin dependency in a multi-module build? - -

There is a problem in some versions of Maven (earlier than 3.0-alpha-1) that prevent Maven from correctly resolving - plugin dependencies in a multi-module build (MNG-1323). This means that if you have multiple - modules in your project and the antrun plugin declares a different set of dependencies, only the first - declaration found will be used.

-

The workaround for this is to specify the same set of plugin dependencies for all declarations of the - antrun plugin. Another option is to move the plugin dependencies to the project level and set the - scope to "provided". For more information, see MANTRUN-51 and MANTRUN-106.

-
-
diff -Nru maven-antrun-plugin-1.8/src/site/site.xml maven-antrun-plugin-3.1.0/src/site/site.xml --- maven-antrun-plugin-1.8/src/site/site.xml 2014-05-11 16:14:19.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/site/site.xml 2022-04-18 19:39:57.000000000 +0000 @@ -19,12 +19,19 @@ under the License. --> - + xsi:schemaLocation="http://maven.apache.org/DECORATION/1.8.0 http://maven.apache.org/xsd/decoration-1.8.0.xsd"> + + + org.apache.maven.skins + maven-fluido-skin + 1.9 + + - + @@ -33,8 +40,8 @@ - - + + diff -Nru maven-antrun-plugin-1.8/src/site/xdoc/download.xml.vm maven-antrun-plugin-3.1.0/src/site/xdoc/download.xml.vm --- maven-antrun-plugin-1.8/src/site/xdoc/download.xml.vm 2014-05-14 18:42:29.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/site/xdoc/download.xml.vm 2022-04-18 19:39:57.000000000 +0000 @@ -33,13 +33,13 @@ hours to reach all mirrors.

In order to guard against corrupted downloads/installations, it is highly recommended to - verify the signature - of the release bundles against the public KEYS used by the Apache Maven + verify the signature + of the release bundles against the public KEYS used by the Apache Maven developers.

-

${project.name} is distributed under the Apache License, version 2.0.

+

${project.name} is distributed under the Apache License, version 2.0.

-

We strongly encourage our users to configure a Maven repository mirror closer to their location, please read How to Use Mirrors for Repositories.

+

We strongly encourage our users to configure a Maven repository mirror closer to their location, please read How to Use Mirrors for Repositories.

@@ -85,8 +85,7 @@

You may also consult the - complete list of - mirrors. + complete list of mirrors.

@@ -108,8 +107,8 @@ ${project.name} ${project.version} (Source zip) maven/plugins/${project.artifactId}-${project.version}-source-release.zip - maven/plugins/${project.artifactId}-${project.version}-source-release.zip.md5 - maven/plugins/${project.artifactId}-${project.version}-source-release.zip.asc + maven/plugins/${project.artifactId}-${project.version}-source-release.zip.sha512 + maven/plugins/${project.artifactId}-${project.version}-source-release.zip.asc @@ -117,7 +116,7 @@ -

Older non-recommended releases can be found on our archive site.

+

Older non-recommended releases can be found on our archive site.

diff -Nru maven-antrun-plugin-1.8/src/test/java/org/apache/maven/plugins/antrun/AntrunXmlPlexusConfigurationWriterTest.java maven-antrun-plugin-3.1.0/src/test/java/org/apache/maven/plugins/antrun/AntrunXmlPlexusConfigurationWriterTest.java --- maven-antrun-plugin-1.8/src/test/java/org/apache/maven/plugins/antrun/AntrunXmlPlexusConfigurationWriterTest.java 1970-01-01 00:00:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/test/java/org/apache/maven/plugins/antrun/AntrunXmlPlexusConfigurationWriterTest.java 2022-04-18 19:39:57.000000000 +0000 @@ -0,0 +1,128 @@ +package org.apache.maven.plugins.antrun; + +/* + * 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.codehaus.plexus.configuration.PlexusConfiguration; +import org.codehaus.plexus.configuration.xml.XmlPlexusConfiguration; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; +import org.xmlunit.builder.Input; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.xmlunit.matchers.CompareMatcher.isIdenticalTo; + +/** + * Test class for {@link AntrunXmlPlexusConfigurationWriter}. + * @author gboue + */ +public class AntrunXmlPlexusConfigurationWriterTest +{ + + private static final String TARGET_NAME = "main"; + + @TempDir + Path folder; + + private AntrunXmlPlexusConfigurationWriter configurationWriter; + + private PlexusConfiguration configuration; + + private File file; + + @BeforeEach + void setUp() + throws IOException + { + configurationWriter = new AntrunXmlPlexusConfigurationWriter(); + configuration = new XmlPlexusConfiguration( "target" ); + configuration.setAttribute( "name", TARGET_NAME ); + file = Files.createTempFile(folder, "junit", "antrun").toFile(); + } + + /** + * Tests that the XML file produced with the writer is pretty printed and that basic attributes are kept. + * + * @throws IOException In case of problems + */ + @Test + public void testBasic() throws IOException + { + configuration.getChild( "echo", true ).setAttribute( "message", "Hello" ); + configurationWriter.write( configuration, file, "", TARGET_NAME ); + assertXmlIsExpected( "/configuration-writer/basic.xml", file ); + } + + /** + * Tests that serialization is correct even if Ant target is empty (no children, no attributes except name). + * + * @throws IOException In case of problems + */ + @Test + public void testEmptyTarget() throws IOException + { + configurationWriter.write( configuration, file, "", TARGET_NAME ); + assertXmlIsExpected( "/configuration-writer/empty-target.xml", file ); + } + + /** + * Tests that setting a custom prefix ends up in the project namespace in the target element with the correct name. + * + * @throws IOException In case of problems + */ + @Test + public void testCustomTaskPrefix() throws IOException + { + PlexusConfiguration child = configuration.getChild( "mvn:foo", true ); + child.setAttribute( "attr1", "val1" ); + child.setValue( "The first value." ); + child = configuration.getChild( "bar", true ); + child.setAttribute( "attr2", "val2" ); + child.setValue( "The second value." ); + configurationWriter.write( configuration, file, "mvn", TARGET_NAME ); + assertXmlIsExpected( "/configuration-writer/custom-task-prefix.xml", file ); + } + + /** + * Tests that combine.children and combine.self attributes in the XML configuration elements are ignored during + * serialization. + * + * @throws IOException In case of problems + */ + @Test + public void testCombineAttributes() throws IOException + { + configuration.setAttribute( "combine.children", "append" ); + configuration.setAttribute( "description", "foo" ); + configuration.getChild( "child", true ).setAttribute( "combine.self", "override" ); + configurationWriter.write( configuration, file, "", TARGET_NAME ); + assertXmlIsExpected( "/configuration-writer/combine-attributes.xml", file ); + } + + private void assertXmlIsExpected( String expected, File file ) + { + assertThat( Input.from( file ), isIdenticalTo( Input.from( getClass().getResourceAsStream( expected ) ) ) ); + } +} diff -Nru maven-antrun-plugin-1.8/src/test/resources/configuration-writer/basic.xml maven-antrun-plugin-3.1.0/src/test/resources/configuration-writer/basic.xml --- maven-antrun-plugin-1.8/src/test/resources/configuration-writer/basic.xml 1970-01-01 00:00:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/test/resources/configuration-writer/basic.xml 2022-04-18 19:39:57.000000000 +0000 @@ -0,0 +1,6 @@ + + + + + + diff -Nru maven-antrun-plugin-1.8/src/test/resources/configuration-writer/combine-attributes.xml maven-antrun-plugin-3.1.0/src/test/resources/configuration-writer/combine-attributes.xml --- maven-antrun-plugin-1.8/src/test/resources/configuration-writer/combine-attributes.xml 1970-01-01 00:00:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/test/resources/configuration-writer/combine-attributes.xml 2022-04-18 19:39:57.000000000 +0000 @@ -0,0 +1,6 @@ + + + + + + diff -Nru maven-antrun-plugin-1.8/src/test/resources/configuration-writer/custom-task-prefix.xml maven-antrun-plugin-3.1.0/src/test/resources/configuration-writer/custom-task-prefix.xml --- maven-antrun-plugin-1.8/src/test/resources/configuration-writer/custom-task-prefix.xml 1970-01-01 00:00:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/test/resources/configuration-writer/custom-task-prefix.xml 2022-04-18 19:39:57.000000000 +0000 @@ -0,0 +1,7 @@ + + + + The first value. + The second value. + + diff -Nru maven-antrun-plugin-1.8/src/test/resources/configuration-writer/empty-target.xml maven-antrun-plugin-3.1.0/src/test/resources/configuration-writer/empty-target.xml --- maven-antrun-plugin-1.8/src/test/resources/configuration-writer/empty-target.xml 1970-01-01 00:00:00.000000000 +0000 +++ maven-antrun-plugin-3.1.0/src/test/resources/configuration-writer/empty-target.xml 2022-04-18 19:39:57.000000000 +0000 @@ -0,0 +1,4 @@ + + + +