maven发布到私服

本文介绍了如何通过修改pom.xml文件配置Maven私服部署,包括设置仓库地址、用户名及密码,并通过maven-source-plugin插件来打包源码。此外还提供了maven命令发布到私服的具体步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1. 最外层 pom.xml 中增加

    <distributionManagement>
         <repository>
             <id>xxxxx-dev</id>
             <name>Nexus Release Repository</name>
             <url>http://xxxxxxxxxxxxx:8081/nexus/content/repositories/xxxx/</url>
         </repository>
         <snapshotRepository>
             <id>xxxxx-dev</id>
             <name>Nexus Snapshot Repository</name>
             <url>http://xxxxxxxx:8081/nexus/content/repositories/snapshots/</url>
         </snapshotRepository>
     </distributionManagement>


         <plugin>
                     <artifactId>maven-source-plugin</artifactId>
                     <version>2.1.2</version>
                     <executions>
                         <execution>
                             <goals>
                                 <goal>jar-no-fork</goal>
                             </goals>
                         </execution>
                     </executions>

             </plugin>


2. 检查maven的setting.xml 中文件是否有以下配置,如果有,跳过。


    <server>
       <id>xxxxx-dev</id>
       <username>deployment</username>
       <password>deployment123</password>
     </server>


3. maven命令发布到私服:


mvn clean deploy



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值