1、setting.xml文件设置
<server>
<id>dev</id>
<username>admin</username>
<password>password</password>
</server>
</servers>
<profile>
<id>dev</id>
<repositories>
<repository>
<id>-reposity</id>
<url>http://repo/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>reposity</id>
<url>repo/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>dev</activeProfile>
</activeProfiles>
2、pom.xml文件设置
<distributionManagement>
<repository>
<id>dev</id>
<name>Internal Releases</name>
<url>http://release-local</url>
</repository>
<snapshotRepository>
<id>dev</id>
<name>Internal Snapshots</name>
<url>http://release-local</url>
</snapshotRepository>
</distributionManagement>
注意:pom文件中得id和setting文件中得id要一致
3、maven命令
mvn clean deploy