Maven: File Transfer Error: Connection refused: connect

I work in a network environment. my network IP is for the Internet:

IE-> tools-> internet options-> connections-> LAN settings-> Use automatic configuration script (enabled): Address: http://autocache.abc.com/

port address is not specified in IE settings.

when I do ping autocache.abc.com it gives the following IP address: 16.234.18.243

in settings.xml, I turned on the entry for the proxy as:

<proxy> <id>genproxy</id> <active>true</active> <protocol>http</protocol> <host>autocache.abc.com</host> </proxy> 

Nothing is indicated on the Ie host, i.e.: IE-> tools-> connection-> LAN settings-> advanced-> http shows empty

if I run mvn install , getting the following error:

 [INFO] Scanning for projects... [INFO] ------------------------------------------------------------------------ [INFO] Building home-app [INFO] task-segment: [install] [INFO] ------------------------------------------------------------------------ [INFO] [resources:resources {execution: default-resources}] [WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, ie build is platform dependent! [INFO] Copying 4 resources Downloading: https://repository.jboss.org/nexus/content/repositories/releases//org/springframework/spring-parent/3.0.6.RELEASE/spring-parent-3.0.6.RELEASE.pom [WARNING] Unable to get resource 'org.springframework:spring-parent:pom:3.0.6.RELEASE' from repository jboss (https://repository.jboss.org/nexus/content/repositories/releases/): Error transferring file: Connection refused: connect Downloading: http://repository.springsource.com/maven/bundles/release/org/springframework/spring-parent/3.0.6.RELEASE/spring-parent-3.0.6.RELEASE.pom [WARNING] Unable to get resource 'org.springframework:spring-parent:pom:3.0.6.RELEASE' from repository com.springsource.repository.bundles.release (http://repository.springsource.com/maven/bundles/release): Error transferring file: Connection refused: connect Downloading: http://repository.springsource.com/maven/bundles/external/org/springframework/spring-parent/3.0.6.RELEASE/spring-parent-3.0.6.RELEASE.pom [WARNING] Unable to get resource 'org.springframework:spring-parent:pom:3.0.6.RELEASE' from repository com.springsource.repository.bundles.external (http://repository.springsource.com/maven/bundles/external): Error transferring file: Connection refused: connect Downloading: http://repo1.maven.org/maven2/org/springframework/spring-parent/3.0.6.RELEASE/spring-parent-3.0.6.RELEASE.pom [WARNING] Unable to get resource 'org.springframework:spring-parent:pom:3.0.6.RELEASE' from repository central (http://repo1.maven.org/maven2): Error transferring file: Connection refused: connect [INFO] ------------------------------------------------------------------------ [ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------ [INFO] Error building POM (may not be this project POM). Project ID: org.springframework:spring-orm:jar:3.0.6.RELEASE Reason: Cannot find parent: org.springframework:spring-parent for project: org.springframework:spring-orm:jar:3.0.6.RELEASE for project org.springframework:spring-orm:jar:3.0.6.RELEASE [INFO] ------------------------------------------------------------------------ [INFO] For more information, run Maven with the -e switch [INFO] ------------------------------------------------------------------------ [INFO] Total time: 11 seconds [INFO] Finished at: Wed Feb 15 11:40:32 IST 2012 [INFO] Final Memory: 11M/27M [INFO] ------------------------------------------------------------------------ 

If I run mvn install without a network connection, that is, on my private Internet connection, it works fine, and the problem is only in the network proxy.

I strongly feel that this is a problem with the host, if I give the host as 16.234.18.243 instead of autocache.abc.com, it still gives the same error.

I tried to create a new local repository (i.e. a remote existing directory), but still the same question.

+4
source share
2 answers

1> open IE (or any browser),

2> specify the url as http://autocache.abc.com/ (you indicated above) and enter, the file will be downloaded in .pac format, save to the desktop

3> open the .pac file in the text panel, define PROXY:

In your editor, it will look something like this:

  return "PROXY web-proxy.ind.abc.com:8080; PROXY proxy.sgp.abc.com:8080"; 

4> go to Maven settings.xml and type:

 <proxy> <id>optional</id> <active>true</active> <protocol>http</protocol> <host>web-proxy.ind.abc.com</host> <port>8080</port> </proxy> 

5> start mvn: install on the command line or run eclipse.

go maven-in-5-min-not-working

+4
source

The URL you specified most likely contains a proxy auto-config file. You need to download it and see what proxy server settings are indicated in it.

For example, the contents of a file

  function FindProxyForURL(url, host) { return "PROXY proxy.example.com:8080; DIRECT"; } 

indicates that you should use the proxy server proxy.example.com on port 8080.

For a more detailed example, see How to configure Maven for an automatically configured proxy .

+4
source

Source: https://habr.com/ru/post/1396566/


All Articles