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

"Alternate settings file" build parameter is getting cleaned after job execution

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • maven-plugin
    • None

      After the execution of a job, the "Alternate settings file" build parameter is getting cleaned.

      To reproduce the bug, follow the steps:

      1. Create a new Maven2 job.
      2. Fill in "Alternate settings file" for the job, and Maven targets "clean install" (Don't need a working project for compilation, the job will fail, but the bug is reproduced)
      3. Execute the job
      4. Reopen the job configuration. The "Alternate settings file" parameter is gone.

      Obs.: With "Job Config History" plugin it is possible to view the change generated by SYSTEM to config file, removing the alternate settings parameter.

      The first change after the creation shows the configuration of the alternateSettings parameter:
      @@ -10,15 +11,18 @@
      <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
      <triggers class="vector"/>
      <concurrentBuild>false</concurrentBuild>
      + <goals>clean install</goals>
      + <alternateSettings>C:/jenkins-data/settings-alt.xml</alternateSettings>
      <aggregatorStyleBuild>true</aggregatorStyleBuild>
      <incrementalBuild>false</incrementalBuild>
      <usePrivateRepository>false</usePrivateRepository>

      After the job execution the parameter is gone:
      @@ -12,18 +12,17 @@
      <triggers class="vector"/>
      <concurrentBuild>false</concurrentBuild>
      <goals>clean install</goals>

      • <alternateSettings>C:/jenkins-data/settings-alt.xml</alternateSettings>
        <aggregatorStyleBuild>true</aggregatorStyleBuild>
        <incrementalBuild>false</incrementalBuild>
        <usePrivateRepository>false</usePrivateRepository>

          [JENKINS-10955] "Alternate settings file" build parameter is getting cleaned after job execution

          Leandro Conca created issue -

          Dan Rollo added a comment -

          I think these are related. BTW, I'm seeing the same issue when v1.431. In case it helps, it seems the "Alternate Settings file" value is never redisplayed. So I'm guessing the next time you "save" the config screen, the value is removed (since the existing value was not populated).

          Dan Rollo added a comment - I think these are related. BTW, I'm seeing the same issue when v1.431. In case it helps, it seems the "Alternate Settings file" value is never redisplayed. So I'm guessing the next time you "save" the config screen, the value is removed (since the existing value was not populated).
          Dan Rollo made changes -
          Link New: This issue is related to JENKINS-11004 [ JENKINS-11004 ]

          I'm seeing this too in v1.431. If I have the correct value of "Alternate Settings file" present in config.xml (and also in the job configuration screen), by the time Jenkins reaches the post-build action "Deploy artifacts to Maven repository", the value is gone.

          As my repositories are password protected, I rely on an alternate settings.xml to configure the right credentials with deploy authorization. So for now I'll have to stop deploying.

          Laurent Gosselin added a comment - I'm seeing this too in v1.431. If I have the correct value of "Alternate Settings file" present in config.xml (and also in the job configuration screen), by the time Jenkins reaches the post-build action "Deploy artifacts to Maven repository", the value is gone. As my repositories are password protected, I rely on an alternate settings.xml to configure the right credentials with deploy authorization. So for now I'll have to stop deploying.

          I hate to reply just to say "me too," but this problem has been causing me a ton of problems lately... for those of us with the need to maintain an alternate settings file, this makes Jenkins unusable.

          Adam DeJardine added a comment - I hate to reply just to say "me too," but this problem has been causing me a ton of problems lately... for those of us with the need to maintain an alternate settings file, this makes Jenkins unusable.

          Stevo Slavić added a comment -

          I've wrongly created duplicate, JENKINS-11004

          Important note from duplicate report is that following commit seems to have been root cause of this issue: https://github.com/jenkinsci/jenkins/commit/a254f202f971497a277f758cae5de84292073a4d

          See that

          project.setAlternateSettings( null );
          project.save();
          

          That commit was included in 1.426, so temporary workaround I've successfully applied was to revert back to 1.425

          See the Jenkins change log for 1.426 and line "Maven Plugin can use settings and global settings files provided by the config provider plugin"

          Since Olivier Lamy introduced this feature, IMO he'll know best to fix introduced bug too.

          Stevo Slavić added a comment - I've wrongly created duplicate, JENKINS-11004 Important note from duplicate report is that following commit seems to have been root cause of this issue: https://github.com/jenkinsci/jenkins/commit/a254f202f971497a277f758cae5de84292073a4d See that project.setAlternateSettings( null ); project.save(); That commit was included in 1.426, so temporary workaround I've successfully applied was to revert back to 1.425 See the Jenkins change log for 1.426 and line "Maven Plugin can use settings and global settings files provided by the config provider plugin" Since Olivier Lamy introduced this feature, IMO he'll know best to fix introduced bug too.
          Stevo Slavić made changes -
          Assignee New: Olivier Lamy [ olamy ]

          Thanks for reminding me that we can downgrade

          I've downgraded to 1.424 for now and things are going smoothly again... a decent enough workaround for now

          Adam DeJardine added a comment - Thanks for reminding me that we can downgrade I've downgraded to 1.424 for now and things are going smoothly again... a decent enough workaround for now

          Code changed in jenkins
          User: olivier lamy
          Path:
          maven-plugin/src/main/java/hudson/maven/MavenModuleSetBuild.java
          http://jenkins-ci.org/commit/jenkins/ef49c65af11cb7cfb65c6a8d5fef8365db2a23cf
          Log:
          JENKINS-10955 "Alternate settings file" build parameter is getting cleaned after job execution

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: olivier lamy Path: maven-plugin/src/main/java/hudson/maven/MavenModuleSetBuild.java http://jenkins-ci.org/commit/jenkins/ef49c65af11cb7cfb65c6a8d5fef8365db2a23cf Log: JENKINS-10955 "Alternate settings file" build parameter is getting cleaned after job execution

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: olivier lamy Path: changelog.html http://jenkins-ci.org/commit/jenkins/b68aaa65f322f7dea271b844966cf582e67c876e Log: JENKINS-10955 add changelog entry Compare: https://github.com/jenkinsci/jenkins/compare/2ec651e...b68aaa6

            olamy Olivier Lamy
            lluccia Leandro Conca
            Votes:
            12 Vote for this issue
            Watchers:
            13 Start watching this issue

              Created:
              Updated:
              Resolved: