Michael Baessler wrote:
Marshall Schor wrote:
I am now having ant version level problems.  I posted the following
email to maven-users mailing list:
---------  copy of email to maven-users follows ---------------
We need to have the maven ant run plugin to run ant at version 1.7.0.

How should this be specified?

We tried putting in the POM:

     <plugin>
       <artifactId>maven-antrun-plugin</artifactId>
       <dependencies>
           <!-- Ant -->
           <dependency>
               <groupId>org.apache.ant</groupId>
               <artifactId>ant</artifactId>
               <version>1.7.0</version>
           </dependency>
           <dependency>
               <groupId>org.apache.ant</groupId>
               <artifactId>ant-launcher</artifactId>
               <version>1.7.0</version>
           </dependency>
         </dependencies>
         ...

But we get maven downloading ant 1.6.5:  see the --debug trace snippet
from a mvn run where ant was not in the local repository.  It seems to
ask for ant 1.7.0.  We're using repo1.maven.org/maven2   as the
repository - I looked there and the entry for
http://repo1.maven.org/maven2/ant/ant/1.7.0/ is there but only has a POM
- no "jar" files.  and there is no entry for the ant-launcher at 1.7.0
there.

Is there another repository we should be using to get this?

I'm surprised that this is being "resolved" using version 1.6.5, which
is below the 1.7.0 asked for - can someone explain that?

[DEBUG]
org.apache.maven.plugins:maven-antrun-plugin:maven-plugin:1.1:runtime
(selected for runtime)
[DEBUG] Retrieving parent-POM: org.apache.ant:ant-parent::1.7.0 for
project: org.apache.ant:ant:jar:1.7.0 from the repository.
[DEBUG]   org.apache.ant:ant:jar:1.7.0:compile (selected for compile)
[DEBUG]     org.apache.ant:ant-launcher:jar:1.7.0:compile (selected for
compile)
[DEBUG] Skipping disabled repository snapshots
[DEBUG] Trying repository central
Downloading: http://repo1.maven.org/maven2/ant/ant/1.6.5/ant-1.6.5.pom
764b downloaded
[DEBUG]   Artifact resolved
[DEBUG] Retrieving parent-POM: org.apache:apache::4 for project:
ant:ant:jar:1.6.5 from the repository.
[DEBUG]   ant:ant:jar:1.6.5:runtime (selected for
runtime)
Thanks.  -Marshall
The group ID is "org.apache.ant" When looking here
(http://repo1.maven.org/maven2/org/apache/ant/ant/1.7.0/), you will find
the ant 1.7.0 jar.

The download works fine for me.
I figured that out... It doesn't work reliably for me. I can get it to work sometimes. It seems to depend on an "arbitrary" ordering - both the 1.6.5 and the 1.7.0 jars appear in the "classpath". You can see this if you run

mvn assembly:assembly --debug

Can you do this and look for lines that look like:

[DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-antrun-plugin:1.1:run' --> [DEBUG] (f) artifacts = [ant:ant:jar:1.6.5:runtime, org.codehaus.plexus:plexus-utils:jar:1.1:runtime, ant:ant-launcher:jar:1.6.5:runtime, org.apache.maven:mav en-plugin-api:jar:2.0.1:runtime, org.apache.maven:maven-project:jar:2.0.1:runtime]
(this sample output just has the 1.6.5 version)

I think you'll find lines that show both 1.6.5 and 1.7.0 and the 1.7.0 is appearing first (for you - but sometimes 2nd for me...)

-Marshall

Reply via email to