This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Ant, Maven and Other Build Tools and the fly likes Maven removes classifiers from the dependency jar while deploying Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Maven removes classifiers from the dependency jar while deploying" Watch "Maven removes classifiers from the dependency jar while deploying" New topic
Author

Maven removes classifiers from the dependency jar while deploying

sandeeprajsingh tandon
Ranch Hand

Joined: Mar 06, 2009
Posts: 70
Hi ,
We are using a dependency inside project a called json-lib-2.4-jdk15.jar (contains version and classifer in its pom entry). While deploying the application(a.ear) in server the jar file name gets changed to json-lib-jdk15.jar(contains classifer in its name).
In the jar, a.jar->META-INF->MANIFEST.MF maven names it to
Class-Path: lib/json-lib.jar (no classifer and version)
This difference causes jar naming issue and hence the jar doesnot load in the classpath of the ear.

ANy idea how could i solve this.
We are using the following plugins
<code>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ejb-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>was6-maven-plugin</artifactId>
<executions>
<execution>
<id>websphere-ejb-deploy</id>
<goals>
<goal>ejbdeploy</goal>
</goals>
</execution>
</executions>
</plugin></code>,


sandeeprajsingh tandon
Ranch Hand

Joined: Mar 06, 2009
Posts: 70
Solved it,
Configured the maven ejb plugin like this, - the dashClassifier now forces the classifer to be appended in the jar and in the ear.
<code> <build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ejb-plugin</artifactId>
<configuration>
<archive>
<manifest>
<customClasspathLayout>lib/${artifact.artifactId}${dashClassifier?}.${artifact.extension}</customClasspathLayout>
<!-- customClasspathLayout>lib/${artifact.artifactId}-$artifact.classifier.${artifact.extension}</customClasspathLayout-->
</manifest>
</archive>
</configuration>
</plugin></code>
 
GeeCON Prague 2014
 
subject: Maven removes classifiers from the dependency jar while deploying