一、私服地址及登陆账号密码
账号:zhanghao
密码:mima
二、需要上传jar包到私服时配置
1、本地maven配置默认在 settings.xml <severs> 标签中添加如下配置
<server>
<id>gs-maven</id>
<username>zhanghao</username>
<password>mima</password>
</server>
或者把下面的文件下载放到用户目录下的/.m2/下面,多种方式自选一种
2、在你需要上传的Jar包到Nexus的项目最外层pom加
<distributionManagement>
<repository>
<id>gs-maven</id>
<url>http://nexus.gongsi.com/repository/maven-xxx/</url>
</repository>
</distributionManagement>
3、你不想上传的子模块的pom中 ,添加到<project><build><plugins> 标签下添加如下配置 即可忽略该子模块deploy
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
三、想使用你上传到Nexus上的Jar包时,在你想使用的项目最外层pom.xml中添加,
<repositories>
<repository>
<id>gs</id>
<name>gongsi</name>
<url>http://nexus.gongsi.com/repository/maven-xxx/</url>
<releases>
<enabled>true</enabled>
</releases>
</repository>
<repository>
<id>alibaba</id>
<url>https://maven.aliyun.com/repository/central/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑包括了aliyun的仓库,根据个人喜好增加或删除配置