<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
<configuration>
<tasks>
<echo>Hello</echo>
</tasks>
</configuration>
</plugin>
However, when I stepped back up to the parent project and ran the build, it failed with:
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Internal error in the plugin manager executing goal 'org.apache.maven.plugins:maven-antrun-plugin:1.0:run': Unable to find the mojo 'org.apache.maven.plugins:maven-antrun-plugin:1.0:run' in the plugin 'org.apache.maven.plugins:maven-antrun-plugin'
Component descriptor cannot be found in the component repository: org.apache.maven.plugin.Mojoorg.apache.maven.plugins:maven-antrun-plugin:1.0:run.
It turns out that when building from the parent build, XDOclet is used by certain sub-projects. XDoclet depends on the maven antrun plugin version 1.0. With Maven 2.0.4 the default antrun plugin is 1.1. Thus, a conflict arises.
Found this reference: http://jira.codehaus.org/browse/MANTRUN-37
While there is no fix (XDoclet can't [yet?] be modified to use antrun 1.1, there is a workaround: Simply specify version 1.0 of the antrun plugin. I did this in pluginManagement in my parent pom.xml:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.0</version>
</plugin>
2 comments:
Thanks for this workaround! It was really frustrating that antrun was working in isolation but breaking in my reactor project.
But the 1.0 version of antrun does not support the plugin scope dependency classpath.
I tried downloading the xdoclet plugin and changing its pom to use antrun 1.1 but this causes a null pointer exception.
Solution. Rebuild the xdoclet plugin but make it use antrun 1.2-SNAPSHOT, as that does work nicely. Time to pester the antrun maintainer to release 1.2, as its been on SNAPSHOT for a long time...
Post a Comment