I'm on an enterprise working with eclipse as a programmer, and I have a project that works perfect at home. However, when I try to compile the pom.xml at work it says: "Failure to transfer org.apache.maven" and "connect time out". I think it is because the network firewall in the enterprise is very restrictive with the use of ports, possibly blocking the acces. Does anyone know which ports and protocol does maven use to configure itself and do the installation? Can those ports be manually changed?
Thank you very much!
Via the Maven index, you can search for dependencies, select them and add them to your pom file. To download the index, select Windows > Preferences > Maven and enable the Download repository index updates on startup option. After changing this setting, restart Eclipse. This triggers the download of the Maven index.
The proxy port. Default value is: 8080 . The proxy host.
By default, Maven uses the java. net. URLConnection ( HttpURLConnection ) classes provided with the JDK to access repositories that use the HTTP/HTTPs protocols.
Summary. You can use the Maven Dependency Plugin to download dependencies. Run mvn dependency:copy-dependencies , to download all your dependencies and save them in the target/dependency folder. You can change the target location by setting the property outputDirectory .
To modify the url port you can do something like this in settings.xml
:
<repositories>
<repository>
<id>repoId</id>
<url>http://url:port/remains</url>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories>
And to use a proxy in maven, you can also add modify your settings.xml
:
<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>
Adapt as needed.
..\apache-maven-*.*.*\conf\settings.xml
mirrors add
<mirror>
<id>nexus-aliyun</id>
<mirrorOf>*</mirrorOf>
<name>Nexus aliyun</name>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>
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