1、Git克隆Spring Initializr
网址:https://github.com/spring-io/initializr
git bash中切换0.6.0分支: git checkout 4b9fddd
或者git bash中切换0.7.0分支: git checkout 6a06f54
2、修改根目录pom.xml文件
在initializr工程根目录的pom.xml文件project标签下添加如下内容,用于将本工程上传到NEXUS 的RELEASES仓库
Nexus 2 版本
<distributionManagement>
<repository>
<id>nexus-releases</id>
<url>http://localhost:8081/nexus/content/repositories/releases/</url>
</repository>
<snapshotRepository>
<id>nexus-snapshots</id>
<url>http://localhost:8081/nexus/content/repositories/snapshots/</url>
</snapshotRepository>
</distributionManagement>
Nexus 3 版本
<distributionManagement>
<repository>
<id>nexus-releases</id>
<url>http://localhost:8081/repository/maven-releases/</url>
</repository>
<snapshotRepository>
<id>nexus-snapshots</id>
<url>http://localhost:8081/repository/maven-snapshots/</url>
</snapshotRepository>
</distributionManagement>
3、Maven配置之servers
.m2/setting.xml文件做如下配置,用户可以上传构件到nexus私服
<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>
4、mvn deploy
上述配置执行完之后,即可在控制台窗口中执行mvn deploy命令,将此工程上传到NEXUS私服完毕。
注意