Hello,
I've come across a rather sever problem in our environment. We create
EAR-projects that contain WAR-modules and use the old-fashioned way to
handle skinny WAR-files by denoting the maven-war-plugin to exclude all
jar-files and rather put them in the EAR-lib-directory. This is done by
the following plugin configurations for EAR and WAR:
EAR-pom.xml
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<configuration>
<version>6</version>
<defaultLibBundleDir>lib/</defaultLibBundleDir>
<generateApplicationXml>true</generateApplicationXml>
<archive>
<manifestEntries>
<Implementation-Title>DAAS BE</
Implementation-Title>
<Implementation-Version>${project.version}
${timestamp}</Implementation-Version>
</manifestEntries>
</archive>
<security>
<security-role id="CONFIG">
<role-name>CONFIG</role-name>
</security-role>
<security-role id="WEBSERVICE_GET">
<role-name>WEBSERVICE_GET</role-name>
</security-role>
<security-role id="WEBSERVICE_SET">
<role-name>WEBSERVICE_SET</role-name>
</security-role>
</security>
<modules>
<webModule>
<groupId>daas-backend</groupId>
<artifactId>daas-backend-war</artifactId>
<contextRoot>Daas</contextRoot>
<bundleFileName>daas-backend-war.war</
bundleFileName>
</webModule>
<ejbModule>
<groupId>daas-backend</groupId>
<artifactId>daas-backend-system</artifactId>
<bundleFileName>daas-backend-system.jar</
bundleFileName>
</ejbModule>
</modules>
</configuration>
</plugin>
WAR-pom.xml:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<packagingExcludes>WEB-INF/lib/*.jar</
packagingExcludes>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
</manifest>
</archive>
</configuration>
</plugin>
However, in case a SNAPSHOT-version of a dependency is added to both, the
EAR and the WAR, the corresponding MANIFEST-ClassPath-Entry of the
dependency is created wrong as shown below:
Generated ClassPath:
Class-Path: daas-backend-system.jar lib/websphere-admin-client-2012.2.
0-SNAPSHOT.jar lib/logging-5.0.0.jar lib/util-5.0.0.jar lib/jaxb2-bas
ics-runtime-0.6.3.jar lib/websphere-admin-client-2012.2.0-20120822.03
1057-2.jar lib/poi-3.7.jar lib/commons-beanutils-1.8.3.jar lib/jbpm-j
pdl-4.5-20120709.122214-1.jar lib/jbpm-api-4.5-20120709.122204-2.jar
lib/jbpm-pvm-4.5-20120709.122211-1.jar lib/jbpm-log-4.5-20120709.1222
06-2.jar lib/hibernate-core-3.6.7.Final.jar lib/antlr-2.7.6.jar lib/c
ommons-collections-3.1.jar lib/dom4j-1.6.1.jar lib/hibernate-commons-
annotations-3.2.0.Final.jar lib/hibernate-jpa-2.0-api-1.0.1.Final.jar
lib/slf4j-api-1.6.1.jar lib/slf4j-jdk14-1.6.2.jar lib/commons-lang-2
.6.jar lib/soap-2.3.1.jar lib/guava-11.0.1.jar lib/jsr305-1.3.9.jar
Here the snapshots have been created as:
lib/websphere-admin-client-2012.2.0-20120822.031057-2.jar
lib/jbpm-jpdl-4.5-20120709.122214-1.jar
lib/jbpm-api-4.5-20120709.122204-2.jar
lib/jbpm-pvm-4.5-20120709.122211-1.jar
lib/jbpm-log-4.5-20120709.122206-2.jar
But the EAR-lib directory contains them as
lib/websphere-admin-client-SNAPSHOT.jar
lib/jbpm-jpdl-4.5-SNAPSHOT.jar
lib/jbpm-api-4.5-SNAPSHOT.jar
lib/jbpm-pvm-4.5-SNAPSHOT.jar
lib/jbpm-log-4.5-SNAPSHOT.jar
The only solution that I could think of to this is to manually add the
wrong dependencies by adding the following to the maven-war-plugin
configuration:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<packagingExcludes>WEB-INF/lib/*.jar</
packagingExcludes>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
</manifest>
<manifestEntries>
<Class-Path>daas-backend-system.jar
lib/websphere-admin-client-2012.2.0-SNAPSHOT.jar
lib/jbpm-api-4.5-SNAPSHOT.jar lib/jbpm-log-4.5-SNAPSHOT.jar
lib/jbpm-jpdl-4.5-SNAPSHOT.jar lib/jbpm-pvm-4.5-SNAPSHOT.jar</Class-Path>
</manifestEntries>
</archive>
</configuration>
</plugin>
What did I do wrong here? I cannot imagine this happend before. I'm
clueless on how to handle this any better.
Please help!
Thank you very much.
Best regards,
Heiko
If you are not the intended addressee, please inform us immediately that you
have received this e-mail in error, and delete it. We thank you for your
cooperation.