Maven WAR Plugin
  1. Maven WAR Plugin
  2. MWAR-61

Document how to set manifest classpath and exclude dependency from WEB-INF/lib

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.1
    • Fix Version/s: 2.0.2
    • Component/s: None
    • Labels:
      None
    • Number of attachments :
      1

      Description

      I had to get some help from evenisse to figure out how to generate the manifest classpath yet not include all the dependencies in WEB-INF/lib. I still don't know how to get a dependency into WEB-INF/lib but not the manifest classpath when generating the manifest classpath, but this should help anyone just trying to use a manifest cp in an ear.

        Activity

        Hide
        Brett Porter added a comment -

        applied, thanks!

        Show
        Brett Porter added a comment - applied, thanks!
        Hide
        Michael Case added a comment -

        I followed these directions exactly and I still ended up with the dependencies in my WEB-INF/lib.

        The following is the relevant portion of my POM file.

        <dependencies>
        <dependency>
        <groupId>org.codehaus.xfire</groupId>
        <artifactId>xfire-all</artifactId>
        <version>1.1.1</version>
        <optional>true</optional>
        </dependency>
        <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring</artifactId>
        <version>1.2.8</version>
        <optional>true</optional>
        </dependency>
        <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>3.8.1</version>
        <scope>test</scope>
        </dependency>
        </dependencies>
        <build>
        <plugins>
        <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <version>2.0.1</version>
        <configuration>
        <archive>
        <manifest>
        <addClasspath>true</addClasspath>
        </manifest>
        </archive>
        </configuration>
        </plugin>
        </plugins>
        </build>

        Show
        Michael Case added a comment - I followed these directions exactly and I still ended up with the dependencies in my WEB-INF/lib. The following is the relevant portion of my POM file. <dependencies> <dependency> <groupId>org.codehaus.xfire</groupId> <artifactId>xfire-all</artifactId> <version>1.1.1</version> <optional>true</optional> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring</artifactId> <version>1.2.8</version> <optional>true</optional> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>2.0.1</version> <configuration> <archive> <manifest> <addClasspath>true</addClasspath> </manifest> </archive> </configuration> </plugin> </plugins> </build>
        Hide
        Mike Perham added a comment -

        Michael, just because you add them to the manifest doesn't mean they will be auto-excluded.

        <warSourceExcludes>WEB-INF/lib/*.jar</warSourceExcludes>

        Show
        Mike Perham added a comment - Michael, just because you add them to the manifest doesn't mean they will be auto-excluded. <warSourceExcludes>WEB-INF/lib/*.jar</warSourceExcludes>

          People

          • Assignee:
            Brett Porter
            Reporter:
            David Jencks
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: