[英]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 :
inetcpl.cpl
,OK。 Connections
選項卡,然后按Lan settings
按鈕。 問題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)將搜索依賴項時,它將使用此文件中的代理信息。 此外,您所擁有的錯誤消息( 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.