繁体   English   中英

Eclipse Settings.xml中的代理配置

[英]Proxy configuration in Eclipse Settings.xml

"Failure to transfer org.apache.maven.plugins:maven-failsafe-plugin:pom:2.16 from http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will 
 not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.maven.plugins:maven-failsafe-
 plugin:pom:2.16 from/to central (http://repo.maven.apache.org/maven2): proxy.example.com"

我在pom标签中遇到上述错误。 我搜索并发现这是由于代理设置问题。 但是whatismyip.com显示“没有检测到代理”。

问题1:我还能支持代理吗? 如果是,如何获取有关代理的信息。

我了解到用户> home> .m2> settings.xml需要使用代理进行更新。 例如:

<proxies>
   <proxy>
      <id>example-proxy</id>
      <active>true</active>
      <protocol>http</protocol>
      <username>tomcat</username>
      <password>tomcat</password>
      <host>proxy.example.com</host>
      <port>8008</port>
      <nonProxyHosts>www.google.com|*.example.com</nonProxyHosts>
   </proxy>
</proxies>

问题2:在这里我可以用标签代替我的案例,或者在哪里可以找到特定于我自己的信息。

问题3:用户>主页> .m2> settings.xml eclipse窗口>首选项>常规>网络连接>活动提供程序(手动)> http之间是否存在任何关联。 我是否需要在两个地方更新相同的信息。

问题1:我还能支持代理吗? 如果是,如何获取有关代理的信息。

假设您使用的是Windows

  1. Trigger Run命令:按Win + R ,然后输入inetcpl.cpl ,OK。
  2. 切换Connections选项卡,然后按Lan settings按钮。
  3. 记下 “代理服务器”部分中的地址和端口。

问题2:在这里我可以用标签代替我的案例,或者在哪里可以找到特定于我自己的信息。

使用Step 3数据替换settings.xml<host><port>

问题3:用户>主页> .m2> settings.xml与eclipse窗口>首选项>常规>网络连接>活动提供程序(手动)> http之间是否存在任何关联。 我是否需要在两个地方更新相同的信息。

不,他们是不同的。 Eclipse中最常用的是Native网络连接模式: Window > Preferences > General > Network Connections > Active Provider > Native 这使Eclipse可以使用您的本机浏览器设置(在Windows的情况下为IE)。

有各种网站可以检查您是否在代理服务器后面。 但是,如果您落伍,则必须在浏览器中进行配置; 检查那里以查看有关它的所有信息。

有关Maven的settings.xml文件和Eclipse的网络连接的不同之处。

  • settings.xml是Maven特定的文件。 每当Maven(以及通过m2e插件的Eclipse)将搜索依赖项时,它将使用此文件中的代理信息。
  • Eclipse中的网络连接是特定于Eclipse的。 当它想要连接到Internet时(通过更新或市场),它告诉Eclipse有关代理信息。 您可以将Eclipse配置为使用操作系统的代理信息(通常是Windows计算机上的Internet Explorer代理设置)。

此外,您所拥有的错误消息( Failure to transfer ... from http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced ),这是一个非常著名的问题,它是通过启动Maven的解决-U标志 此标志强制Maven更新任何依赖项。 有关在Eclipse中执行此操作的方法, 请参阅此问题

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM