Seems to make sense - please file it as a JIRA issue.

- Brett

On 01/02/2007, at 9:43 PM, Loic Jay wrote:

Hi,

I am using the Maven Antlib 2.0.4 with Ant 1.7.0 and when using the <dependency> task with the pathId attribute:

       <dependencies pathId="compile.path">
            ...
       <dependencies>

I get the following error:

[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 "compile.path" reference is already defined in another target but this target is not executed at runtime. However Ant 1.7.0 resolves this reference at parsing time so when the <dependencies> task get executed the "compile.path" reference already exists and the Maven <dependencies> task fails.

Is this behaviour the behaviour which is actually expected ? In fact I was quite surprised because other Ant tasks like the <path> task do not fail when a reference is already defined. They simply override the reference.

The maven :dependency behaviour would not be a problem if references were resolved at runtime but with the current Ant version the maven:dependencies task raises an exception while there is no actual conflict between the two references definitions given that only one reference is actually defined at runtime.

Do you think it would be possible to make the <dependencies> task behave like the Ant <path> task by removing the following code in the DependenciesTask ?

*if* ( pathId != *null* && getProject().getReference( pathId ) != *null* )
       {
*throw* *new* BuildException( *"Reference ID "* + pathId + *" already exists"* );
       }
}



Loïc


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to