You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Guillaume Polet <gu...@agilebirds.com> on 2011/07/12 18:29:59 UTC

Maven ant run: Reference maven.plugin.classpath not found.

Hi List,

I know that this question has been asked several times, but after 
googling a bit, I could not find any solution to my error.
I am using maven ant-run plugin to execute a ant file. Here is what my 
build section looks like:
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>build</id>
<phase>package</phase>
<configuration>
<target>
<ant inheritRefs="true" inheritall="true" antfile="build.xml" 
target="deploy" />
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-ant-tasks</artifactId>
<version>2.1.3</version>
</dependency>
</dependencies>
</plugin>
</plugins>

Within my ant file, I have declared the following:
<project name="project" default="package" basedir="." 
xmlns:artifact="antlib:org.apache.maven.artifact.ant">
     ...
<typedef resource="org/apache/maven/artifact/ant/antlib.xml" 
uri="antlib:org.apache.maven.artifact.ant" 
classpathref="maven.plugin.classpath"/>
...
</project>

And when I run �mvn clean install�, I constantly get an error: Reference 
maven.plugin.classpath not found.
I have tried using an embedded classpath tag instead of the classpathref 
attribute. I can't get it to work. I saw a few solutions using a file 
based classpathrefs, but I would rather not do that since it would imply 
that I would have to maintain the dependencies of the additional Ant 
tasks myself, which I am quite reluctant to do.

I have attached a simple project that reproduce my error.

Cheers,
Guillaume
P.S: I know that it is weird to use maven ant tasks within a maven 
build, but I got my reasons.