Maven does not work with proxy

Asked

Viewed 44 times

1

mvn archetype:generate -Dartifactid="products" -Dgroupid="br.com.Alura.Maven" -Dinteractivemode="false" -Darchetypeartifactid="Maven-archetype-Quickstart"

when I try to run this piece of code Maven can’t download the plugins, it keeps trying to fetch several versions, but can’t download any.

my cmd is blocked by proxy, I can’t download python libraries, or anything that needs internet. I tried to change the proxy to some foreigner, but still could not download anything from Maven.

(the computer stays in a school environment, so the proxy)

1 answer

0

The only way to use Maven with proxy is to configure your settings.xml agreement, such as for example:

<settings>
  .
  .
  <proxies>
   <proxy>
      <id>example-proxy</id>
      <active>true</active>
      <protocol>http</protocol>
      <host>proxy.example.com</host>
      <port>8080</port>
      <username>proxyuser</username>
      <password>somepassword</password>
      <nonProxyHosts>www.google.com|*.example.com</nonProxyHosts>
    </proxy>
  </proxies>
  .
  .
</settings>

You can check the documentation here and here

Browser other questions tagged

You are not signed in. Login or sign up in order to post.