aspose file tools*
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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
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>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Maven removes classifiers from the dependency jar while deploying
 
Similar Threads
Unable to create one single jar file in maven with dependencies included inside
Filtering problem using maven-read-properties plugin in pom.xml file
Tomcat and Axis2
Strange problem - works on maven glassfish but not on Tomcat
java classes not found in WEB-INF in maven build