Hi I have a similar setup and deploy struts, spring, etc in the ear by
including them as dependencies in the ear

I use manifest classpaths within wars to externalise dependencies there
are a number of ways to do the classpath stuff, I list the ones I know
below.

I also had this problem, and it took a while to sort out. Here are the
ways I found ...

I've managed to get something into the Manifest.mf Class-Path without it
appearing in the WEB-INF/lib in M2 by placing dependencies as follows in
the war packaging pom ...

    <dependency> 
        <groupId>com.ubs.datait.rkyc.cim.j2eeclient</groupId> 
        <artifactId>cim-j2eeclient</artifactId> 
        <version>${rkyc-cim-version}</version> 
        <scope>compile</scope> 
              <exclusions> 
                <exclusion> 
                      <artifactId>cim-j2eeclient</artifactId> 
 
<groupId>com.ubs.datait.rkyc.cim.j2eeclient</groupId> 
                </exclusion> 
              </exclusions> 
              <optional>true</optional> 
    </dependency> 

And then your war plugin configuration should be

                        <plugins>
                                <plugin>
        
<groupId>org.apache.maven.plugins</groupId>
        
<artifactId>maven-war-plugin</artifactId>
                                        <version>2.0</version>
                                        <configuration>
                                                <archive>
                                                        <manifest>
        
<addClasspath>true</addClasspath>
                                                        </manifest>
                                                </archive>
                                        </configuration>
                                </plugin>

You could also look to use add a classpath and then explicitly exclude
jars with the <excludes>WEB-INF/lib/*.jar</excludes> construct within
the war configuration

The <excludes> tag will only exclude JARs in your workspace directory.
It does not prevent the JARs specified by dependencies to be added to
the lib directory. To do so add a scope tag with the value "provided" to
the dependency:

Alternatively, if you know exactly what you want the manifest class path
to look like you could also specify a special manifest.mf in the
<manifest> tag: 

 
<manifestFile>${basedir}/WebContent/META-INF/MANIFEST.MF</manifestFile> 

Or if you have a manifest file in the standard location
(src/main/webapp/META-INF/) Maven will use that. 
If you want Maven to create the manifest, simply delete the manifest in
the standard location. 


Hope this helps
Andy

-----Original Message-----
From: Alexandre Touret [mailto:[EMAIL PROTECTED] 
Sent: 12 July 2006 12:42
To: Maven Users List
Subject: [M2] Build complex projects

Hi,
I m migrating my projects from M1 to M2. I have a J2EE project (Struts,
spring, hibernate) with the following structure:

????daos
? ????dao
????ears
? ????ear
????ejbs
? ????ejb
????guis
? ????back-gui
? ????front-gui
????services
? ????back-service
? ????front-service
????site
????src
????main
????resources
There are a pom.xml for each type of artefact (daos,guis,...)

In this project , I have two webapps which use the sames libraries (eg. 
struts) I would like to externalize them to the EAR top level and only
refer by the manifest classpath. I know that if I assign all the
dependencies in the EAR and assign these dependencies with the scope
'provided' in the guis pom.xml but I would like to know what the 'best
practices' for this kind of problem.

Thanks in advance

Regards,
Alexandre Touret


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


Visit our website at http://www.ubs.com

This message contains confidential information and is intended only
for the individual named.  If you are not the named addressee you
should not disseminate, distribute or copy this e-mail.  Please
notify the sender immediately by e-mail if you have received this
e-mail by mistake and delete this e-mail from your system.

E-mail transmission cannot be guaranteed to be secure or error-free
as information could be intercepted, corrupted, lost, destroyed,
arrive late or incomplete, or contain viruses.  The sender therefore
does not accept liability for any errors or omissions in the contents
of this message which arise as a result of e-mail transmission.  If
verification is required please request a hard-copy version.  This
message is provided for informational purposes and should not be
construed as a solicitation or offer to buy or sell any securities or
related financial instruments.


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

Reply via email to