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

Redeploy Artifacts fails with IllegalStateException: the settings.xml could not be supplied for the current build: null

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Critical Critical
    • maven-plugin
    • None
    • Maven Integration plugin 2.14
      Jenkins ver. 2.19.3

      Deploying as a publisher step inside the job works.
      Trying to use "redeploy" fails with

      using settings config with name Default Maven Settings
      Replacing all maven server entries not found in credentials list is false
      java.lang.IllegalStateException: the settings.xml could not be supplied for the current build: null
      	at org.jenkinsci.plugins.configfiles.maven.job.MvnSettingsProvider.supplySettings(MvnSettingsProvider.java:112)
      	at jenkins.mvn.SettingsProvider.getSettingsFilePath(SettingsProvider.java:53)
      	at jenkins.mvn.SettingsProvider.getSettingsRemotePath(SettingsProvider.java:70)
      	at hudson.maven.MavenUtil.createEmbedder(MavenUtil.java:100)
      	at hudson.maven.reporters.MavenAbstractArtifactRecord$1.perform(MavenAbstractArtifactRecord.java:226)
      	at hudson.model.TaskThread.run(TaskThread.java:128)
      Caused by: java.lang.UnsupportedOperationException
      	at java.util.AbstractList.add(AbstractList.java:148)
      	at hudson.model.EnvironmentList.add(EnvironmentList.java:67)
      	at hudson.model.EnvironmentList.add(EnvironmentList.java:35)
      	at java.util.AbstractList.add(AbstractList.java:108)
      	at org.jenkinsci.plugins.configfiles.maven.job.MvnSettingsProvider.supplySettings(MvnSettingsProvider.java:105)
      	... 5 more

          [JENKINS-40309] Redeploy Artifacts fails with IllegalStateException: the settings.xml could not be supplied for the current build: null

          please provide more details about your jenkins version, the maven plugin version and your job configuration

          Arnaud Héritier added a comment - please provide more details about your jenkins version, the maven plugin version and your job configuration

          aheritier I've added the enviorment info, what do you want to know about job config?

          Jakub Bochenski added a comment - aheritier I've added the enviorment info, what do you want to know about job config?

          Can you give me it's config.xml file or at least what are the options you defined. You did you configure your maven settings ?

          Arnaud Héritier added a comment - Can you give me it's config.xml file or at least what are the options you defined. You did you configure your maven settings ?

          Jakub Bochenski added a comment - - edited

          I don't have the config.xml at hand, but I'm using job-dsl to create those. I think the setup is pretty standard.
          I have providedSettings 'connect-maven-settings' in the job definition. I'm not overriding the global settings file.

          I'm adding the settings via job-dsl too

              mavenSettingsConfigFile('connect-maven-settings') {
                  comment "Auto-generated by ${BUILD_URL}"
                  content readFileFromWorkspace('script/connect-settings.xml')
              }
          

          I don't expect content of the settings.xml matters for this?

          Jakub Bochenski added a comment - - edited I don't have the config.xml at hand, but I'm using job-dsl to create those. I think the setup is pretty standard. I have providedSettings 'connect-maven-settings' in the job definition. I'm not overriding the global settings file. I'm adding the settings via job-dsl too mavenSettingsConfigFile( 'connect-maven-settings' ) { comment "Auto-generated by ${BUILD_URL}" content readFileFromWorkspace( 'script/connect-settings.xml' ) } I don't expect content of the settings.xml matters for this?

          ok you are using jobDSL which is a first interesting point but the most import is that you are injecting your settings file from the workspace and thus I'm not surprised that it doesn't work. When you are republishing it it is done from jenkins master using archived artifacts especially because the workspace isn't available anymore. When settings are provided by the Config File Provideer plugin, AFAIR, we are able to retrieve them to redeploy but in your case I don't see how we could do it. We should archive the settings to be able to reuse them

          Arnaud Héritier added a comment - ok you are using jobDSL which is a first interesting point but the most import is that you are injecting your settings file from the workspace and thus I'm not surprised that it doesn't work. When you are republishing it it is done from jenkins master using archived artifacts especially because the workspace isn't available anymore. When settings are provided by the Config File Provideer plugin, AFAIR, we are able to retrieve them to redeploy but in your case I don't see how we could do it. We should archive the settings to be able to reuse them

          you are injecting your settings file from the workspace and thus I'm not surprised that it doesn't work.

          No, this is just a regular settings file. It's just uploaded using job-dsl build.

          Here is the relevant part of job config

              
          ...
          </prebuilders>
              <settings class="org.jenkinsci.plugins.configfiles.maven.job.MvnSettingsProvider">
                  <settingsConfigId>connect-maven-settings</settingsConfigId>
              </settings>
              <rootPOM>acme/pom.xml</rootPOM>
              <goals>clean install</goals>
              <runPostStepsIfResult>
          ...

          Jakub Bochenski added a comment - you are injecting your settings file from the workspace and thus I'm not surprised that it doesn't work. No, this is just a regular settings file. It's just uploaded using job-dsl build. Here is the relevant part of job config ... </prebuilders> <settings class= "org.jenkinsci.plugins.configfiles.maven.job.MvnSettingsProvider" > <settingsConfigId>connect-maven-settings</settingsConfigId> </settings> <rootPOM>acme/pom.xml</rootPOM> <goals>clean install</goals> <runPostStepsIfResult> ...

            Unassigned Unassigned
            jbochenski Jakub Bochenski
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: