You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Alexandre Touret <at...@free.fr> on 2006/07/12 13:41:42 UTC
[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: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: [M2] Build complex projects
Posted by Alexandre Touret <at...@free.fr>.
Ok thanks
I ll try to implement your first solution. I prefer to generate to let
maven generate the manifest :-)
Andrew-A.Davies@ubs.com wrote:
> 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:atouret.nospam@free.fr]
> 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: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
RE: [M2] Build complex projects
Posted by An...@ubs.com.
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:atouret.nospam@free.fr]
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: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
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: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org