强制m2e使用http而不是https [英] Force m2e to use http instead of https

查看:107
本文介绍了强制m2e使用http而不是https的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Eclipse安装始终使用https协议下载存储库结构.问题是我的合作代理不会允许我在此URL上使用https.如何强制m2e使用http?

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?

我尝试使用不同的外部Maven安装进行m2e,但没有运气. 仅当我使用CLI使用http的外部Maven时,它才有效.

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.

推荐答案

我还是建议您使用外部Maven安装,不要依赖内置版本.在您的Maven目录中,找到<maven>/conf/settings.xml文件.在这里,您可以编辑代理设置:

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>

此外,您还应该在Eclipse中更新Maven设置(Maven->用户设置):

Also, you should update your Maven settings in Eclipse (Maven -> User Settings):

这篇关于强制m2e使用http而不是https的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆