Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-users] maven-war-plugin: References to ejb.jar projects with wrong MANIFEST.MF-Class-Path-Entry

Heiko,

Even without m2e(-wtp), you'd get the same results in CLI builds : maven-war-plugin doesn't know the lib prefix shouldn't be added to your ejb project classpath entry.

As a workaround, you need to 
* declare your ejb dependency (pas-system)  with <scope>provided</scope>
* Use a custom classpath entry : 
<archive>
    <manifestEntries>
        <Class-Path>pas-system-${project.version}.jar</Class-Path>
    </manifestEntries>
</archive> 

other classpath entries (infered from maven dependencies) will be appended by the archiver automagically (works inside m2e-wtp too). As you can see, property interpolation works, so that gives you some extra flexibility.

HIH

Fred Bricon


On Tue, Apr 3, 2012 at 3:16 PM, <it-media.kopp@xxxxxxxxxxx> wrote:

Hello,

I've been using m2e 1.1 together with m2e-wtp 0.15.2 for some time and came across an issue that bugs me when deploying an application to WebSphere Application Server 8.0.

I'm using the maven-war-plugin version 2.2, the maven-ear-plugin version 2.7  and maven-ejb-plugin version 2.3. I implemented the known workaround to support skinny wars as following within the maven-war-plugin:
 
<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>

Inside the EAR plugin, the configuration parameter 'defaultLibBundleDir' is set to 'lib/' too. All dependencies are added to both the ear and the war project with scope 'compile'.

Now I got confused by the generated war, as the included MANIFEST.MF contains a Class-Path entry that lists ejbs under lib/ too, while the maven-ear-plugin includes them in the root directory of the ear.

Manifest-Version: 1.0
Build-Jdk: 1.6.0
Built-By: zmbfts4
Class-Path: lib/pas-tools-2012.2.0.jar lib/logging-5.0.0.jar lib/util-
 5.0.0.jar lib/pas-system-2012.2.0.jar lib/jaxb2-basics-runtime-0.6.3.
 jar lib/joda-time-2.0.jar

Here, lib/pas-system-2012.2.0.jar should be without 'lib/' as it is an EJB Project and this way listed as dependency.

Under WebSphere, this leads to an error, as classes from the WAR do no longer find classes from the EJB.

When I manually generate the classpath entry for the MANIFEST.MF, they application works correctly:

<archive>
    <manifestEntries>
        <Class-Path>lib/pas-tools-2012.2.0.jar lib/logging-5.0.0.jar
                 lib/util-5.0.0.jar pas-system-2012.2.0.jar
                 lib/jaxb2-basics-runtime-0.6.3.jar lib/joda-time-2.0.jar
        </Class-Path>
    </manifestEntries>
</archive> 

Does anybody know what the problem here might be? Do I do something wrong here?

Thank you

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.

_______________________________________________
m2e-users mailing list
m2e-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/m2e-users




--
"Have you tried turning it off and on again" - The IT Crowd

Back to the top