Tag Archives: connect to maven repo

Setting Proxy Information for maven

I was working on a J2EE app on my new work place.

I was doing the first thing for starting development… Building my frame work…

On my way I needed to connect maven repository through maven.

But I couldn’t. I was eating connection timeout error.

Suddenly I remembered, the network guys of my new workplace provided me proxy address n port and username – password to connect to the internet.

So i wanted maven to know that.

Then I googled for my problem and found some solution.

I was working on Windows XP and I installed maven in C:\Program Files\Apache Software Foundation\apache-maven-2.2.1\

In C:\Program Files\Apache Software Foundation\apache-maven-2.2.1\conf there is a file “settings.xml”

I found the bellow block

<proxies>
<!– proxy
| Specification for one proxy, to be used in connecting to the network.
|
<proxy>
<id>optional</id>
<active>true</active>
<protocol>http</protocol>
<username>proxyuser</username>
<password>proxypass</password>
<host>proxy.host.net</host>
<port>80</port>
<nonProxyHosts>local.net|some.host.com</nonProxyHosts>
</proxy>
–>
</proxies>
I just replaced it with
<proxies>
<proxy>
<id>mavenconnecttointernet</id>
<active>true</active>
<protocol>http</protocol>
<username>myproxyusername</username>
<password>myproxypassword</password>
<host>myproxyipaddress</host>
<port>myproxyport</port>
<nonProxyHosts>local.net|some.host.com</nonProxyHosts>
</proxy>
</proxies>
Then maven was able to connect to the repository.
Advertisements