How to specify module name when publishing to Artifactory from Jenkins
artifactory, gradle, jenkins, maven
Solution
The module name used for uploading is derived from the gradle project name. The default value for a gradle project name is taken from the project folder name. I suspect that on your jenkins job you check out your code into a folder named like your build job. That's why per default this folder name is used as project name.
The cleanest solution is to explicitly set your project name in gradle.
Therefore you need a settings.gradle file in your project root folder that contains the project name:
rootProject.name = "web"
Problem
I'm using the gradle artifactory publish plugin documented here: http://www.jfrog.com/confluence/display/RTF/Gradle+1.6+Publishing+Artifactory+Plugin I'm using the standard config exactly as laid out in the documentation. When I run the `gradle publishArtifactory` task from the command line I get output like this. I.e. It deploys to my correct module name. ``` Deploying artifact: http://<my server>/artifactory/libs-snapshot-local/<my actual module name>/web/0.1-SNAPSHOT/web-0.1-SNAPSHOT.war ``` When I configure Jenkins to run the `gradle publishArtifactory` task using the same gradle build file I get output like this. I.e. It uses the Jenkins build for the module name. ``` Deploying artifact: http://artifactory01.bcinfra.net:8081/artifactory/libs-snapshot-local/<the name of the jenkins build>/web/0.1-SNAPSHOT/web-0.1-SNAPSHOT.war ``` Any ideas on how to prevent the artifactory plugin from using the Jenkins build name for the module name?