I am trying with Gradle first time. I am trying with a maven java project to compile and create a jar file. It is compiling and creating the jar file in build/libs directory as
trunk-XXXVERSION-SNAPSHOT.jar
I am running gradle build file from trunk directory of this maven java project.
I want to get the project name (for ex: project1) in the jar file name, something like
project1-XXXVERSION-SNAPSHOT.jar
in build/libs directory.
Please suggest.
The default project name is taken from the directory the project is stored in. Instead of changing the naming of the jar explicitly you should set the project name correct for your build. At the moment this is not possible within the
build.gradlefile. Instead, you have to create asettings.gradlefile in your root directory. Thissettings.gradlefile should have this one liner included: