1、修改本地maven的setting.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>E:/localMaven</localRepository>
<mirrors>
<mirror>
<id>mirror</id>
<mirrorOf>central,jcenter</mirrorOf>
<name>mirror</name>
<url>https://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>
</mirrors>
<servers>
<server>
<id>id</id>
<username>username</username>
<password>password</password>
</server>
</servers>
<profiles>
<profile>
<id>pid</id>
<properties>
<altDeploymentRepository>
id::default::http://...
</altDeploymentRepository>
<altSnapshotDeploymentRepository>
id::default::http://...
</altSnapshotDeploymentRepository>
<altReleaseDeploymentRepository>
id::default::http://...
</altReleaseDeploymentRepository>
</properties>
</profile>
</profiles>
<activeProfiles>
<activeProfile>pid</activeProfile>
</activeProfiles>
</settings>
2、本地打包推送
运行以下命令完成制品推送。
推送命令
mvn clean install org.apache.maven.plugins:maven-deploy-plugin:2.8:deploy -DskipTests