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.
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.