Java build Maven HTTP error for jaxb dependency
File: language/java/build-images.md
Every time I run docker build --tag java-docker . I get this error:
Downloaded from central: https://repo.maven.apache.org/maven2/org/ehcache/ehcache/3.10.0/ehcache-3.10.0.jar (1.8 MB at 3.1 MB/s)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 05:01 min
[INFO] Finished at: 2022-06-17T19:59:09Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:3.3.0:go-offline (default-cli) on project spring-petclinic: org.eclipse.aether.resolution.DependencyResolutionException: Failed to collect dependencies at org.ehcache:ehcache:jar:3.10.0 -> org.glassfish.jaxb:jaxb-runtime:jar:2.3.0-b170127.1453 -> org.glassfish.jaxb:jaxb-core:jar:2.3.0-b170127.1453 -> javax.xml.bind:jaxb-api:jar:2.3.0-b161121.1438: Failed to read artifact descriptor for javax.xml.bind:jaxb-api:jar:2.3.0-b161121.1438: Could not transfer artifact javax.xml.bind:jaxb-api:pom:2.3.0-b161121.1438 from/to maven-default-http-blocker (http://0.0.0.0/): Blocked mirror for repositories: [releases.java.net (http://maven.java.net/content/repositories/releases/, default, releases+snapshots), shapshots.java.net (http://maven.java.net/content/repositories/snapshots/, default, releases+snapshots), jvnet-nexus-staging (http://maven.java.net/content/repositories/staging/, default, releases+snapshots), netbeans (http://bits.netbeans.org/nexus/content/groups/netbeans, default, releases)] -> [Help 1]
I tried excluding the jaxb-runtime dependency, as suggested under ehcache/ehcache3#2881:
<dependency>
<groupId>org.ehcache</groupId>
<artifactId>ehcache</artifactId>
<exclusions>
<exclusion>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
</exclusion>
</exclusions>
</dependency>
Maybe I'm doing something wrong because it doesn't seem to have any effect.
I found a workaround on SO. Details here: spring-projects/spring-petclinic#996.
Hi @dave-kennedy, thanks for sharing the issue. When you run the application outside of Docker, does it work? https://docs.docker.com/language/java/build-images/#test-the-application-without-docker-optional
Also, what operating system are you using?
Closing as stale. The guide has been updated and tested recently in https://github.com/docker/docs/commit/4231acfd408e8b735b59af71491fe48a179d15db If you still experience issues and you're on Windows, please verify the line endings as explained in https://github.com/docker/docs/issues/13930
For additional troubleshooting, you can also try the Community Slack at https://join.slack.com/t/dockercommunity/shared_invite/zt-1hl072yfr-ADKgaYgcv3AUTzd9BWtkwA
Closed issues are locked after 30 days of inactivity. This helps our team focus on active issues.
If you have found a problem that seems similar to this, please open a new issue.
/lifecycle locked