I am interested in building a single jar containing all the module dependencies and external jars in a single executable jar file which I will be able to run with java -jar myApp.jar
.
I have module A which is dependent on module B.
Currently I'm using gradle, and my build.gradle
script looks like this:
apply plugin: 'fatjar'
description = "A_Project"
dependencies {
compile project(':B_Project')
compile "com.someExternalDependency::3.0"
}
When I build it through gradle command: clean build fatjar
a fat jar 'A.jar' is created as expected.
But running it with as I written above results in:
no main manifest attribute, in A.jar
How can I modify my build.gradle
file and specify the main class, or the manifest?
clean build fatjar
has different outputs. Is that true? – Vela