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

Prepare Maven Metadata for CI server for removal of JAXB and Java 11 requirement

    • 2.1

      As described in Dependencies and Class Loading:

      Java defines a Thread.getContextClassLoader(). Jenkins does not use this much; it will normally be set by the servlet container to the Jenkins core loader.

      Unfortunately, JAXB has a design flaw in that JAXBContext#newInstance expects JAXB to be available in the thread's context class loader. With JAXB being detached to a separate plugin as of recent Java 11 changes, JAXB is no longer available in the Jenkins core loader. This causes a failure to load JAXB.

      This plugin has been identified as containing such a call to JAXBContext#newInstance The suggested solution is to wrap calls to JAXBContext#newInstance with a try/finally block to set the thread's context class loader to that of the plugin, which (by virtue of a plugin-to-plugin dependency on JAXB API plugin) enables JAXB to be loaded. See the following PR for an example:

      https://github.com/jenkinsci/xcode-plugin/pull/113/files

          [JENKINS-68510] Prepare Maven Metadata for CI server for removal of JAXB and Java 11 requirement

          Basil Crow created issue -
          Adrien Lecharpentier made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Adrien Lecharpentier made changes -
          Assignee Original: Marc Rohlfs [ marcrohlfs ] New: Adrien Lecharpentier [ alecharp ]
          Adrien Lecharpentier made changes -
          Status Original: In Progress [ 3 ] New: In Review [ 10005 ]
          Adrien Lecharpentier made changes -
          Status Original: In Review [ 10005 ] New: In Progress [ 3 ]
          Adrien Lecharpentier made changes -
          Status Original: In Progress [ 3 ] New: In Review [ 10005 ]
          Adrien Lecharpentier made changes -
          Remote Link New: This issue links to "maven-metadata-plugin#22 (Web Link)" [ 27760 ]
          Adrien Lecharpentier made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: In Review [ 10005 ] New: Fixed but Unreleased [ 10203 ]
          Basil Crow made changes -
          Released As New: 2.1
          Status Original: Fixed but Unreleased [ 10203 ] New: Closed [ 6 ]

            alecharp Adrien Lecharpentier
            basil Basil Crow
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: