maven参数配置
settings.xml配置
<?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 | The path to the local repository maven will use to
store artifacts. | | Default: ~/.m2/repository <localRepository>/path/to/local/repo</localRepository> -->
<localRepository>D:/tools/idea-maven-3.0.5/repo</localRepository>
<pluginGroups>
</pluginGroups>
<proxies>
</proxies>
<servers>
<server>
<id>nexus-releases</id>
<username>admin</username>
<password>admin123</password>
</server>
<server>
<id>nexus-snapshots</id>
<username>admin</username>
<password>admin123</password>
</server>
</servers>
<mirrors>
<mirror>
<id>aliyun</id>
<mirrorOf>central</mirrorOf>
<name>maven中央仓库阿里镜像</name>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>
</mirrors>
<profiles>
<profile>
<id>jdk-1.7</id>
<activation>
<activeByDefault>true</activeByDefault>
<jdk>1.7</jdk>
</activation>
<properties>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
<maven.compiler.compilerVersion>1.7</maven.compiler.compilerVersion>
<encoding>UTF-8</encoding>
</properties>
</profile>
<!-- 主干 -->
<profile>
<id>profileTrunk</id>
<properties>
<snapshot.id>Snapshot</snapshot.id>
<snapshot.url>http://localhost:8081/nexus/content/repositories/TrunkSnapshot/</snapshot.url>
<release.id>Release</release.id>
<release.url>http://localhost:8081/nexus/content/repositories/TrunkRelease/</release.url>
</properties>
<repositories>
<repository>
<id>Snapshot</id>
<url>http://localhost:8081/nexus/content/repositories/TrunkSnapshot/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>interval:30</updatePolicy>
</snapshots>
</repository>
<repository>
<id>Release</id>
<url>http://localhost:8081/nexus/content/repositories/TrunkRelease/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
<updatePolicy>interval:30</updatePolicy>
</snapshots>
</repository>
</repositories>
</profile>
<!-- 基线 -->
<profile>
<id>profileBaseLine</id>
<properties>
<snapshot.id>Snapshot</snapshot.id>
<snapshot.url>http://localhost:8081/nexus/content/repositories/baseLineSnapshot/</snapshot.url>
<release.id>Release</release.id>
<release.url>http://localhost:8081/nexus/content/repositories/baseLineRelease/</release.url>
</properties>
<repositories>
<repository>
<id>Snapshot</id>
<url>http://localhost:8081/nexus/content/repositories/baseLineSnapshot/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>interval:30</updatePolicy>
</snapshots>
</repository>
<repository>
<id>Release</id>
<url>http://localhost:8081/nexus/content/repositories/baseLineRelease/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
<updatePolicy>interval:30</updatePolicy>
</snapshots>
</repository>
</repositories>
</profile>
<!-- 基线工作区 -->
<profile>
<id>profileBaseLineWorkspace</id>
<properties>
<snapshot.id>Snapshot</snapshot.id>
<snapshot.url>http://localhost:8081/nexus/content/repositories/baseLineWorkspaceSnapshot/</snapshot.url>
<release.id>Release</release.id>
<release.url>http://localhost:8081/nexus/content/repositories/baseLineWorkspaceRelease/</release.url>
</properties>
<repositories>
<repository>
<id>Snapshot</id>
<url>http://localhost:8081/nexus/content/repositories/baseLineWorkspaceSnapshot/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>interval:30</updatePolicy>
</snapshots>
</repository>
<repository>
<id>Release</id>
<url>http://localhost:8081/nexus/content/repositories/baseLineWorkspaceRelease/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
<updatePolicy>interval:30</updatePolicy>
</snapshots>
</repository>
</repositories>
</profile>
<profile>
<id>profileCloud</id>
<repositories>
<repository>
<id>dzswj-cloud</id>
<name>dzswj-cloud</name>
<url>http://localhost:8081/nexus/content/groups/public</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>nexus-releases</id>
<url>http://localhost:8081/nexus/content/repositories/releases/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>nexus-snapshots</id>
<url>http://localhost:8081/nexus/content/repositories/snapshots/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
<profile>
<id>profileOpen</id>
<repositories>
<repository>
<id>profileOpen</id>
<name>开放平台Maven私服</name>
<layout>default</layout>
<url>http://localhost:8081/nexus/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</profile>
</profiles>
<!-- 主干,基线,基线工作区。请按实际需求进行选择,激活对应的activeProfile。
如果代码在主干上,选择profileTrunk
如果是区域的代码,选择profileBaseLineWorkspace,这样代码时效性有保证
如果是区域jenkins打包,选择profileBaseLine,这样优先代码的稳定性。
profileTrunk profileBaseLine profileBaseLineWorkspace
-->
<activeProfiles>
<activeProfile>jdk-1.7</activeProfile>
<activeProfile>profileBaseLineWorkspace</activeProfile>
<activeProfile>profileOpen</activeProfile>
<activeProfile>profileCloud</activeProfile>
</activeProfiles>
</settings>
pom.xml配置
<distributionManagement>
<repository>
<id>${release.id}</id>
<name>Nexus Release Repository</name>
<url>${release.url}</url>
</repository>
<snapshotRepository>
<id>${snapshot.id}</id>
<name>Nexus Snapshot Repository</name>
<url>${snapshot.url}</url>
</snapshotRepository>
</distributionManagement>