title: Maven Error Unknown host repo.maven.apache.org
body: <p>I am trying to build a docker container using <code>docker-compose build</code> on a CentOS Linux release 8.2.2004. When I execute the command I get the following error message</p>
  <pre><code>[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 -&gt; [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
  </code></pre>
  <p><strong>When I build the docker container on my local machine it works just fine.</strong> 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 <code>echo &quot;$HTTP_PROXY&quot;</code> and <code>echo &quot;$HTTPS_PROXY&quot;</code> return an empty line - thus I suppose there is no proxy used.</p>
  <p>Also when I execute <code>curl https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-javadoc-plugin/3.1.1/maven-javadoc-plugin-3.1.1.pom</code> I get a proper looking xml file.</p>
  <p>When I execute <code>curl https://repo.maven.apache.org/maven2</code>I get</p>
  <pre><code>&lt;html&gt;
  &lt;head&gt;&lt;title&gt;302 Moved Temporarily&lt;/title&gt;&lt;/head&gt;
  &lt;body&gt;
  &lt;h1&gt;302 Moved Temporarily&lt;/h1&gt;
  &lt;ul&gt;
  &lt;li&gt;Code: Found&lt;/li&gt;
  &lt;li&gt;Message: Resource Found&lt;/li&gt;
  &lt;li&gt;RequestId: 235378792B04A00C&lt;/li&gt;
  &lt;li&gt;HostId: b2HKaI47VR5MaiW8bmG9FUGxgZ7u97XeT5Bfm/rs54wVSNjH0hNQsZ2/d4sGaACGboThVlIo5iM=&lt;/li&gt;
  &lt;/ul&gt;
  &lt;hr/&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  <p><code>curl -L https://repo.maven.apache.org/maven2</code> shows me a long html document (as intended).</p>
  <p>Any help would be greatly appreciated</p>