簡體   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