4
"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"

I am getting the above error in pom tag. I searched and found out this is due to proxy settings issue. But whatismyip.com shows "no proxy detected".

Question 1: Still could I be behind proxy? If yes how to get the information about proxy.

I learned that users>home>.m2>settings.xml needs to be updated with proxies. For ex:

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

Question 2: In this what do I substitute for my case in tag or where can I find information that is specific to myself.

Question 3: Is there any correlation between users>home>.m2>settings.xml and eclipse window>preferences>general>network Connections>Active Provider(Manual)>http. Do I need to update the same information in both places.

Tunaki
  • 132,869
  • 46
  • 340
  • 423
JavaProgrammer
  • 41
  • 1
  • 2
  • 5

2 Answers2

3

Question 1: Still could I be behind proxy? If yes how to get the information about proxy.

Assuming you are using Windows:

  1. Trigger Run command: Press Win+R, and type inetcpl.cpl, OK.
  2. Switch to Connections tab and press Lan settings button.
  3. Note down the Address and Port from "Proxy server" section.

Question 2: In this what do I substitute for my case in tag or where can I find information that is specific to myself.

Substitute the <host> and <port> in your settings.xml with Step 3 data.

Question 3: Is there any correlation between users>home>.m2>settings.xml and eclipse window>preferences>general>network Connections>Active Provider(Manual)>http. Do I need to update the same information in both places.

No. They are different. What mostly works in Eclipse is the Native network connection mode: Window > Preferences > General > Network Connections > Active Provider > Native. This makes Eclipse to use your native browser's settings (IE in case of Windows).

KrishPrabakar
  • 2,824
  • 2
  • 31
  • 44
  • Thanks, I appreciate your answers. I checked your first answer. In my LAN settings tab "Automatically detect settings" check box is selected. Proxy server section is unchecked. Even if I check the box Address field is empty. I don't have knowledge in this server thing, so could you please help more in this regard. – JavaProgrammer Mar 15 '15 at 07:08
  • @JavaProgrammer - If your machine is in a corporate LAN, ask your Network Administrator for the proxy username and port. – KrishPrabakar Mar 15 '15 at 08:04
  • Thanks again. This is my personal computer. The port is not empty shows 80. Only the address field is empty. BTW Can I tag you for my future questions please? – JavaProgrammer Mar 15 '15 at 10:57
  • @JavaProgrammer - If it is your personal computer, then you won't be behind a proxy. So simply disable the `` by making `` to _false_. (Of course you are welcome to tag me :) – KrishPrabakar Mar 15 '15 at 11:00
  • Thanks for the reply as well as accepting the request. – JavaProgrammer Mar 15 '15 at 20:16
1

There are various sites to check if you are behind a proxy or not. However, if you are behind then it must be configured in your browser; check there to see all the information about it.

There is a difference about the settings.xml file of Maven and network connections of Eclipse.

  • settings.xml is a Maven-specific file. Whenever Maven (and Eclipse through the m2e plugin) will be searching for a dependency, it will use the proxy information located in this file.
  • Network connections in Eclipse is Eclipse-specific. It tells Eclipse about the proxy information when it want to connect to the Internet (through updates or marketplace). You can configure Eclipse to use the proxy information of your OS (typically Internet Explorer proxy settings on Windows machine).

Also, the error message you have (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), this is a very well known issue and it is solved by launching Maven with the -U flag. This flag forces Maven to update any dependencies. See this question for a way to do that in Eclipse.

Community
  • 1
  • 1
Tunaki
  • 132,869
  • 46
  • 340
  • 423
  • Thanks for the reply. I appreciate it. Maven> Update Project and selecting the "Force Update of Snapshots/Releases" checkbox did the trick. – JavaProgrammer Mar 15 '15 at 07:19