Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!
Install & Upgrade Gradle¶
The latest version of gradle can be installed via PPA on Ubuntu.
:::bash
sudo add-apt-repository ppa:cwchien/gradle
sudo apt-get updateAnd gradle can be upgraded using the following command.
:::bash
sudo apt-get upgrade gradleThe latest version of Gradle can be installed using Homebrew on Mac.
:::bash
brew install gradleAnd gradle can be upgraded using the following command.
:::bash
brew upgrade gradleTricks and Traps¶
You can set the default logging level to debugging by adding the following line into the file
gradle.propertiesunder the root directory of the project.org.gradle.logging.level=debugIt is recommended that you use the gradle wrapper
gradlewto compile the project. You don’t have to use thetasksubcommand when using the gradle wrappergradlewto compile the project. For example, instead ofgradle task buildyou can use./gradlew build.You’d better rebuild (using the
buildcommand) your project before testing running your project or generating a fat jar (using theshadowjarcommand). Otherwise, you might run into weird issues such as resource file not found, etc.You can generate a Gradle wrapper (with the given version) or update the version of an existing Gradle wrapper using the following command.
:::bash gradle wrapper --gradle-version 6.0.1
The IDEA Plugin¶
You can enable the Gradle IDEA plugin by having the following line in your build.gradle file.
apply plugin: 'idea'This plugins add a task named openIdea and allows you to import a Gradle project from command line.
Sometimes, importing a project from IntelliJ IDEA does not work as expected.
However,
the command line always works.
./gradlew openIdeaCustomize Tasks¶
https://
shadowJar for Gradle¶
plugins {
id "com.github.johnrengelman.shadow" version "4.0.3"
}shadowJar {
zip64 true
mergeServiceFiles()
exclude "META-INF/*.SF"
exclude 'META-INF/*.DSA'
exclude 'META-INF/*.RSA'
exclude "LICENSE*"
}Shadow¶
archiveClassifier
Gradle Sync¶
support only local sync
not incremental
Overall it is far behind rsync. I’d rather use rsync in shell.
Gradle SSH Plugin¶
https://
I’d rather use ssh/rsync in shell.
Gradle Home for IntelliJ IDEA¶
/usr/local/Cellar/gradle/5.1/libexec/
https://
Specifying Dependencies¶
References¶
https://
https://
https://