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

Gradle-Artifactory --init-script switch persisted if configuring while job is runnning

      I have a job configured with Gradle-Artifactory Integration. If I modify the configuration of this job while a build is running the temporary --init-script argument that the plugin adds gets persisted in my configuration, which breaks subsequent builds because they get executed like this:

      gradle --init-script /tmp/init-artifactory3964670982689206905gradle --init-script /tmp/init-artifactory7422301055349082489gradle clean compile artifactoryPublish
      

      The build then fails with:

      FAILURE: Build failed with an exception.
      
      * Where:
      Initialization script '/tmp/init-artifactory7422301055349082489gradle' line: 19
      
      * What went wrong:
      Failed to notify build listener.
      > Failed to notify build listener.
         > Cannot cast object 'org.jfrog.gradle.plugin.artifactory.dsl.ArtifactoryPluginConvention@df9f4c3' with class 'org.jfrog.gradle.plugin.artifactory.dsl.ArtifactoryPluginConvention' to class 'org.jfrog.gradle.plugin.artifactory.dsl.ArtifactoryPluginConvention'
      

      The easy work-around is to stop and disable the job before modifying its configuration or just remember to remove the extra arguments before you save your config modifications.

          [JENKINS-16603] Gradle-Artifactory --init-script switch persisted if configuring while job is runnning

          Also experiencing this issue. Running Jenkins on Windows Server 2012.

          [Gradle] - Launching build.
          [workspace] $ cmd.exe /C '""D:\Jenkins\jobs\MyJob\workspace\gradlew.bat" --init-script C:/Users/JENKIN~1/AppData/Local/Temp/init-artifactory2052047507721670499gradle --init-script C:/Users/JENKIN~1/AppData/Local/Temp/init-artifactory5463741475530103744gradle clean test war artifactoryPublish && exit %%ERRORLEVEL%%"'
          
          FAILURE: Build failed with an exception.
          
          * Where:
          Initialization script 'C:\Users\JenkinsServiceRunner\AppData\Local\Temp\init-artifactory5463741475530103744gradle' line: 19
          
          * What went wrong:
          Failed to notify build listener.
          > Failed to notify build listener.
             > Cannot cast object 'org.jfrog.gradle.plugin.artifactory.dsl.ArtifactoryPluginConvention@3bf9fe08' with class 'org.jfrog.gradle.plugin.artifactory.dsl.ArtifactoryPluginConvention' to class 'org.jfrog.gradle.plugin.artifactory.dsl.ArtifactoryPluginConvention'
          
          * Try:
          Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
          
          BUILD FAILED
          

          Hallvard Nygård added a comment - Also experiencing this issue. Running Jenkins on Windows Server 2012. [Gradle] - Launching build. [workspace] $ cmd.exe /C ' ""D:\Jenkins\jobs\MyJob\workspace\gradlew.bat" --init-script C:/Users/JENKIN~1/AppData/Local/Temp/init-artifactory2052047507721670499gradle --init-script C:/Users/JENKIN~1/AppData/Local/Temp/init-artifactory5463741475530103744gradle clean test war artifactoryPublish && exit %%ERRORLEVEL%%"' FAILURE: Build failed with an exception. * Where: Initialization script 'C:\Users\JenkinsServiceRunner\AppData\Local\Temp\init-artifactory5463741475530103744gradle' line: 19 * What went wrong: Failed to notify build listener. > Failed to notify build listener. > Cannot cast object 'org.jfrog.gradle.plugin.artifactory.dsl.ArtifactoryPluginConvention@3bf9fe08' with class 'org.jfrog.gradle.plugin.artifactory.dsl.ArtifactoryPluginConvention' to class 'org.jfrog.gradle.plugin.artifactory.dsl.ArtifactoryPluginConvention' * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. BUILD FAILED

            eyalbe Eyal Ben Moshe
            nathanvsnap Nathan Levesque
            Votes:
            3 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: