Maven Error Unknown host repo.maven.apache.org

Viewed 2893

I am trying to build a docker container using docker-compose build on a CentOS Linux release 8.2.2004. When I execute the command I get the following error message

[ERROR] Plugin org.apache.maven.plugins:maven-javadoc-plugin:3.1.1 or one of its dependencies could not be resolved: 
Failed to read artifact descriptor for org.apache.maven.plugins:maven-javadoc-plugin:jar:3.1.1: 
Could not transfer artifact org.apache.maven.plugins:maven-javadoc-plugin:pom:3.1.1 from/to central (https://repo.maven.apache.org/maven2): 
Transfer failed for https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-javadoc-plugin/3.1.1/maven-javadoc-plugin-3.1.1.pom: 
Unknown host repo.maven.apache.org: Temporary failure in name resolution -> [Help 1]

[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
ERROR: Service 'web' failed to build: The command '/bin/sh -c mvn clean package -am -DskipTests -Dmaven.javadoc.skip=true -P deployment' returned a non-zero code: 1

When I build the docker container on my local machine it works just fine. So there is no issue with the container or any configuration within. I have done some research which suggest there might be a proxy problem on the CentOS Server, but echo "$HTTP_PROXY" and echo "$HTTPS_PROXY" return an empty line - thus I suppose there is no proxy used.

Also when I execute curl https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-javadoc-plugin/3.1.1/maven-javadoc-plugin-3.1.1.pom I get a proper looking xml file.

When I execute curl https://repo.maven.apache.org/maven2I get

<html>
<head><title>302 Moved Temporarily</title></head>
<body>
<h1>302 Moved Temporarily</h1>
<ul>
<li>Code: Found</li>
<li>Message: Resource Found</li>
<li>RequestId: 235378792B04A00C</li>
<li>HostId: b2HKaI47VR5MaiW8bmG9FUGxgZ7u97XeT5Bfm/rs54wVSNjH0hNQsZ2/d4sGaACGboThVlIo5iM=</li>
</ul>
<hr/>
</body>
</html>

curl -L https://repo.maven.apache.org/maven2 shows me a long html document (as intended).

Any help would be greatly appreciated

0 Answers
Related