http://jira.codehaus.org/browse/MWAR-9

We throw everything in <EAR_ROOT>/lib and exclude them from WEB-INF/lib.  The 
WAR's MANIFEST.MF is autogenerated like so:

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-war-plugin</artifactId>
                    <configuration>
                        <warSourceDirectory>WebContent</warSourceDirectory>
                        <warSourceExcludes>WEB-INF/lib/*.jar</warSourceExcludes>
                        <archive>
                            <manifest>
                                <addClasspath>true</addClasspath>
                                <classpathPrefix>lib/</classpathPrefix>
                            </manifest>
                        </archive>
                    </configuration>
                </plugin>

In the EAR's POM, you need to list all the dependencies that the WARs have as 
direct dependencies in the EAR.  This will tell the plugin to copy all 
dependent jars to <EAR_ROOT>/lib.

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-ear-plugin</artifactId>
                    <configuration>
                        <defaultJavaBundleDir>lib/</defaultJavaBundleDir>
                    </configuration>
                </plugin>

HTH
mike

-----Original Message-----
From: Michał Stochmiałek [mailto:[EMAIL PROTECTED] 
Sent: Thursday, January 05, 2006 5:13 AM
To: Maven Users List
Subject: [m2] war dependencies in ear


I've got ear multiproject that contain several web and ejb modules. Those ejbs 
and wars have dependency on jar with application logic. Of course, application 
logic has huge number of other 3th party dependencies. When I'm building ear, 
all wars archives contain their own dependencies (including contain application 
logic and all 3th party dependencies). Ear archive contain all ejbs 
dependencies (also including  application logic and all 3th party dependencies).

In result, I have application logic and all 3th party dependencies in each war 
and also in ear. This includes all configuration files of application logic. So 
if I want to change single property I must change it in every application logic 
jar in each war and ear.

What I want to achieve? I want all dependencies from wars in ear bundle, not in 
WEB-INF/lib. 

I tried to exclude all jars in WEB-INF/lib using exclude tag in war 
configuration. It works - directory WEB-INF/lib is empty, but it didn't solve 
the problem, since those excluded jars weren't added to ear.

Do you know any solution for the problem?

best regards,
--
Michal Stochmialek
IT Department, Technology Division
Euro Bank S.A.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to