To understand Gradle with Java build environment; this guide walks you through using Gradle to build a simple Java project. Follow the below link for details steps, I am summarizing some basic points to remember during this process.
- Java source folder in eclipse map to 'src/main/java/' and package starts from here
- imp file build.gradle
- it helps better management of dependencies, Jar files
- $ ./gradlew build
- $ ./gradlew run
- Eclipse integration following this link https://www.vogella.com/tutorials/EclipseGradle/article.html
apply plugin: 'java'
apply plugin: 'application'
apply plugin: 'eclipse'
mainClassName = 'hello.HelloWorld'
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
compile "joda-time:joda-time:2.2"
testCompile "junit:junit:4.12"
}
jar {
baseName='wot-sring'
version = '0.1.0'
}
Comments