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

<jvmOptions/> is always generated in Maven build step

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • job-dsl-plugin
    • None

      job-dsl generates empty <jvmOptions/> tag in config.xml even there isn't any reference in source like:

      job('example') {
          steps {
              maven('verify')
          }
      }
      

      This empty <jvmOptions/> tag causes an issue later - in the core there is a test only if jvmOptions is null but not empty - in such a case MAVEN_OPTS is replaced.

      In our real use case we need to prefer IPv6 network stack and DNS addresses instead of IPv4, JAVA_OPTS and MAVEN_OPTS environment variables are set correctly however the job is failing on pure IPv6 environment.

          [JENKINS-60538] <jvmOptions/> is always generated in Maven build step

          Pavel Janoušek created issue -
          Jamie Tanna made changes -
          Assignee Original: Daniel Spilker [ daspilker ] New: Jamie Tanna [ jamietanna ]
          Pavel Janoušek made changes -
          Description Original: job-dsl generates empty {{<jvmOptions/>}} tag in }}config.xml}} even there isn't any reference in source like:
          {code}
          job('example') {
              steps {
                  maven('verify')
              }
          }
          {code}

          This empty {{<jvmOptions/>}} tag causes an issue later - in the [core|https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/tasks/Maven.java#L409] there is a test only if {{jvmOptions}} is {{null}} but not empty - in such a case MAVEN_OPTS is replaced.

          In our real use case we need to prefer IPv6 network stack and DNS addresses instead of IPv4, {{JAVA_OPTS}} and {{MAVEN_OPTS}} environment variables are set correctly however the job is failing on pure IPv6 environment.
          New: job-dsl generates empty {{<jvmOptions/>}} tag in {{config.xml}} even there isn't any reference in source like:
          {code:java}
          job('example') {
              steps {
                  maven('verify')
              }
          }
          {code}
          This empty {{<jvmOptions/>}} tag causes an issue later - in the [core|https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/tasks/Maven.java#L409] there is a test only if {{jvmOptions}} is {{null}} but not empty - in such a case MAVEN_OPTS is replaced.

          In our real use case we need to prefer IPv6 network stack and DNS addresses instead of IPv4, {{JAVA_OPTS}} and {{MAVEN_OPTS}} environment variables are set correctly however the job is failing on pure IPv6 environment.

            jamietanna Jamie Tanna
            pajasoft Pavel Janoušek
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: