According to the documentation of the Jar plugin, the output directory is controlled by the property destinationDir:
Looking at the documentation for the Project class , the same property is mentioned:
Properties added by the plugin java
distsDir: directory for creating TAR and ZIP archives.distsDirName: name of the distribution directory. This is interpreted relative to the project build directory.
And take a little walk. I find a document defining their default values :
File distsDir (read only)
Directory for creating TAR and ZIP archives.
By default with the java plugin: ${project.buildDir}/${project.distsDirName}
Line distsDirName
The name of the distribution directory. This is interpreted relative to the project assembly directory.
By default with the java plugin: 'distributions'
Gradle, , .
build.gradle :
println("distsDirName = " + project.distsDirName)
println("distsDir = " + project.distsDir.toString())
jar {
println("jar.destinationDir = " + destinationDir)
}
, , ./gradlew :
distsDirName = distributions
distsDir = /home/ntrrgc/myProject/build/distributions
jar.destinationDir = /home/ntrrgc/myProject/build/libs
jar.destinationDir ?