0

I'm trying to use the Maven cargo uberwar plugin. I would like to do that :

<build>
    <plugins>
        <plugin>
            <groupId>org.codehaus.cargo</groupId>
            <artifactId>cargo-maven2-plugin</artifactId>
            <version>1.2.2</version>
            <extensions>true</extensions>
            <configuration>
                <descriptor>src/assemble/merge.xml</descriptor>
            </configuration>
        </plugin>
    </plugins>
</build>
<dependencies>
    <dependency>
        <groupId>my.first.war</groupId>
        <artifactId>MyFirstWar</artifactId>
        <type>war</type>
        <exclusions> 
            <exclusion> 
                <groupId>javassist</groupId> 
                <artifactId>javassist</artifactId> 
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>my.second.war</groupId>
        <artifactId>MySecondWar</artifactId>
        <type>war</type>
            <exclusions> 
        <exclusions> 
            <exclusion> 
                <groupId>javassist</groupId> 
                <artifactId>javassist</artifactId> 
            </exclusion>
        </exclusions>
    </dependency>
</dependencies>

But it doesn't work, javassist is still in my libs after install my uberwar.

I don't want to make the exclusions in my two wars, I want to do the exclusion in my uberwar. This solution doesn't work, is there any other one ?

Thanks for help

flow
  • 4,828
  • 6
  • 26
  • 41
  • The `cargo-maven2-plugin` is intended for functional testing but not for repackaging. Based on the [docs|(http://cargo.codehaus.org/Merging+WAR+files) i assume you missed to changed the packaging type `uberwar`. In that case you can't exclude deps from the deps, cause the deps are `wars` and not only dependencies for a project. – khmarbaise Oct 04 '13 at 05:54
  • 1
    The packaging type of my Pom.xml il already uberwar. I solve my problem by adding a antrun plugin on my pom who delete the jar after I execute the maven install. But maybe there is a better way to do that... – flow Oct 07 '13 at 07:08

1 Answers1

0

For each war you should set scope provided for javassist. Just like this:

<dependency>
    <groupId>javassist</groupId> 
    <artifactId>javassist</artifactId>
    <scope>provided</scope>
</dependency>
Kuba Samczuk
  • 111
  • 6