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

artifactory-pipeline-gradle: multiple addexclusion implementation

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

      Environment

      • Jenkins ver. 2.60.1 (see about.md for full details)
      • Artifactory Version 5.2.0

      Issue

      Using this Jenkinsfile use-case: https://github.com/JFrogDev/project-examples/blob/b1470a12863df239ae059f1683158b1555da3a5e/jenkins-pipeline-examples/gradle-example/Jenkinsfile

      According to https://github.com/jenkinsci/artifactory-plugin/blob/ef6bb05155f8507fea46e2f8e0a727ec9426cadb/src/main/webapp/help/common/help-deployedArtifactExcludePattern.html Multiple exclusions work as Comma or space-separated list

      After trying all the following options on line 24

       

      // Option 1
      rtGradle.deployer.artifactDeploymentPatterns.addExclude("*.war, *.jar")
      // Option 2
      rtGradle.deployer.artifactDeploymentPatterns.addExclude("*.war *.jar")
      // Option 3
      rtGradle.deployer.artifactDeploymentPatterns.addExclude("*.jar").addExclude("*.war")
      

       

      None of them work and has the same result: artifactory deploys everything

      Console Output

      Deploying artifact: http://localhost:8081/artifactory/libs-snapshot-local/org/jfrog/example/gradle/api/1.0-SNAPSHOT/api-1.0-SNAPSHOT-javadoc.jar Deploying artifact: http://localhost:8081/artifactory/libs-snapshot-local/org/jfrog/example/gradle/api/1.0-SNAPSHOT/api-1.0-SNAPSHOT-sources.jar Deploying artifact: http://localhost:8081/artifactory/libs-snapshot-local/org/jfrog/example/gradle/api/1.0-SNAPSHOT/api-1.0-SNAPSHOT.jar Deploying artifact: http://localhost:8081/artifactory/libs-snapshot-local/org/jfrog/example/gradle/webservice/1.0-SNAPSHOT/webservice-1.0-SNAPSHOT-javadoc.jar Deploying artifact: http://localhost:8081/artifactory/libs-snapshot-local/org/jfrog/example/gradle/webservice/1.0-SNAPSHOT/webservice-1.0-SNAPSHOT-sources.jar Deploying artifact: http://localhost:8081/artifactory/libs-snapshot-local/org/jfrog/example/gradle/webservice/1.0-SNAPSHOT/webservice-1.0-SNAPSHOT.war Deploying artifact: http://localhost:8081/artifactory/libs-snapshot-local/org/jfrog/example/gradle/shared/1.0-SNAPSHOT/shared-1.0-SNAPSHOT-javadoc.jar Deploying artifact: http://localhost:8081/artifactory/libs-snapshot-local/org/jfrog/example/gradle/shared/1.0-SNAPSHOT/shared-1.0-SNAPSHOT-sources.jar Deploying artifact: http://localhost:8081/artifactory/libs-snapshot-local/org/jfrog/example/gradle/shared/1.0-SNAPSHOT/shared-1.0-SNAPSHOT.jar

      1 exclusion pattern only work as expected

      rtGradle.deployer.artifactDeploymentPatterns.addExclude("*.jar"

      Result: *jar are excluded from uploading

      Skipping the deployment of 'org/jfrog/example/gradle/api/1.0-SNAPSHOT/api-1.0-SNAPSHOT-javadoc.jar' due to the defined include-exclude patterns. Skipping the deployment of 'org/jfrog/example/gradle/api/1.0-SNAPSHOT/api-1.0-SNAPSHOT-sources.jar' due to the defined include-exclude patterns. Skipping the deployment of 'org/jfrog/example/gradle/api/1.0-SNAPSHOT/api-1.0-SNAPSHOT.jar' due to the defined include-exclude patterns. Skipping the deployment of 'org/jfrog/example/gradle/webservice/1.0-SNAPSHOT/webservice-1.0-SNAPSHOT-javadoc.jar' due to the defined include-exclude patterns. Skipping the deployment of 'org/jfrog/example/gradle/webservice/1.0-SNAPSHOT/webservice-1.0-SNAPSHOT-sources.jar' due to the defined include-exclude patterns. Deploying artifact: http://localhost:8081/artifactory/libs-snapshot-local/org/jfrog/example/gradle/webservice/1.0-SNAPSHOT/webservice-1.0-SNAPSHOT.war Skipping the deployment of 'org/jfrog/example/gradle/shared/1.0-SNAPSHOT/shared-1.0-SNAPSHOT-javadoc.jar' due to the defined include-exclude patterns. Skipping the deployment of 'org/jfrog/example/gradle/shared/1.0-SNAPSHOT/shared-1.0-SNAPSHOT-sources.jar' due to the defined include-exclude patterns. Skipping the deployment of 'org/jfrog/example/gradle/shared/1.0-SNAPSHOT/shared-1.0-
      SNAPSHOT.jar' due to the defined include-exclude patterns.

      Additional notes

      Maven multiple exclusion works as expected

       

       

          [JENKINS-46847] artifactory-pipeline-gradle: multiple addexclusion implementation

          carlosrodlop thank you for reporting this issue, 
          We have identified and working on a fix for this issue.
          The fix will be included in the upcoming release.

           

          Roman Gurevitch added a comment - carlosrodlop thank you for reporting this issue,  We have identified and working on a fix for this issue. The fix will be included in the upcoming release.  

          The following issue tracks this fix:

          https://www.jfrog.com/jira/browse/HAP-981

          Eyal Ben Moshe added a comment - The following issue tracks this fix: https://www.jfrog.com/jira/browse/HAP-981

            eyalbe Eyal Ben Moshe
            carlosrodlop Carlos Rodríguez López
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: