I am trying to build my maven project using Maven version 3.3.9 and a custom maven repository.
Building the project with Maven 3.1.0, it runs, downloads the dependencies and passes the tests.
After removing all local dependencies and upgrading Maven to 3.3.9, I get the following error while in the download phase:
failed to execute goal on project ... could not resolve dependencies ...
failed to collect dependencies at org.hibernate:hibernate-validator:5.2.4.Final:
failed to read artifact descriptor for org.hibernate:hibernate-validator:jar:5.2.4.Final:
could not transfer artifact org.jboss.shrinkwrap:shrinkwrap-bom.pom:1.2.2 from/to central (...)
Unknown host repo.maven.apache.org
Note again, that I am using a custom repository, not Maven Central.
But it works for the older version of Maven, so settings.xml is configured for my repository and the artifact does exist there.
Also, other dependencies do successfully download, it's just this dependency.
Why is Maven still trying to fetch from Maven Central regardless of my repository settings?
I had the same issue. Our setup uses Nexus 3 repository manager. Maven Central is set up as a proxy repo in Nexus.
I have made the mistake to list central in the repositories part of settings.xml
<repositories>
...
<repository>
<id>central</id>
<url>http://<MY_NEXUS_HOST>:8081/repository/maven-central/</url>
</repository>
</repositories>
This was working for most of the dependencies. However it wasn't working for org.jboss.shrinkwrap:shrinkwrap-bom. Only this one.
The resolution was to specify Maven Central as a mirror:
<mirrors>
<mirror>
<id>central-proxy</id>
<name>central-proxy</name>
<url>http://<MY_NEXUS_HOST>:8081/repository/maven-central/</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With