gradle init
this will create some files:
build.gradle
-- Gradle build scriptsettings.gradle
-- Gradle settings scriptgradlew
-- Gradle wrapper script (UNIX)gradlew.bat
-- Gradle wrapper script (Windows)gradle/wrapper/gradle-wrapper.jar
-- Gradle wrapper executable JARgradle/wrapper/gradle-wrapper.properties
-- Gradle wrapper configuration properties
./gradlew tasks
gradle wrapper --gradle-version=5.1.1
This will change the distributionUrl
in gradle/wrapper/gradle-wrapper.properties
to point to same version as system gradle.
./gradlew properties
gradle compileJava
gradle compileTestJava
Add to build.gradle
:
repositories {
mavenCentral()
}
Add to build.gradle
:
dependencies {
testCompile 'junit:junit:4.12'
}
gradle build
Application plugin allows invocation of the program with gradle. To enable, add to build.gradle
:
apply plugin: 'application'
then specify main class and optional arguments:
mainClassName = "xxx.xxx.xxx.Main"
run.args = ["args", "go", "here"]