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

Building Maven jobs on slave fails when settings.xml is not in the default location.

      I need to run a Maven 2 job on a Windows slave, but I need to be able to tell Maven what settings.xml file to use. (In this case it is under a certain user directory) The problem is, the maven core plugin for Jenkins parses the pom.xml to verify it and we are using Nexus as our Maven repository, which the settings are defined in the settings.xml file. Since I can't tell maven core plugin for Jenkins the location of the settings.xml file, it is unable to download the parent pom of the project we are building, so it fails.

      The workaround I am using is to create the job using the freestyle template and pass in the settings.xml file location in my maven goal, bypassing the maven core plugin for Jenkins.

          [JENKINS-14222] Building Maven jobs on slave fails when settings.xml is not in the default location.

          evernat added a comment -

          In Jenkins 1.519, I see a "Settings file" field, in the advanced build section below the "Goals and options" field of the configuration page of a Maven project.
          This settings file for the project can be a path on the filesystem, either relative to the workspace or absolute on the filesystem.

          So it seems to me that you can define the settings file to use for your job and that this issue is already fixed.

          evernat added a comment - In Jenkins 1.519, I see a "Settings file" field, in the advanced build section below the "Goals and options" field of the configuration page of a Maven project. This settings file for the project can be a path on the filesystem, either relative to the workspace or absolute on the filesystem. So it seems to me that you can define the settings file to use for your job and that this issue is already fixed.

          We see a similar behavior on our windows slaves that indicates that global settings do not work as expected:

          When using "Use default maven settings" the actual settings are not taken into account.

          When using "provided settings.xml" everything works fine.

          The strange thing is that the default maven settings points to the provided one, so there should be no difference.

          Martin Spielmann added a comment - We see a similar behavior on our windows slaves that indicates that global settings do not work as expected: When using "Use default maven settings" the actual settings are not taken into account. When using "provided settings.xml" everything works fine. The strange thing is that the default maven settings points to the provided one, so there should be no difference.

            Unassigned Unassigned
            bpmericle Brian Mericle
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: