java - Gradle -> How to omit some jars from WEB-INF/lib -


i have subproject war spec looks this:

war {     from('resources')  {         include '*.properties'         'web-inf/classes/'     }         webxml = file('src/main/webapp/web-inf/web.xml') } 

works great. creates single, fat war file deployable tomcat. problem is, when deploying tomee , jboss, run conflicts (ie javax servlet, jersey, etc). want exclude set of jars being war'd. looked @ gradle war documentation, , looks need use excludes this. tried 2 different ways, , jars not excluded war:

war {      // copy properties file in classes      // may loaded classpath     from('resources')  {         include '*.properties'         'web-inf/classes/'     }      // specify web xml     webxml = file('src/main/webapp/web-inf/web.xml')      // remove jars conflict tomee     exclude '**/javax.inject-1.jar'     exclude '**/javax.servlet-2.5.0.v201103041518.jar'     exclude '**/servlet-api-2.5.jar'     exclude '**/validation-api-1.0.0.ga.jar'  } 

this in subproject (karyon-examples) within netflix/karyon project hosted on github. dependencies in subproject this:

dependencies {     compile 'org.slf4j:slf4j-api:1.7.0'     runtime 'org.slf4j:slf4j-simple:1.7.0'     compile project(':karyon-extensions')     compile project(':karyon-admin-web') } 

and want avoid editing things compile versus runtime dependencies, in other files , subprojects. in fact jars trying exclude above benign when running jetty , regular tomcat.

i want exclude these jars without complicating build scripts. missing?

thanks

the obvious way go move dependencies don't want have in war compile configuration providedcompile , runtime providedruntime. provided configurations added build when war plugin applied.

one other note on snippet above: think exclude not work because referencing target path in exclude statements instead should reference /servlet-api-2.5.jar.


Comments

Popular posts from this blog

ios - iPhone/iPad different view orientations in different views , and apple approval process -

java Extracting Zip file -

C# WinForm - loading screen -