I have the following simple build.gradle file:
apply plugin: 'application'
apply plugin: 'java'
mainClassName = 'com.kurtis.HelloGradle'
And the following single java file located at src/main/java/com/kurtis/HelloGradle.java
:
package com.kurtis;
public class HelloGradle {
public static void main(String[] args) {
System.out.println("Hello gradle");
}
}
However, if I run gradle build
I get a jar in the build/lib
directory that has no main class set. It's manifest file has no Main-Class
entry. Why is this?