MVN Setup

Master Password

Used for encrypting cwd password

$ mvn -emp <your_password>

Save hash to file - %userprofile%/.m2/settings-security.xml

Encrypting CWD Password

mvn -ep <cwd_password>

Save hash to file /path/to/maven/conf/settings.xml

settings.xml sample:

<?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">
 
  <localRepository>C:\repository</localRepository> <!-- where you want to download all pom/jar files by default -->
	
  <profiles>
   <profile> <!-- you need one <profile> for each <server> below. If you want to add a new server, make sure to add both entries -->
		<id>nexus8081_releases</id>
			<activation>
				<activeByDefault>true</activeByDefault>
		</activation>
		<repositories>
			<repository>
				<id>nexus8081_releases</id>
				<url>https://xxxxx:8082/nexus/content/repositories/nexus8081_releases</url>
				<releases><enabled>true</enabled></releases>
				<snapshots><enabled>true</enabled></snapshots>
			</repository>
		</repositories>
    </profile>
    <profile>
		<id>R2DS-Third-Party</id>
			<activation>
				<activeByDefault>true</activeByDefault>
		</activation>
		<repositories>
			<repository>
				<id>R2DS-Third-Party</id>
				<url>https://xxxxx:8082/nexus/content/repositories/R2DS-Third-Party</url>
				<releases><enabled>true</enabled></releases>
				<snapshots><enabled>true</enabled></snapshots>
			</repository>
		</repositories>
    </profile>
	<profile>
		<id>R2DS-Group</id>
		<activation>
			<activeByDefault>true</activeByDefault>
		</activation>
		<repositories>
			<repository>
				<id>R2DS-Group</id>
				<url>https://xxxxx:8082/nexus/content/repositories/R2DS-Group</url>
				<releases><enabled>true</enabled></releases>
				<snapshots><enabled>true</enabled></snapshots>
			</repository>
		</repositories>
	</profile>
	<profile>
		<id>group.r2ds-qa</id>
		<activation>
			<activeByDefault>true</activeByDefault>
		</activation>
		<repositories>
			<repository>
				<id>group.r2ds-qa</id>
				<url>https://xxxxx:8082/nexus/content/repositories/group.r2ds-qa</url>
				<releases><enabled>true</enabled></releases>
				<snapshots><enabled>true</enabled></snapshots>
			</repository>
		</repositories>
	</profile>
	<profile>
		<id>group.r2ds-release</id>
		<activation>
			<activeByDefault>true</activeByDefault>
		</activation>
		<repositories>
			<repository>
				<id>group.r2ds-release</id>
				<url>https://xxxxx:8082/nexus/content/repositories/group.r2ds-release</url>
				<releases><enabled>true</enabled></releases>
				<snapshots><enabled>true</enabled></snapshots>
			</repository>
		</repositories>
	</profile>
	<profile>
		<id>group.r2ds-snapshot</id>
		<activation>
			<activeByDefault>true</activeByDefault>
		</activation>
		<repositories>
			<repository>
				<id>group.r2ds-snapshot</id>
				<url>https://xxxxx:8082/nexus/content/repositories/group.r2ds-snapshot</url>
				<releases><enabled>true</enabled></releases>
				<snapshots><enabled>true</enabled></snapshots>
			</repository>
		</repositories>
	</profile>
  </profiles>
 
  <servers>
   <server>
      <id>nexus8081_releases</id>
      <username>xxxxxx</username> <!-- This is your nexus user. Usually the same AD user -->
      <password>{2q/dUxPI7HUHM4dFcvRsQJIc674BOmEW+TDoPsEWU+o=}</password>
    </server>
    <server>
      <id>R2DS-Third-Party</id>
      <username>xxxxxxxx</username> <!-- This is your nexus user. Usually the same AD user -->
      <password>{2q/dUxPI7HUHM4dFcvRsQJIc674BOmEW+TDoPsEWU+o=}</password>
    </server>
    <server>
      <id>R2DS-Group</id>
      <username>xxxx</username> <!-- This is your nexus user. Usually the same AD user -->
      <password>{2q/dUxPI7HUHM4dFcvRsQJIc674BOmEW+TDoPsEWU+o=}</password>
    </server>
    <server>
      <id>group.r2ds-qa</id>
      <username>xxxxx</username> <!-- This is your nexus user. Usually the same AD user -->
      <password>{2q/dUxPI7HUHM4dFcvRsQJIc674BOmEW+TDoPsEWU+o=}</password>
    </server>
    <server>
      <id>group.r2ds-release</id>
      <username>xxxx</username> <!-- This is your nexus user. Usually the same AD user -->
      <password>{2q/dUxPI7HUHM4dFcvRsQJIc674BOmEW+TDoPsEWU+o=}</password>
    </server>
    <server>
      <id>group.r2ds-snapshot</id>
      <username>xxxx</username> <!-- This is your nexus user. Usually the same AD user -->
      <password>{2q/dUxPI7HUHM4dFcvRsQJIc674BOmEW+TDoPsEWU+o=}</password>
    </server>
  </servers>
 
   <proxies>
    <proxy>
      <id>xxxx</id>
      <active>true</active>
      <protocol>http</protocol>
      <username><domain>\xxxxx</username> <!-- This is your Proxy/Network user. Usually the same AD user -->
      <password>{2q/dUxPI7HUHM4dFcvRsQJIc674BOmEW+TDoPsEWU+o=}</password>
      <host>xxxxx</host> <!-- your proxy IP address, you can get it from the WPAD script URL in IE proxy settings -->
      <port>8080</port> <!-- your proxy PORT, you can get it from the WPAD script URL in IE proxy settings -->
      <nonProxyHosts>*xxxx</nonProxyHosts>
    </proxy>
  </proxies>
 
</settings>
Show Comments