On 04/26/2010 06:41 PM, Lorenzo Thurman wrote:
I'm just learning both Maven and Ant. I have a couple of weeks of working with 
Maven, but not I need to get it execute and Ant task. I know nothing about Ant, 
but using the antrun plugin for Maven, I've got things to the point where the 
task attempts to execute, but fails because it can't find a class which is 
contained within a jar file. The jar containing the class is actually 
referenced in the build.xml via classpath and classname tags. It seems to 
follow that if the Ant task can find the jar when running under Ant, it should 
do so when running via Maven, but that's not the case. So, my question is how 
do I pass a classpath variable to an Ant task from Maven? I case there are 
fundamental flaws in my approach, I've included both my pom.xml and the 
build.xml that should be executed.

List the jar file with the custom task as a dependency of the plugin:

<project>
        <modelVersion>4.0.0</modelVersion>
        <groupId>acquitygroup.AMA</groupId>
        <artifactId>AMA</artifactId>
        <version>1</version>
<profiles>
        <profile>
        <id>primary</id>
        <build>
        <plugins>
                <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <configuration>
                                <tasks>
                                        <ant antfile="src/AMA/modules/build.xml" 
/>
                                </tasks>
                        </configuration>
<dependencies>
<dependency>
<artifactId>...
  ...
</dependency>
</dependencies>
                </plugin>
        </plugins>
        </build>
        </profile>
        </profiles>
</project>


--
Someday we'll look back on this moment and plow into a parked car.
                -- Evan Davis

Eduardo M KALINOWSKI
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to