We use the appassembler plugin in our application. We are transitioning our maven configuration to create artifacts using classifiers that show what jdk was used to compile it. Prior to adding profiles and building classified jars, the appassembler happily made a script and built the proper class path to support the script.
However now that the artifact is being built with the classifier it is adding the wrong jar to its classpath. That is, it is referencing the right groupId, artifactId, and version, but without the classifier. How do I get appassembler to build the path correctly?
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>appassembler-maven-plugin</artifactId>
<version>1.9</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>assemble</goal>
</goals>
</execution>
</executions>
<configuration>
<programs>
<program>
<mainClass>com.package.ObjectClass</mainClass>
<name>ObjectClass</name>
</program>
</programs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>${maven.jar.version}</version>
<configuration>
<classifier>${jdk.version.display}</classifier>
</configuration>
</plugin>
Here is a generic example that shows the problem:
<project xmlns="http://maven.apache.org/POM/4.0.0" 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>test</groupId>
<artifactId>example</artifactId>
<version>1.0-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>appassembler-maven-plugin</artifactId>
<version>1.9</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>assemble</goal>
</goals>
</execution>
</executions>
<configuration>
<programs>
<program>
<mainClass>test.example.TestExample</mainClass>
<name>TestExample</name>
</program>
</programs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<configuration>
<classifier>myClassifier</classifier>
</configuration>
</plugin>
</plugins>
</build>