2
votes

I have a gradle project and configured war plugin that is successfully generating the war file.

I want my dependencies jar files not to be the part of .war file in directory [/WEB-INF/lib/].

I will manually add all the dependencies in jboss's lib folder.

apply plugin: 'war'

sourceSets  {
 main {
    java {
        srcDir 'src'
    }
 }
}

war.baseName = 'web'

webAppDirName = 'WebContent'

war {
 webXml = file('WebContent/WEB-INF/web.xml')
}

dependencies {
 compile fileTree('../ThirdPartyJars')
 compile project(':core')
}

This is generating a .war file that already contains all the dependency.

Is their any way to remove all these dependencies from war file in gradle.

1

1 Answers

1
votes

This is an awful idea, IMO, but you can add the dependencies to the providedCompile or providedRuntime configuration rather than compile or runtime.