Details
-
Wish
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.0.6
-
None
-
Solaris 10, Ant 1.7.0, Maven Antlib 2.0.4
Description
In the Maven Antlib 2.0.4 with Ant 1.7.0 when using the <dependencies> task with the pathId attribute:
<dependencies pathId="compile.path">
...
<dependencies>
The following error is raised if a "compile.path" reference already exists:
[maven:dependencies] An error has occurred while processing the Maven artifact tasks.
[maven:dependencies] Diagnosis:
[maven:dependencies]
[maven:dependencies] Reference ID compile.path already exists
In fact the error is raised even if the "compile.path" reference is defiend in another target whcih is not executed at runtime. This is due to Ant 1.7.0 which resolves references at parsing time so when the <dependencies> task get executed the "compile.path" reference already exists and the Maven <dependencies> task fails.
Other Ant tasks like the <path> task do not fail when a reference is already defined. They simply override the reference.
The maven :dependencies task should mimic the Ant <path> behaviour and accept to override a reference which is already defined.
This could be implemented by removing the following code from the DependenciesTask.doExecute() method:
if ( pathId != null && getProject().getReference( pathId ) != null )
{ throw new BuildException( "Reference ID " + pathId + " already exists" ); }}
Attachments
Issue Links
- is duplicated by
-
MANTTASKS-70 m2 tasks not reentrant
- Closed