Gradle dependecies
To view dependencies hierarchy:
gradle dependencies
Related cards:
Gradle WAR building
To build WAR by Gradle system change java plugin to war plugin:
apply plugin: 'war'
After that execute gradle:
gradle build
WAR will be in folder builds/libs/
Gradle and dbmaintain
Introduction
dbmaintain is plugin (best for my opinion) that allowes to safely migrate dbscheme. It has excellent support for Maven and Ant but not for Gradle. But Gradle has excellent support for Ant, so we can call dbmaintain ant ...
Add new resource folder in Gradle
If you want to add new resource folder to Gradle build, use this snippet:
sourceSets {
main {
resources {
srcDir 'src/main/java'
}
}
}
.java (.groovy and *scala) file will be skipped on build from resources.
Gradle. Attach task to build lifecycle
It's easy. Just add to somewhere after your task definition:
processTestResources.dependsOn recreateDatabase
- processTestResource - default task (phase of build lifecycle)
- recreateDatabase - your custom task, that will be called befor...
Exclude file from resource in Gradle
If you want to exclude one file from resource, you may use this snippet:
sourceSets {
main {
resources {
exclude '**/*.bak'
}
}
}