You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Tatar Kolos <ko...@tatar.hu> on 2013/04/24 16:31:46 UTC

antrun plugin dependency

Hello,

I have a multimodule project which uses the antrun plugin and uses some fancy 
taskdefs so I added ant-contrib as a dependency to the plugin.

For most projects this configuration works fine, however sometimes it fails 
with classpath problems. It looks like Maven simply doesn't make the dependency 
available in the classpath.

I've been playing around with this and for example the order of the modules in 
the parent pom seems to make this problem sometimes go away. :(

Anyone has any suggestions what to check?

We're using Maven 2.2.1 and we have to stick to this version for a good while. 
The problem doesn't happen with Maven3.

Thanks,

Kolos

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: antrun plugin dependency

Posted by Wayne Fay <wa...@gmail.com>.
> I have a multimodule project which uses the antrun plugin and uses some
> fancy taskdefs so I added ant-contrib as a dependency to the plugin.
>
> For most projects this configuration works fine, however sometimes it fails
> with classpath problems. It looks like Maven simply doesn't make the
> dependency available in the classpath.
In sufficiently old versions of Maven, the dependency list of the
"first" (seen) declaration of a plugin would "win" and be maintained
across all invocations of that plugin. So if only one Antrun plugin
declaration needs ant-contrib but it is seen after another Antrun
plugin declaration that did not depend on ant-contrib, then
ant-contrib would not be included in the classpath when it was needed
later.

I'm unsure when exactly this was fixed, but know it works in M3.

The easiest "fix" would be to add ant-contrib to the dependency list
for all antrun plugin invocations in your projects -or- simply move to
M3.

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org