1. 配置 maven settings.xml
1.1 设置用户名和密码
<servers>
<server>
<id>test</id>
<username>test</username>
<password>test</password>
</server>
</servers>
1.2 设置镜像地址
<mirrors>
<mirror>
<id>test</id>
<name>maven-public</name>
<url>http://192.100.3.104:8081/repository/maven-public/</url>
<mirrorOf>*</mirrorOf>
</mirror>
</mirrors>
2. maven 依赖配置
<distributionManagement>
<repository>
<id>test</id>
<url>http://192.100.3.104:8081/repository/maven-releases/</url>
</repository>
<snapshotRepository>
<id>test</id>
<url>http://192.100.3.104:8081/repository/maven-snapshots/</url>
</snapshotRepository>
</distributionManagement>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.7</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.1.2</version>
<executions>
<execution>
<id>attach-sources</id>
<phase>verify</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>