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

          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).

          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.

          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

          Olivier Lamy added a comment -

          should be fixed now.
          If not please reopen the issue.

          Olivier Lamy added a comment - should be fixed now. If not please reopen the issue.

          dogfood added a comment -

          Integrated in jenkins_main_trunk #1177
          JENKINS-10955 "Alternate settings file" build parameter is getting cleaned after job execution
          JENKINS-10955 add changelog entry

          Olivier Lamy : ef49c65af11cb7cfb65c6a8d5fef8365db2a23cf
          Files :

          • maven-plugin/src/main/java/hudson/maven/MavenModuleSetBuild.java

          Olivier Lamy : b68aaa65f322f7dea271b844966cf582e67c876e
          Files :

          • changelog.html

          dogfood added a comment - Integrated in jenkins_main_trunk #1177 JENKINS-10955 "Alternate settings file" build parameter is getting cleaned after job execution JENKINS-10955 add changelog entry Olivier Lamy : ef49c65af11cb7cfb65c6a8d5fef8365db2a23cf Files : maven-plugin/src/main/java/hudson/maven/MavenModuleSetBuild.java Olivier Lamy : b68aaa65f322f7dea271b844966cf582e67c876e Files : changelog.html

          Stevo Slavić added a comment -

          Just installed 1.433 and I'm still seeing this

          Stevo Slavić added a comment - Just installed 1.433 and I'm still seeing this

          Laurent Gosselin added a comment - - edited

          I think it is normal because the link dogfood provided refers to a version 1.434-SNAPSHOT. So I guess the fix should not be present in 1.433. But I agree that this is confusing since Jenkins changelog of version 1.433 pretends the fix is included.
          Personally I replaced my jenkin.war with the one included in the build 1181 and the problem is fixed for me. I'm keeping that version running until the next stable release.

          Laurent Gosselin added a comment - - edited I think it is normal because the link dogfood provided refers to a version 1.434-SNAPSHOT. So I guess the fix should not be present in 1.433. But I agree that this is confusing since Jenkins changelog of version 1.433 pretends the fix is included. Personally I replaced my jenkin.war with the one included in the build 1181 and the problem is fixed for me. I'm keeping that version running until the next stable release.

          Olivier Lamy added a comment -

          my bad, I failed in changelog file

          Olivier Lamy added a comment - my bad, I failed in changelog file

          Stevo Slavić added a comment -

          OK, please fix the changelog and resolve the issue.

          Stevo Slavić added a comment - OK, please fix the changelog and resolve the issue.

          Still happens to me in version 1.434 upgraded from the Debian/Ubuntu repository

          David Rabinowitz added a comment - Still happens to me in version 1.434 upgraded from the Debian/Ubuntu repository

          JP Courson added a comment - - edited

          Fixed for me in version 1.434 after having updated the maven plugin to 1.434 as well.

          JP Courson added a comment - - edited Fixed for me in version 1.434 after having updated the maven plugin to 1.434 as well.

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

          Originally-Committed-As: ef49c65af11cb7cfb65c6a8d5fef8365db2a23cf

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

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

              Created:
              Updated:
              Resolved: