Skip to content

Instantly share code, notes, and snippets.

@amiteshhh
Created April 7, 2017 09:12
Show Gist options
  • Save amiteshhh/629e9a3a49e035a6d0709172eb435145 to your computer and use it in GitHub Desktop.
Save amiteshhh/629e9a3a49e035a6d0709172eb435145 to your computer and use it in GitHub Desktop.
Maven .m2 settings with proxy configured
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<proxies>
<!-- proxy
| Specification for one proxy, to be used in connecting to the network.
|-->
<proxy>
<id>http proxy details</id><!-- name doesnt matter. It should just be unique -->
<active>true</active>
<protocol>http</protocol>
<username>[type your user id]</username>
<password>[type your password]</password>
<host>[type your proxy url e.g proxy.somesite.com]</host>
<port>[type port of proxy site e.g 6050]</port>
</proxy>
<proxy>
<id>https proxy details</id>
<active>true</active>
<protocol>https</protocol>
<username>[type your user id]</username>
<password>[type your password here]</password>
<host>[type your proxy url e.g proxy.somesite.com]</host>
<port>[type port of proxy site e.g 6050]</port>
</proxy>
</proxies>
<profiles>
<profile>
<id>securecentral</id>
<!--Override the repository (and pluginRepository) "central" from the
Maven Super POM -->
<repositories>
<repository>
<id>central</id>
<url>http://repo1.maven.org/maven2</url>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://repo1.maven.org/maven2</url>
<releases>
<enabled>true</enabled>
</releases>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<!-- activeProfiles
| List of profiles that are active for all builds.
|-->
<activeProfiles>
<activeProfile>securecentral</activeProfile>
</activeProfiles>
</settings>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment