It is ignored because classifier
is NOT a parameter of deploy:deploy
which is the goal bound to the deploy
phase (it's a parameter of deploy:deploy-file
though).
Put the classifier in the configuration of the jar/war/ear plugin. Here is a pom.xml
simulating the desired behavior (you should probably use profiles):
<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>
<properties>
<jvmClassifier>jdk16</jvmClassifier>
</properties>
<groupId>com.stackoverflow.q3341837</groupId>
<artifactId>Q3341837</artifactId>
<version>1.0-SNAPSHOT</version>
<name>Q3341837</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.3.1</version>
<configuration>
<classifier>${jvmClassifier}</classifier>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.5</version>
<configuration>
<altDeploymentRepository>mine::default::file://${basedir}/target/my-repo</altDeploymentRepository>
</configuration>
</plugin>
</plugins>
</build>
</project>
Here is what I get after running mvn deploy
:
$ mvn clean deploy
...
$ tree target/my-repo/
target/my-repo/
└── com
└── stackoverflow
└── q3341837
└── Q3341837
├── 1.0-SNAPSHOT
│ ├── maven-metadata.xml
│ ├── maven-metadata.xml.md5
│ ├── maven-metadata.xml.sha1
│ ├── Q3341837-1.0-20100727.222050-1.pom
│ ├── Q3341837-1.0-20100727.222050-1.pom.md5
│ ├── Q3341837-1.0-20100727.222050-1.pom.sha1
│ ├── Q3341837-1.0-SNAPSHOT-jdk16.jar
│ ├── Q3341837-1.0-SNAPSHOT-jdk16.jar.md5
│ └── Q3341837-1.0-SNAPSHOT-jdk16.jar.sha1
├── maven-metadata.xml
├── maven-metadata.xml.md5
└── maven-metadata.xml.sha1