3

We need to exclude few jars from war ...we are using maven 3 in weblogic.

I tried

<packagesourceexludes>...and <warsournceexludes..>  

but didn't work.

Any other way to do this.

Thanks Vijay

user684434
  • 1,165
  • 2
  • 19
  • 39
  • Would be good to know what you have tried and why you need to exclude them form your war... – FrVaBe Mar 08 '12 at 15:39

3 Answers3

5
<dependency>
  <groupId>xerces</groupId>
  <artifactId>xerces</artifactId>
  <version>2.4.0</version>
  <scope>provided</scope>
</dependency>

So doesn't need to exclude from every dependency.. This solved my problem...Thanks for all your answer...

digitaljoel
  • 26,265
  • 15
  • 89
  • 115
user684434
  • 1,165
  • 2
  • 19
  • 39
2

You need to use <packagingExcludes> as documented here. Cut/pasting the example for reference...

<project>
  ...
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-war-plugin</artifactId>
        <version>2.2</version>
        <configuration>
          <packagingExcludes>WEB-INF/lib/*.jar</packagingExcludes>
        </configuration>
      </plugin>
    </plugins>
  </build>
  ...
</project>
Raghuram
  • 51,854
  • 11
  • 110
  • 122
0

The usual way to exclude dependencies is shown here. If that's what you've tried, make sure, no other dependency includes the excluded jar (which can be checked by mvn dependency:tree).

Joachim Rohde
  • 5,915
  • 2
  • 29
  • 46