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

MavenBuild does not respect the "alternate settings" value of its parent MavenModuleSetBuild

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

      So the logic used to prepare the arguments for executing Maven are very similar between MavenBuild and MavenModuleSetBuild. I'm unsure why they don't share a common source? There's one glaring difference for me that is causing trouble and that's lack of support for the "alternate settings" attribute when running a MavenBuild directly (by going into the Modules of a Maven build and running a module directly.)

      From MavenModuleSetBuild
                              if (project.getAlternateSettings() != null) {
                                  if (IOUtils.isAbsolute(project.getAlternateSettings())) {
                                      margs.add("-s").add(project.getAlternateSettings());
                                  } else {
                                      FilePath mrSettings = getModuleRoot().child(project.getAlternateSettings());
                                      FilePath wsSettings = getWorkspace().child(project.getAlternateSettings());
                                      if (!wsSettings.exists() && mrSettings.exists())
                                          wsSettings = mrSettings;
                                      
                                      margs.add("-s").add(wsSettings.getRemote());
                                  }
                              }
      

      I'm putting a patch together for this on Github and will update the issue when it's complete.

          [JENKINS-8670] MavenBuild does not respect the "alternate settings" value of its parent MavenModuleSetBuild

          Jason Stiefel created issue -
          Jason Stiefel made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Jason Stiefel made changes -
          Assignee New: Jason Stiefel [ kphonik ]

          Code changed in jenkins
          User: Kohsuke Kawaguchi
          Path:
          changelog.html
          http://jenkins-ci.org/commit/core/f6bd1f306d9b8bf20ff78fb84ae19a07b3fb5c12
          Log:
          [FIXED JENKINS-8670] recording the fix

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: changelog.html http://jenkins-ci.org/commit/core/f6bd1f306d9b8bf20ff78fb84ae19a07b3fb5c12 Log: [FIXED JENKINS-8670] recording the fix
          SCM/JIRA link daemon made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: In Progress [ 3 ] New: Resolved [ 5 ]

          Code changed in jenkins
          User: Kohsuke Kawaguchi
          Path:
          changelog.html
          maven-plugin/src/main/java/hudson/maven/MavenBuild.java
          http://jenkins-ci.org/commit/core/fa9c55884194def3a034115f4b875050dfaf6f2f
          Log:
          Merge branch 'JENKINS-8670'

          • JENKINS-8670:
            [FIXED JENKINS-8670] recording the fix
            Added support to MavenBuild for alternateSettings

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: changelog.html maven-plugin/src/main/java/hudson/maven/MavenBuild.java http://jenkins-ci.org/commit/core/fa9c55884194def3a034115f4b875050dfaf6f2f Log: Merge branch ' JENKINS-8670 ' JENKINS-8670 : [FIXED JENKINS-8670] recording the fix Added support to MavenBuild for alternateSettings
          Jesse Glick made changes -
          Link New: This issue depends on JENKINS-17049 [ JENKINS-17049 ]
          Jesse Glick made changes -
          Link Original: This issue depends on JENKINS-17049 [ JENKINS-17049 ]

          Code changed in jenkins
          User: kphonik
          Path:
          src/main/java/hudson/maven/MavenBuild.java
          http://jenkins-ci.org/commit/maven-plugin/80a1b237122e85eb8978b8f2d94558812805c2cc
          Log:
          Added support to MavenBuild for alternateSettings

          JENKINS-8670

          Originally-Committed-As: ec9dce7dbae9ca7b2bf72d66413109084cd8c863

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: kphonik Path: src/main/java/hudson/maven/MavenBuild.java http://jenkins-ci.org/commit/maven-plugin/80a1b237122e85eb8978b8f2d94558812805c2cc Log: Added support to MavenBuild for alternateSettings JENKINS-8670 Originally-Committed-As: ec9dce7dbae9ca7b2bf72d66413109084cd8c863
          Jenkins IRC Bot made changes -
          Component/s New: maven-plugin [ 16033 ]
          Component/s Original: maven2 [ 15487 ]

            kphonik Jason Stiefel
            kphonik Jason Stiefel
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: