Part of our build process includes building a 3rd-party component. The build
of this component is in ant, and is very complicated (complicated enough that
building this component with maven is not an option). Currently, we use
maven-antrun-plugin with subant inside it to start the build. The packaging
for the maven build is set to "pom", so that maven doesn't try to
compile/jar/install/deploy the code itself, since it won't succeed. This works
fine, but we'd really like the artifacts from the ant build to be available in
the local respository, as if the whole build were in maven. Currently, we run
a separate mvn install:install command to do the installation to the local
repository - it would be nice if this were part of the normal lifecycle.
Is there a good way to install additional files (jars) during the install phase
of pom packaging? Should I be approaching this problem in a different way?
The pom that we're using looks something like:
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>myGroup</groupId>
<artifactId>ext</artifactId>
<packaging>pom</packaging>
<name>myComponent</name>
<version>1.0</version>
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>cleanAnt</id>
<phase>clean</phase>
<configuration>
<tasks>
<subant target="clean">
<fileset dir="." includes="build.xml"/>
</subant>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
<execution>
<id>compileAnt</id>
<phase>compile</phase>
<configuration>
<tasks>
<subant target="compile">
<fileset dir="." includes="build.xml"/>
</subant>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
<execution>
<id>deployAnt</id>
<phase>install</phase>
<configuration>
<tasks>
<subant target="deploy">
<fileset dir="." includes="build.xml"/>
</subant>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Thanks.
Nolan