Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Maven removes classifiers from the dependency jar while deploying

 
sandeeprajsingh tandon
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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>
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic