I've got a Maven project and we want to build two separate jars, one containing 32-bit libraries and one containing 64-bit libraries.
Our current build will produce either 32 or 64-bit artifacts depending on the operating system on which the build is run.
An overview of how we're currently set up:
<properties>
<env.arch>${sun.arch.data.model}</env.arch>
</properties>
<build>
<pluginManagement>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-native</id>
<phase>process-resources</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>artifact-for-${env.arch}</groupId>
<artifactId>artifact.name</artifactId>
</artifactItem>
...
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
</execution>
</executions>
So what it's doing is copying the dependencies that match the value of our property for ${env.arch}
, then building the jar using the maven-jar-plugin
.
What we need to be able to do is produce 2 jars from one build... one containing the 32 bit dependencies and one containing the 64 bit dependencies.
Can anyone offer any guidance to how we can get this done?
Thanks