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

maven2 project doesn't pick up environment variable MAVEN_OPTS

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Critical Critical
    • maven-plugin
    • None
    • Platform: All, OS: All

      In an M2 project, environment MAVEN_OPTS seems to be ignored. That means that
      when having some common settings (e.g. -Dhttp.proxyHost) I need to copy those
      values into the "MAVEN_OPTS" field for every single project. That causes a
      maintenance nightmare.
      I've noticed that on Solaris, but I suspect it affects other platforms as well.

          [JENKINS-2932] maven2 project doesn't pick up environment variable MAVEN_OPTS

          mdonohue added a comment -

          Do node properties solve this for you? (issue 2918)

          mdonohue added a comment - Do node properties solve this for you? (issue 2918)

          jpawlowski added a comment -

          Even the latest version doesn't allow to have global MAVEN options. The
          workaround would be:

          • define some variable in "Global properties" section
          • use that variable in every MAVEN project configuration

          It's certainly better than what we have to do now, but it would be even better
          if that second step could be omitted, so maven projects would make use of
          MAVEN_OPTS defined even in global properties section or on the environment. The
          name of that property is standard so why not make use of it?

          jpawlowski added a comment - Even the latest version doesn't allow to have global MAVEN options. The workaround would be: define some variable in "Global properties" section use that variable in every MAVEN project configuration It's certainly better than what we have to do now, but it would be even better if that second step could be omitted, so maven projects would make use of MAVEN_OPTS defined even in global properties section or on the environment. The name of that property is standard so why not make use of it?

          mdonohue added a comment -
              • Issue 3536 has been marked as a duplicate of this issue. ***

          mdonohue added a comment - Issue 3536 has been marked as a duplicate of this issue. ***

          toby273612 added a comment -

          Created an attachment (id=696)
          Trivial patch that propagates MAVEN_OPTS if no project-specific maven options are set

          toby273612 added a comment - Created an attachment (id=696) Trivial patch that propagates MAVEN_OPTS if no project-specific maven options are set

          mdonohue added a comment -

          shorten summary

          mdonohue added a comment - shorten summary

          Code changed in hudson
          User: : abayer
          Path:
          trunk/hudson/main/core/src/main/java/hudson/model/TopLevelItemDescriptor.java
          trunk/hudson/main/core/src/main/resources/hudson/model/Hudson/configure.jelly
          trunk/hudson/main/maven-plugin/src/main/java/hudson/maven/MavenModuleSet.java
          trunk/hudson/main/maven-plugin/src/main/java/hudson/maven/MavenProcessFactory.java
          trunk/hudson/main/maven-plugin/src/main/java/hudson/maven/ProcessCache.java
          trunk/hudson/main/maven-plugin/src/main/resources/hudson/maven/MavenModuleSet/global.jelly
          trunk/hudson/main/test/src/test/java/hudson/maven/MavenOptsTest.java
          trunk/hudson/main/test/src/test/resources/hudson/maven/maven-opts-echo.zip
          trunk/www/changelog.html
          http://fisheye4.cenqua.com/changelog/hudson/?cs=24652
          Log:
          [FIXED JENKINS-2932] Maven projects now properly fall back through project-defined MAVEN_OPTS to globally-defined MAVEN_OPTS to executor environment variable MAVEN_OPTS - also added globally-defined MAVEN_OPTS and related changes

          SCM/JIRA link daemon added a comment - Code changed in hudson User: : abayer Path: trunk/hudson/main/core/src/main/java/hudson/model/TopLevelItemDescriptor.java trunk/hudson/main/core/src/main/resources/hudson/model/Hudson/configure.jelly trunk/hudson/main/maven-plugin/src/main/java/hudson/maven/MavenModuleSet.java trunk/hudson/main/maven-plugin/src/main/java/hudson/maven/MavenProcessFactory.java trunk/hudson/main/maven-plugin/src/main/java/hudson/maven/ProcessCache.java trunk/hudson/main/maven-plugin/src/main/resources/hudson/maven/MavenModuleSet/global.jelly trunk/hudson/main/test/src/test/java/hudson/maven/MavenOptsTest.java trunk/hudson/main/test/src/test/resources/hudson/maven/maven-opts-echo.zip trunk/www/changelog.html http://fisheye4.cenqua.com/changelog/hudson/?cs=24652 Log: [FIXED JENKINS-2932] Maven projects now properly fall back through project-defined MAVEN_OPTS to globally-defined MAVEN_OPTS to executor environment variable MAVEN_OPTS - also added globally-defined MAVEN_OPTS and related changes

            abayer Andrew Bayer
            jpawlowski jpawlowski
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: