"Baeriswyl Kuno - Extern (IT-BA-MV)" <[EMAIL PROTECTED]> wrote on 
30/05/2008 00:37:53:

> Hello,
> 
> in der Maven documentation is an article about a workaround for creating 

> skinny wars. http://maven.apache.org/plugins/maven-war-
> plugin/examples/skinny-wars.html
> 
> In this approach, all libs in WEB-INF/lib are exluded by applying 
> following pattern configuration: <warSourceExcludes>WEB-INF/lib/*.
> jar</warSourceExcludes>
> 
> Is it possible to exclude only certain libraries? Respectively, can I 
> configure the war plugin in way that I it keeps the web specific 
> dependencies, e.g. Struts libraries, in the web application and shares 
> only the utility libraries in the EAR classloader?

I've managed to do just that! :-)

The tools, resources are the utility ones and the ejb one is added as 
well.

I had issues previously when adding in the dependencies - gave wierd 
errors about things not being able to be found. The final one was the ejb 
jar. It needed the type of ejb being set specifically as it otherwise 
defaults to jar.

This is my complete pom for the war file:

<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd"; xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance";>

    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>au.com.aami</groupId>
        <artifactId>aami-parent</artifactId>
        <version>1-SNAPSHOT</version>
    </parent>

    <groupId>au.com.aami.dialler</groupId>
    <artifactId>DiallerWeb</artifactId>
    <packaging>war</packaging>
    <version>1.0-SNAPSHOT</version>
    <name>DiallerWeb Project</name>
    <description>DiallerWeb Project</description>
    <url>http://centre.ourspace.int.corp.sun/it/sd/webapplications/</url>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>au.com.aami</groupId>
            <artifactId>AAMITools</artifactId>
            <version>1.0-SNAPSHOT</version>
        </dependency>

        <dependency>
            <groupId>au.com.aami.dialler</groupId>
            <artifactId>DiallerResources</artifactId>
            <version>1.0-SNAPSHOT</version>
        </dependency>

        <dependency>
            <groupId>au.com.aami.dialler</groupId>
            <artifactId>DiallerEJB</artifactId>
            <version>1.0-SNAPSHOT</version>
            <type>ejb</type>
        </dependency>

        <dependency>
            <groupId>com.ibm.websphere.appserver</groupId>
            <artifactId>runtime</artifactId>
            <version>6.1</version>
            <type>pom</type>
            <scope>provided</scope>
        </dependency>

    </dependencies>

    <properties>
        <junit.version>3.8.1</junit.version>
    </properties>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-war-plugin</artifactId>
                <configuration>
                    <!-- This is broken in maven-war-plugin 2.0, works in 
2.0.1 -->
                    <warSourceExcludes>WEB-INF/lib/*.jar</
warSourceExcludes>
                    <archive>
                        <manifest>
                            <addClasspath>true</addClasspath>
                            <!--
                            <classpathPrefix>lib/</classpathPrefix>
                            -->
                        </manifest>
                    </archive>
                </configuration>
            </plugin>

            <plugin>
                <artifactId>maven-eclipse-plugin</artifactId>
                <configuration>
                    <wtpversion>1.5</wtpversion>

                    <additionalBuildcommands>
                        <buildcommand>
org.eclipse.wst.validation.validationbuilder</buildcommand>
                        <buildcommand>
org.eclipse.wst.common.project.facet.core.builder</buildcommand>
                    </additionalBuildcommands>

                    <additionalProjectnatures>
                        <projectnature>
org.eclipse.wst.common.project.facet.core.nature</projectnature>
                        <projectnature>
org.eclipse.wst.common.modulecore.ModuleCoreNature</projectnature>
                    </additionalProjectnatures>

                    <classpathContainers>
                        <classpathContainer>
org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/WebSphere
 
v6.1 JRE</classpathContainer>
                        <classpathContainer>
org.eclipse.jst.server.core.container/com.ibm.ws.ast.st.runtime.runtimeTarget.v61/was.base.v61
</classpathContainer>
                        <classpathContainer>
org.eclipse.jst.j2ee.internal.web.container</classpathContainer>
                        <classpathContainer>
org.eclipse.jst.j2ee.internal.module.container</classpathContainer>
                    </classpathContainers>

                    <additionalProjectFacets>
                        <com.ibm.websphere.extended.web>6.1</
com.ibm.websphere.extended.web>
                        <com.ibm.websphere.coexistence.web>6.1</
com.ibm.websphere.coexistence.web>
                    </additionalProjectFacets>

                </configuration>
            </plugin>
        </plugins>
    </build>

</project>

It runs under RSA V7.

Now, if only I could get the same manifest stuff to work for the actual 
EJB jar itself...

-Chris


**********************************************************************
CAUTION - This message is intended for the addressee named above. It may 
contain privileged or confidential information. 

If you are not the intended recipient of this message you must: 
- Not use, copy, distribute or disclose it to anyone other than the addressee;
- Notify the sender via return email; and
- Delete the message (and any related attachments) from your computer 
immediately.

Internet emails are not necessarily secure. Australian Associated Motors 
Insurers Limited ABN 92 004 791 744 (AAMI), and its related entities, do not 
accept responsibility for changes made to this message after it was sent.

Unless otherwise stated, views expressed within this email are the author's own 
and do not represent those of AAMI.
**********************************************************************

Reply via email to