Affects Version/s: 1.7
Fix Version/s: None
Number of attachments :
The plugin:plugin goal is written as follows:
<goal name="plugin:plugin" description="Build a plugin jar">
<!-- For some reason a prereq on this causes an internal error... -->
<attainGoal name="jar:jar" />
<!-- We can't use it in the bootstrap phase because classes aren't yet build in the artifact plugin -->
<assert:assertPluginAvailable groupId="maven" artifactId="maven-artifact-plugin" minRelease="1.7" neededBy="$
<ant:setProperty name="includes" value="project.xml" />
The idea here is first to build an ordinary jar, and then update its project.xml by using the rewritten version.
This didn't work as expected in my system, because the jar generation and POM rewriting happens too quickly,
they get the same (or at least very similar) timestamp — note that zip file only maintains timestamp in
2 sec precision.
So when this runs the <jar> task to update project.xml, Ant actually skips the processing, saying project.xml
is up to date.
One simple but stupid way to fix this is to insert a delay before rewriting POM, like:
<ant:sleep seconds="3" />
Or alternatively I guess one can unjar, use <copy> to overwrite, then update.