Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-17593

Artifactory Plugin Uses Incorrect Artifact Names

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • artifactory-plugin
    • None

      When publishing this project:

      https://github.com/jwcarman/gradle-test

      on my local Jenkins server using a gradle build, it publishes the artifacts using this name:

      com.carmanconsulting.gradle:workspace:1.0-SNAPSHOT

      The "workspace" name is not mentioned anywhere in my build.gradle file. Presumably it comes from the name of the Jenkins workspace directory where the files are checked out and the project is built. Is there a work-around?

          [JENKINS-17593] Artifactory Plugin Uses Incorrect Artifact Names

          I have also encountered this problem, although I'm not sure it is an Artifactory plugin problem.

          When Jenkins builds your Gradle project, it seems to checkout your code into a directory call 'workspace' rather than the name of your git repo.

          Since Gradle uses the project directory as the default for the artifact name, your artifact gets built with the name 'workspace' which is wrong.

          The workaround is to use the "Advanced Project Options" in Jenkins to make sure you project is built in an appropriately named directory.

          The Artifactory plugin is unwittingly picking up the artifact as produced by Gradle.

          It seems that this might be more of an issue of Gradle/Jenkins integration.

          Chris Cornelison added a comment - I have also encountered this problem, although I'm not sure it is an Artifactory plugin problem. When Jenkins builds your Gradle project, it seems to checkout your code into a directory call 'workspace' rather than the name of your git repo. Since Gradle uses the project directory as the default for the artifact name, your artifact gets built with the name 'workspace' which is wrong. The workaround is to use the "Advanced Project Options" in Jenkins to make sure you project is built in an appropriately named directory. The Artifactory plugin is unwittingly picking up the artifact as produced by Gradle. It seems that this might be more of an issue of Gradle/Jenkins integration.

          Still happening as of July 2015 (1.601). Will check the latest release (1.621) and also try the Advanced Project OPtions to see if I can fix that way. Very annoying that it works differently than build/publish from my desktop. No other comments since 2013?!?!

          Andrew McLaughlin added a comment - Still happening as of July 2015 (1.601). Will check the latest release (1.621) and also try the Advanced Project OPtions to see if I can fix that way. Very annoying that it works differently than build/publish from my desktop. No other comments since 2013?!?!

          Gil Collins added a comment -

          I have the same issue, thank you for your response.
          This solved my issue for now.

          Gil Collins added a comment - I have the same issue, thank you for your response. This solved my issue for now.

          Derek Marley added a comment -

          Not sure if same root cause, but I was generating a jar file and forgot to put in the "jar" closure which resulted in giving me "workspace" as the artifact id

           

          example - I just added the jar closure

          jar{
             baseName = "something"
          }

          Derek Marley added a comment - Not sure if same root cause, but I was generating a jar file and forgot to put in the "jar" closure which resulted in giving me "workspace" as the artifact id   example - I just added the jar closure jar{ baseName = "something" }

          Andrew Norman added a comment -

          The issue I noticed didn't involve a Gradle project. I was able to reproduce this in an SBT / Scala project where the name setting and the last node in the oragnization were the same name.

          for example: 

          name := "myproject"

          organization := "com.myproject"

           

          in this case jenkins will create the artifact as workspace_2.11-01-SNAPSHOT.jar (instead of the expected myproject_2.11-0.1-SNAPSHOT).

          It will also publish the artifact in the directory /com/myproject/workspace_2.11/0.1-SNAPSHOT (instead of the expected /com/myproject/myproject_2.11/0.1-SNAPSHOT).

          Oddly enough just running the sbt build locally on the in a develop environment will generate the jar by its correct name

          So I suspect the root cause is that jenkins can't handle the situation where the artifact name is the same as the last node of the organization 

          Andrew Norman added a comment - The issue I noticed didn't involve a Gradle project. I was able to reproduce this in an SBT / Scala project where the name setting and the last node in the oragnization were the same name. for example:  name := "myproject" organization := "com.myproject"   in this case jenkins will create the artifact as workspace _2.11 -01-SNAPSHOT.jar (instead of the expected myproject _2.11 -0.1-SNAPSHOT). It will also publish the artifact in the directory /com/myproject/workspace_2.11/0.1-SNAPSHOT (instead of the expected /com/myproject/myproject_2.11/0.1-SNAPSHOT). Oddly enough just running the sbt build locally on the in a develop environment will generate the jar by its correct name So I suspect the root cause is that jenkins can't handle the situation where the artifact name is the same as the last node of the organization 

          Derek Drake added a comment -

          I had this same problem until I provided an artifactId for the publication.

          Derek Drake added a comment - I had this same problem until I provided an artifactId for the publication.

            eyalbe Eyal Ben Moshe
            jwcarman James Carman
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated: