Exclude jar from war Maven 3

梦想的初衷 提交于 2019-12-11 00:41:44

问题


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


回答1:


<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...




回答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>



回答3:


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).



来源:https://stackoverflow.com/questions/9620192/exclude-jar-from-war-maven-3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!