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

The relation between the Global MAVEN_OPTS and the job-specific MAVEN_OPTS

    Details

    • Similar Issues:

      Description

      According to a comment in issue JENKINS-5786 the options specified in the per-job MAVEN_OPTS field overrides the options specified in the Global MAVEN_OPTS field. The strange thing is that the per-job MAVEN_OPTS field seems to be used for two different purposes, both to control the per-job MAVEN_OPTS and to show the Global MAVEN_OPTS. There is also a risk that a user will inadvertently create a per-job MAVEN_OPTS setting when he did not mean to.

      When the per-job MAVEN_OPTS is specified everything is working as expected. The entered value is used in the jobs.

      If the per-job MAVEN_OPTS is erased in the per-job configuration, and the configuration is saved, the Global MAVEN_OPTS is used in the per-job configuration. This is as expected. When opening the configuration page for the job again the per-job MAVEN_OPTS field shows the Global MAVEN_OPTS value. If that configuration is saved, the copy of the Global MAVEN_OPTS value becomes the per-job MAVEN_OPTS. To avoid setting a per-job MAVEN_OPTS the user would have to empty this field every time it is watched. Actually every time the configuration of the job is saved whether or not the Advanced button for the maven options is unfolded or not.

      Suggested solutions:
      I would like to remove the feature of showing the Global MAVEN_OPTS in the per-job MAVEN_OPTS field and instead add a text below the field stating:
      "If left empty, the Global MAVEN_OPTS will be used and they are currently set to <BLABLA>"

      This would give the user better control on when a job is configured with a per-job MAVEN_OPTS and when it is using the Global MAVEN_OPTS.

      The problem described in JENKINS-12264 might be caused by this confusing behavior of the configuration.

        Attachments

          Issue Links

            Activity

            linustolke Linus Tolke created issue -
            linustolke Linus Tolke made changes -
            Field Original Value New Value
            Description According to a comment in issue JENKINS-5786 the options specified in the per-job MAVEN_OPTS field overrides the options specified in the Global MAVEN_OPTS field. The strange thing is that the per-job MAVEN_OPTS field seems to be used for two different purposes, both to control the per-job MAVEN_OPTS and to show the Global MAVEN_OPTS. There is also a risk that a user will inadvertently create a per-job MAVEN_OPTS setting when he did not mean to.

            When the per-job MAVEN_OPTS is specified everything is working as expected. The entered value is used in the jobs.

            If the per-job MAVEN_OPTS is erased in the per-job configuration, and the configuration is saved, the Global MAVEN_OPTS is used in the per-job configuration. This is as expected. When opening the configuration page for the job again the per-job MAVEN_OPTS field shows the Global MAVEN_OPTS value. If that configuration is saved, the copy of the Global MAVEN_OPTS value becomes the per-job MAVEN_OPTS. To avoid setting a per-job MAVEN_OPTS the user would have to empty this field every time it is watched.


            Suggested solutions:
            I would like to remove the feature of showing the Global MAVEN_OPTS in the per-job MAVEN_OPTS field and instead add a text below the field stating:
            "If left empty, the Global MAVEN_OPTS will be used and they are currently set to <BLABLA>"

            This would give the user better control on when a job is configured with a per-job MAVEN_OPTS and when it is using the Global MAVEN_OPTS.
            According to a comment in issue JENKINS-5786 the options specified in the per-job MAVEN_OPTS field overrides the options specified in the Global MAVEN_OPTS field. The strange thing is that the per-job MAVEN_OPTS field seems to be used for two different purposes, both to control the per-job MAVEN_OPTS and to show the Global MAVEN_OPTS. There is also a risk that a user will inadvertently create a per-job MAVEN_OPTS setting when he did not mean to.

            When the per-job MAVEN_OPTS is specified everything is working as expected. The entered value is used in the jobs.

            If the per-job MAVEN_OPTS is erased in the per-job configuration, and the configuration is saved, the Global MAVEN_OPTS is used in the per-job configuration. This is as expected. When opening the configuration page for the job again the per-job MAVEN_OPTS field shows the Global MAVEN_OPTS value. If that configuration is saved, the copy of the Global MAVEN_OPTS value becomes the per-job MAVEN_OPTS. To avoid setting a per-job MAVEN_OPTS the user would have to empty this field every time it is watched.


            Suggested solutions:
            I would like to remove the feature of showing the Global MAVEN_OPTS in the per-job MAVEN_OPTS field and instead add a text below the field stating:
            "If left empty, the Global MAVEN_OPTS will be used and they are currently set to <BLABLA>"

            This would give the user better control on when a job is configured with a per-job MAVEN_OPTS and when it is using the Global MAVEN_OPTS.


            The problem described in JENKINS-12264 might be the same one in that there is no distinction between the "use Global MAVEN_OPTS" and "use previously saved copy of Global MAVEN_OPTS".
            linustolke Linus Tolke made changes -
            Description According to a comment in issue JENKINS-5786 the options specified in the per-job MAVEN_OPTS field overrides the options specified in the Global MAVEN_OPTS field. The strange thing is that the per-job MAVEN_OPTS field seems to be used for two different purposes, both to control the per-job MAVEN_OPTS and to show the Global MAVEN_OPTS. There is also a risk that a user will inadvertently create a per-job MAVEN_OPTS setting when he did not mean to.

            When the per-job MAVEN_OPTS is specified everything is working as expected. The entered value is used in the jobs.

            If the per-job MAVEN_OPTS is erased in the per-job configuration, and the configuration is saved, the Global MAVEN_OPTS is used in the per-job configuration. This is as expected. When opening the configuration page for the job again the per-job MAVEN_OPTS field shows the Global MAVEN_OPTS value. If that configuration is saved, the copy of the Global MAVEN_OPTS value becomes the per-job MAVEN_OPTS. To avoid setting a per-job MAVEN_OPTS the user would have to empty this field every time it is watched.


            Suggested solutions:
            I would like to remove the feature of showing the Global MAVEN_OPTS in the per-job MAVEN_OPTS field and instead add a text below the field stating:
            "If left empty, the Global MAVEN_OPTS will be used and they are currently set to <BLABLA>"

            This would give the user better control on when a job is configured with a per-job MAVEN_OPTS and when it is using the Global MAVEN_OPTS.


            The problem described in JENKINS-12264 might be the same one in that there is no distinction between the "use Global MAVEN_OPTS" and "use previously saved copy of Global MAVEN_OPTS".
            According to a comment in issue JENKINS-5786 the options specified in the per-job MAVEN_OPTS field overrides the options specified in the Global MAVEN_OPTS field. The strange thing is that the per-job MAVEN_OPTS field seems to be used for two different purposes, both to control the per-job MAVEN_OPTS and to show the Global MAVEN_OPTS. There is also a risk that a user will inadvertently create a per-job MAVEN_OPTS setting when he did not mean to.

            When the per-job MAVEN_OPTS is specified everything is working as expected. The entered value is used in the jobs.

            If the per-job MAVEN_OPTS is erased in the per-job configuration, and the configuration is saved, the Global MAVEN_OPTS is used in the per-job configuration. This is as expected. When opening the configuration page for the job again the per-job MAVEN_OPTS field shows the Global MAVEN_OPTS value. If that configuration is saved, the copy of the Global MAVEN_OPTS value becomes the per-job MAVEN_OPTS. To avoid setting a per-job MAVEN_OPTS the user would have to empty this field every time it is watched. Actually every time the configuration of the job is saved whether or not the Advanced button for the maven options is unfolded or not.


            Suggested solutions:
            I would like to remove the feature of showing the Global MAVEN_OPTS in the per-job MAVEN_OPTS field and instead add a text below the field stating:
            "If left empty, the Global MAVEN_OPTS will be used and they are currently set to <BLABLA>"

            This would give the user better control on when a job is configured with a per-job MAVEN_OPTS and when it is using the Global MAVEN_OPTS.


            The problem described in JENKINS-12264 might be caused by this confusing behavior of the configuration.
            kutzi kutzi made changes -
            Link This issue duplicates JENKINS-12264 [ JENKINS-12264 ]
            kutzi kutzi made changes -
            Link This issue duplicates JENKINS-12264 [ JENKINS-12264 ]
            kutzi kutzi made changes -
            Link This issue is duplicated by JENKINS-12264 [ JENKINS-12264 ]
            mrebasti Marcelo Rebasti made changes -
            Assignee Marcelo Rebasti [ mrebasti ]
            mrebasti Marcelo Rebasti made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            mrebasti Marcelo Rebasti made changes -
            Status In Progress [ 3 ] Open [ 1 ]
            Hide
            mrebasti Marcelo Rebasti added a comment -

            I've sent the PR https://github.com/jenkinsci/maven-plugin/pull/8 to fix this issue.

            This PR don't implement the suggested solution. Instead of that, when someone want to save a job-level mavenOpts that are exactly the same as global mavenOpts, the job-level mavenOpts are set to null.

            Regards.

            Marcelo Rebasti

            Show
            mrebasti Marcelo Rebasti added a comment - I've sent the PR https://github.com/jenkinsci/maven-plugin/pull/8 to fix this issue. This PR don't implement the suggested solution. Instead of that, when someone want to save a job-level mavenOpts that are exactly the same as global mavenOpts, the job-level mavenOpts are set to null. Regards. Marcelo Rebasti
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: mrebasti
            Path:
            src/main/java/hudson/maven/MavenModuleSet.java
            src/test/java/hudson/maven/MavenOptsTest.java
            http://jenkins-ci.org/commit/maven-plugin/09fb4a5a7c1e066d28edbe7bef38a7b10da78528
            Log:
            [FIXED JENKINS-13926]
            Change for skip saving job maven opts, when this is the same as the global maven opts.
            Now the global maven opts can't be saved accidentaly as job maven opts.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: mrebasti Path: src/main/java/hudson/maven/MavenModuleSet.java src/test/java/hudson/maven/MavenOptsTest.java http://jenkins-ci.org/commit/maven-plugin/09fb4a5a7c1e066d28edbe7bef38a7b10da78528 Log: [FIXED JENKINS-13926] Change for skip saving job maven opts, when this is the same as the global maven opts. Now the global maven opts can't be saved accidentaly as job maven opts.
            scm_issue_link SCM/JIRA link daemon made changes -
            Status Open [ 1 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Christoph Kutzinski
            Path:
            src/main/java/hudson/maven/MavenModuleSet.java
            src/test/java/hudson/maven/MavenOptsTest.java
            http://jenkins-ci.org/commit/maven-plugin/05b809ee431140e9a5a797c8f454fb16ffcb1b76
            Log:
            Merge pull request #8 from mrebasti/jenkins-13926

            [FIXED JENKINS-13926] Don't save per-job MAVEN_OPTS if they're the same as the global ones

            Compare: https://github.com/jenkinsci/maven-plugin/compare/e1e7d22e00d0...05b809ee4311

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Christoph Kutzinski Path: src/main/java/hudson/maven/MavenModuleSet.java src/test/java/hudson/maven/MavenOptsTest.java http://jenkins-ci.org/commit/maven-plugin/05b809ee431140e9a5a797c8f454fb16ffcb1b76 Log: Merge pull request #8 from mrebasti/jenkins-13926 [FIXED JENKINS-13926] Don't save per-job MAVEN_OPTS if they're the same as the global ones Compare: https://github.com/jenkinsci/maven-plugin/compare/e1e7d22e00d0...05b809ee4311
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: mrebasti
            Path:
            src/main/java/hudson/maven/MavenModuleSet.java
            src/test/java/hudson/maven/MavenOptsTest.java
            http://jenkins-ci.org/commit/maven-plugin/1390c4c004d0956072dcf301a3c6a8ecd2d7a74b
            Log:
            [FIXED JENKINS-13926]
            Change for skip saving job maven opts, when this is the same as the global maven opts.
            Now the global maven opts can't be saved accidentaly as job maven opts.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: mrebasti Path: src/main/java/hudson/maven/MavenModuleSet.java src/test/java/hudson/maven/MavenOptsTest.java http://jenkins-ci.org/commit/maven-plugin/1390c4c004d0956072dcf301a3c6a8ecd2d7a74b Log: [FIXED JENKINS-13926] Change for skip saving job maven opts, when this is the same as the global maven opts. Now the global maven opts can't be saved accidentaly as job maven opts.
            jglick Jesse Glick made changes -
            Labels configuration maven2, options configuration options
            ircbot Jenkins IRC Bot made changes -
            Component/s maven-plugin [ 16033 ]
            Component/s maven2 [ 15487 ]
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 144394 ] JNJira + In-Review [ 191069 ]

              People

              • Assignee:
                mrebasti Marcelo Rebasti
                Reporter:
                linustolke Linus Tolke
              • Votes:
                2 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: