My eclipse installation always uses the https protocol to download repository structures. The problem is that my cooperate proxy wont let me use https on this url. How to force m2e to use http?
I tried with different external maven installations for m2e but no luck. It only works if i use the external maven from CLI, which uses http.
The solution is very easy, you just need to replace the urls to maven central repository (and maybe other main repositories) to https instead of http. That's all!!! In case, you have never defined the repositories url and you are using the default values, you just need to add the new repositories with https.
Where is the Maven Central repository? Maven Central can be accessed from https://repo.maven.apache.org/maven2/.
I had a similar problem and I fixed that adding the code below to my pom.xml:
<repositories>
<repository>
<id>central-repo</id>
<name>Central Repository</name>
<url>http://repo1.maven.org/maven2</url>
</repository>
</repositories>
I'd recommend using an external Maven installation anyway, don't rely on the built-in version. In your Maven directory, find the <maven>/conf/settings.xml
file. There you can edit your proxy settings:
<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>
<activeProfiles>
<!--make the profile active all the time -->
<activeProfile>insecurecentral</activeProfile>
</activeProfiles>
<profiles>
<profile>
<id>insecurecentral</id>
<!--Override the repository (and pluginRepository) "central" from the Maven Super POM -->
<repositories>
<repository>
<id>central</id>
<url>http://repo1.maven.org/maven2</url>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://repo1.maven.org/maven2</url>
<releases>
<enabled>true</enabled>
</releases>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
</settings>
Also, you should update your Maven settings in Eclipse (Maven -> User Settings):
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