src/main/java/HelloWorld.java
public class HelloWorld {
public static void main(String... args) {
System.out.println("HEllo World");
}
}
build.gradle (partial excerpt)
group 'helloworld'
version '1.0-SNAPSHOT'
apply plugin: 'java'
sourceCompatibility = 1.8
(Omitted)
jar {
manifest {
attributes 'Main-Class': 'HelloWorld'
}
}
If you execute the following gradle command, a jar file will be created under the build directory of the project.
$ gradle build
Starting a Gradle Daemon (subsequent builds will be faster)
:compileJava
:processResources UP-TO-DATE
:classes
:jar
:assemble
:compileTestJava UP-TO-DATE
:processTestResources UP-TO-DATE
:testClasses UP-TO-DATE
:test UP-TO-DATE
:check UP-TO-DATE
:build
BUILD SUCCESSFUL
Total time: 7.82 secs
Recommended Posts