Hi, the war plugin explains how to customize the manifest here:

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

I can't seem to repeat this.  I'm wondering what I'm doing wrong.
Here's a quick example with two projects: one jar project (foo-bar),
and one webapp project.  The foo-bar project depends on commons-cli,
and the webapp project depends on foo-bar.  If I configure the pom.xml
as follows, and run 'mvn package' on the webapp project, it includes
commons-cli in the WEB-INF/lib folder.  I don't want this. I want it
to include it in the META-INF/Manifest classpath, but not in
WEB-INF/lib -- any ideas?

Thanks in advance!

$ mvn archetype:create -DgroupId=com.example -DartifactId=foo-bar

<project xmlns="http://maven.apache.org/POM/4.0.0";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd";>
 <modelVersion>4.0.0</modelVersion>
 <groupId>com.example</groupId>
 <artifactId>foo-bar</artifactId>
 <packaging>jar</packaging>
 <version>1.0-SNAPSHOT</version>
 <name>foo-bar</name>
 <url>http://maven.apache.org</url>
 <dependencies>
   <dependency>
     <groupId>commons-cli</groupId>
     <artifactId>commons-cli</artifactId>
     <version>1.0</version>
   </dependency>
 </dependencies>
</project>

$ mvn archetype:create -DgroupId=com.example -DartifactId=webapp
-DarchetypeArtifactId=maven-archetype-webapp

<project xmlns="http://maven.apache.org/POM/4.0.0";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd";>
 <modelVersion>4.0.0</modelVersion>
 <groupId>com.example</groupId>
 <artifactId>webapp</artifactId>
 <packaging>war</packaging>
 <version>1.0-SNAPSHOT</version>
 <name>webapp Maven Webapp</name>
 <url>http://maven.apache.org</url>
 <dependencies>
   <dependency>
     <groupId>com.example</groupId>
         <artifactId>foo-bar</artifactId>
         <version>1.0-SNAPSHOT</version>
         <optional>true</optional>
   </dependency>
 </dependencies>
 <build>
   <finalName>webapp</finalName>
       <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>
       </plugins>
 </build>
</project>

-- 
Zeno Consulting, Inc.
home: http://www.zenoconsulting.biz
blog: http://zenoconsulting.wikidot.com
p: 248.894.4922
f: 313.884.2977

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

Reply via email to