I’m new with gradle and I’m trying to build a war file. But every time that I run the gradle build it produce a war very large (1GB) containing a lot of jar that became from the dependencies that I declared for compile the project. Can someone tell me where is the error into my gradle.build or how I can exclude those jars from my war?
Follow my gradel.build.
Thank you.
apply plugin: 'java’
apply plugin: 'war’
apply plugin: 'application’
apply plugin: 'checkstyle’
apply plugin: ‘findbugs’
dependencies {
compile fileTree(dir: ‘war/WEB-INF/lib’).include(’/*.jar’)
compile fileTree(dir: ‘src’).include(’/’), webSphere
compile fileTree(new File(‘C:/Program Files (x86)/IBM/WebSphere8.5/AppServer_1’)).include(’**/.jar’)
}
buildscript {
repositories {
jcenter()
}
dependencies {
classpath “at.bxm.gradleplugins:gradle-svntools-plugin:latest.release”
}
}
apply plugin: “at.bxm.svntools”
//Java version compatibility to use when compiling Java source.
sourceCompatibility = 1.7
//Java version to generate classes for.
targetCompatibility = 1.7
svntools {
username = svnUser
password = svnPass
}
task argumentReading(type: JavaExec){
description ‘Read commang line arguments and set them to local variable’
}
task svnCheck(type: at.bxm.gradleplugins.svntools.tasks.SvnCheckout){
svnUrl = svnTrunk
workspaceDir = checkOutDir
}
task prepareProject(type: War){
manifest{
attributes ‘Build-Number’: new Date().format(‘yyyyMMddHHmmss’)
}
war.execute()
ant.checksum file: it.archivePath
}