title: Docker: Jenkins-jdk11 fails to connect to Nexus due to JAXB-API has not been found
body: <p>Get the following error while trying to connect <code>jenkins-jdk11</code> to <code>nexus3</code> containers running same network in docker-compose on JDK8 based host system. Afer clicking "Test Connection"
  <a href="https://i.stack.imgur.com/PjWSD.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PjWSD.jpg" alt="enter image description here"></a></p>
  
  <p>The error:</p>
  
  <pre><code>Nexus Repository Manager 3.x connection failed
  javax.xml.bind.JAXBException: Implementation of JAXB-API has not been found on module path or classpath.
   - with linked exception:
  [java.lang.ClassNotFoundException: com.sun.xml.internal.bind.v2.ContextFactory]
      at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:278)
      at javax.xml.bind.ContextFinder.find(ContextFinder.java:421)
      at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:721)
      at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:662)
      at com.sonatype.nexus.api.zz.ex.a(SourceFile:33)
      at com.sonatype.nexus.api.zz.ex.b(SourceFile:24)
      at com.sonatype.nexus.api.zz.ez.handleResponse(SourceFile:54)
      at org.apache.http.impl.client.CloseableHttpClient.execute(SourceFile:223)
      at org.apache.http.impl.client.CloseableHttpClient.execute(SourceFile:165)
      at com.sonatype.nexus.api.zz.et.a(SourceFile:84)
      at com.sonatype.nexus.api.zz.es.getVersion(SourceFile:126)
      at com.sonatype.nexus.api.repository.v3.RepositoryManagerV3Client$getVersion.call(Unknown Source)
  </code></pre>
  
  <p>docker-compose.yml</p>
  
  <pre><code>version: "3"
  services:
    jenkins-jdk11:
      user: root
      image: 'jenkins/jenkins:jdk11'
      ports:
        - '10000:8080'
        - '50000:50000'
      environment:
        - TZ=Europe/Warsaw
        - "JAVA_OPTS=-Djavax.xml.bind.JAXBContextFactory=com.sun.xml.bind.v2.ContextFactory"
      links:
        - nexus3
      volumes:
        - 'jenkins-data:/var/jenkins_home'
        - '/var/run/docker.sock:/var/run/docker.sock'
      deploy:
        restart_policy:
           condition: on-failure
      networks:
        - backend
    nexus3:
      container_name: nexus3
      image: 'sonatype/nexus3'
      ports:
        - '50001:8081'
      volumes:
        - 'local-nexus-data-volume:/nexus-data'
      networks:
        - backend
  volumes:
    jenkins-data:
      driver: local
    local-nexus-data-volume:
      driver: local
  networks:
    backend:
      driver: overlay
  </code></pre>
  
  <p><strong>What seems to be the problem and how to successfully connect to Nexus?</strong></p>
  
  <p>EDIT
  My JAXB plugin installed:
  <a href="https://i.stack.imgur.com/dEWT6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dEWT6.png" alt="enter image description here"></a></p>