Nexus私服环境下Spring Initializr配置本地服务

本文档介绍了如何将Spring Initializr项目克隆并配置为使用Nexus私服,包括修改pom.xml文件,配置Maven的servers、mirrors、profiles和activeProfiles,安装Spring Boot CLI,以及在Eclipse中导入和运行项目,最终实现通过本地Nexus服务器提供Spring Initializr服务。
摘要由CSDN通过智能技术生成

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私服完毕。

注意

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值