You don't say if you are using M1 or M2.

For M2, we did the following to get things working with RSA6:

WAR plugin config:

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-war-plugin</artifactId>
                    <version>2.0-beta-3-SNAPSHOT</version>
                    <configuration>
 
<warSourceDirectory>WebContent</warSourceDirectory>
 
<warSourceExcludes>WEB-INF/lib/*.jar</warSourceExcludes>
                        <archive>
                            <manifest>
                                <addClasspath>true</addClasspath>
                                <classpathPrefix>lib/</classpathPrefix>
                            </manifest>
                        </archive>
                    </configuration>
                    <executions>
                        <execution>
                            <phase>package</phase>
                            <goals>
                                <goal>manifest</goal>
                            </goals>
                            <inherited>true</inherited>
                        </execution>
                    </executions>
                </plugin>

- The war:manifest goal updates WebContent/META-INF/MANIFEST.MF on every
build.  It is in SVN but not in the latest released version.
- Notice the jars are excluded from WEB-INF/lib when built.  This is
because they are all packaged in the ear so 4 wars don't cause 4x the
JAR bloat.

EAR plugin config:

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-ear-plugin</artifactId>
                    <!-- 
                        Webify customized EAR plugin to handle
RSA-specific stuff
                        like copying jars to lib/.
                    -->
                    <version>2.1-20051209.230525-1</version>
                    <configuration>
 
<defaultJavaBundleDir>lib/</defaultJavaBundleDir>
 
<earSourceDirectory>${basedir}</earSourceDirectory>
 
<earSourceIncludes>META-INF/**</earSourceIncludes>
                    </configuration>
                </plugin>

In your EAR POM dependencies, you need to duplicate the list of all WAR
dependencies so that they can be packaged in the ear itself.  It so
happens that transitive dependencies make this list a lot shorter since
you just list the top-level dependencies.

I think there are plugins (build-helper?) which can copy dependencies to
an arbitrary location now so the lib/ copy customization I did may not
be required.  It would be nice to get this working with stock plugins.

Finally the Eclipse plugin configuration:

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-eclipse-plugin</artifactId>
                    <!--
                        Custom version to fix this:
                        http://jira.codehaus.org/browse/MNG-1724
                    -->
                    <version>2.1-20051216.210030-1</version>
                    <configuration>
                        <outputDirectory>bin</outputDirectory>
                        <disableWtp>true</disableWtp>
                        <classpathContainers>
 
<container>org.eclipse.jdt.launching.JRE_CONTAINER</container>
                        </classpathContainers>
                    </configuration>
                </plugin>

It's still not perfect - we'd like to get the generated EAR copied to
our Rapid Deployment directory for quicker development turnaround.  As
is today, we still have to start and stop the container on every change.
Hope this helps.

-----Original Message-----
From: Sanjay Choudhary [mailto:[EMAIL PROTECTED] 
Sent: Friday, January 20, 2006 8:53 PM
To: Maven Users List
Subject: Best Practice - Maven with WSAD or RAD6

I am able to build my projects and EAR in both WSAD and RAD6.  Now
problem I face is in third party jars.

in RAD6/WSAD project structure is like this

EAR Project
     contains application.xml for EAR
     contains all third party JAR required by application

JAR project

EJB Project

WAR Project
      contains JSPs
      contains third party JARs like struts etc in the LIB folder

Now when I used Maven in my development environment, I moved all the
third party JARS to maven repository and changed the dependencies
accordingly.  My java project, ejb projects and war project compiled
fine. I am able to create EAR too.

Now when I want to run/debug my application on built in Websphere
application server, server complains about the third party JARs.
Initially, I thought of adding all the third party jars in server
classpath - but this is not a good idea.  Shall I explode my EAR into
EAR project, so that I will have all the third party jars there. Is
there someother best practice that I
can follow?   I am sure someone may have resolved this issue, (maven is
around for long).

Please advice.

Thanks,
Sanjay


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

Reply via email to