http://maven.apache.org/plugins/maven-war-plugin/examples/war-manifest-guide.html

According to this guide, marking dependency as optional=true should be
regarded by war plugin to not copy jars in web-inf / lib

I cant get it to work without  packagingExcludes

If I want to copy some jars in web-inf/lib and refer some from EAR/lib
using manifest, this would become messy

it seems like optional tag is not respected anymore?

I am using

Apache Maven 2.2.1 (r801777; 2009-08-06 14:16:01-0500)
Java version: 1.6.0_16
Java home: C:\Apps\Java\jdk160_16\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"

Here is my pom

 <?xml version="1.0" encoding="UTF-8"?>
<project>
        <modelVersion>4.0.0</modelVersion>

        <groupId>cpa.tuscany.example.service</groupId>
        <artifactId>ExampleTuscanyService</artifactId>
        <name>ExampleTuscanyService</name>
        <packaging>war</packaging>
        <version>1.0-SNAPSHOT</version>

        <dependencies>

                <dependency>
                        <groupId>org.apache.tuscany.sca</groupId>
                        <artifactId>tuscany-sca-api</artifactId>
                        <version>2.0-M4</version>
                        <optional>true</optional>
                </dependency>

                <dependency>
                        <groupId>org.apache.tuscany.sca</groupId>
                        
<artifactId>tuscany-implementation-web-runtime</artifactId>
                        <version>2.0-M4</version>
                        <optional>true</optional>
                </dependency>

        </dependencies>

        <build>
                <finalName>${artifactId}</finalName>
                <sourceDirectory>src</sourceDirectory>
                <plugins>
                        <plugin>
                                <groupId>org.mortbay.jetty</groupId>
                                <artifactId>maven-jetty-plugin</artifactId>
                                <version>6.1.18</version>
                        </plugin>
                        <plugin>
                                <groupId>org.apache.maven.plugins</groupId>
                                <artifactId>maven-war-plugin</artifactId>
                                <version>2.1-beta-1</version>
                                <configuration>
                                        
<warSourceDirectory>web</warSourceDirectory>
                                        <!-- Create a skinny war. All JARs go 
into the EAR. -->
                                        <warSourceExcludes>
                                                WEB-INF/lib/*.jar
                                        </warSourceExcludes>
                                        
<packagingExcludes>WEB-INF/lib/*.jar</packagingExcludes> <!--
when I remove this, jars end up in web-inf / lib -->
                                        <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>

                </plugins>
        </build>

</project>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to