How to exclude jars generated by maven war plugin?

You can mark these dependencies as provided.

You can mark these dependencies as provided: xerces xerces 2.4.0 provided This way the maven will add them to the compilation classpath, but will not package them. It is assumed they exist in your servlet container. See more about maven scopes here under "scope" Edit If you want to remove classes added via transitive dependencies you can exclude them from the dependency like this: org.

Springframework spring 2.5.6 commons-logging commons-logging (taken from this answer) See more here.

Problem is that xerces for example was pulled in via transitive dependencies. I don't want to populate my pom. Xml with all these extraneous filler.

– Jacques René Mesrine Jun 23 '09 at 10:28 I've fixed the answer, hope it solves your problem. – David Rabinowitz Jun 23 '09 at 11:20 2 don't forget to package with mvn clean package afterwards – Otto Allmendinger Sep 23 at 12:32.

About exclusion of transitive dependencies, I think don't work with transtive of transitive dependecies, and I think this could be the case. For example, add dependency of hibernate-core -> dom4j -> xml-apis if add exclude of xml-apis near your hibernate-core, still add xml-apis...

I fixed it. Rereading the reference with a bit more care, I discovered that the element packagingExcludes should be warSourceExcludes.

It will save you from mentioning every jar twice (both dependency and excludes) – David Rabinowitz Jun 23 '09 at 11:16 that is true for the version of the war plugin you use. In 2.1-alpha-2 it has changed to packagingExcludes. See jira.codehaus.

Org/browse/MWAR-135 for more details – Salandur May 25 '10 at 10:20.

I had no possibility to modify depending war file. I needed to avoid some old jar file from lib. This snippet of POM.

Xml configuration works well for me. I use Maven 2.2. Org.apache.maven. Plugins maven-war-plugin 2.1.1 com.company.

App web_app WEB-INF/lib/json-lib-2.2.2-jdk13. Jar ....

When compiling with maven 3 (I used 3.0.2) with provided scope you have the problem with the transitive dependencies (you have a los of JARs inside the WAR). If you use older versions of maven (I used 2.2.1), the WAR contains what is spected (only dependencies not provided.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions