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.
<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" />
<target name="package">
<artifact:dependencies filesetId="maven.artifact" addArtifactFileSetRefs="true">
<dependency groupId="jdom" artifactId="jdom" version="1.1" type="jar" />
</artifact:dependencies>
<copy todir="${basedir}/tmp">
<fileset refid="jdom:jdom:jar"/>
<mapper type="flatten" />
</copy>
</target>
</project>
<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>test</groupId>
<artifactId>test</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
<build>
<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="package" />
</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>
</build>
</project>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org