[ 
https://issues.apache.org/jira/browse/MANTRUN-181?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16028571#comment-16028571
 ] 

Hudson commented on MANTRUN-181:
--------------------------------

SUCCESS: Integrated in Jenkins build maven-plugins #8971 (See 
[https://builds.apache.org/job/maven-plugins/8971/])
[MANTRUN-181] AttachArtifact task does not work in external Ant build file

When the run goal executes an Ant task that calls an external Ant build file, 
Ant creates a sub-project of the main Ant project that was created for the 
(parent) Ant task. However, the project's references are not passed to the 
sub-project, meaning that whatever Maven added as a reference to the main 
project is lost when calling the external build file. This notably includes the 
"maven.project" and "maven.project.helper" references that are needed for the 
'attachartifact' built-in task to work.

This is resolved by overriding the way of creating sub-projects, so that 
references added to an Ant project by Maven are passed to any sub-projects. 
(gboue: [http://svn.apache.org/viewvc/?view=rev&rev=1796671])
* (add) maven-antrun-plugin/src/it/attach-artifact-from-ant-task
* (add) maven-antrun-plugin/src/it/attach-artifact-from-ant-task/build.xml
* (add) 
maven-antrun-plugin/src/it/attach-artifact-from-ant-task/invoker.properties
* (add) maven-antrun-plugin/src/it/attach-artifact-from-ant-task/pom.xml
* (add) maven-antrun-plugin/src/it/attach-artifact-from-ant-task/test.txt
* (add) maven-antrun-plugin/src/it/attach-artifact-from-ant-task/verify.bsh
* (edit) 
maven-antrun-plugin/src/main/java/org/apache/maven/plugin/antrun/AntRunMojo.java
* (add) 
maven-antrun-plugin/src/main/java/org/apache/maven/plugin/antrun/MavenAntRunProject.java


> AttachArtifact task does not work in external Ant build file
> ------------------------------------------------------------
>
>                 Key: MANTRUN-181
>                 URL: https://issues.apache.org/jira/browse/MANTRUN-181
>             Project: Maven Antrun Plugin
>          Issue Type: Bug
>    Affects Versions: 1.5, 1.6, 1.7
>            Reporter: Anton Khitrenovich
>         Attachments: MyProject.zip
>
>
> AttachArtifact task fails with an error if used in external Ant build file:
> {code}
> [ERROR] Failed to execute goal 
> org.apache.maven.plugins:maven-antrun-plugin:1.7:run (call-build) on project 
> my-test-project: An Ant BuildException has occured: The following error 
> occurred while executing this line:
> [ERROR] C:\...\MyProject\build.xml:5: Maven project reference not found: 
> maven.project
> [ERROR] around Ant part ...<ant antfile="build.xml" target="mytarget"/>... @ 
> 4:47 in C:\...\MyProject\target\antrun\build-main.xml
> {code}
> Setting {{inheritRefs="true"}} eliminates the error, but even then the 
> artifact is not attached.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to