maven deploy到私服有时间戳的问题

 

 

修改 settings.xml

<servers>	
<server>
      <id>nexus</id>
      <username>admin</username>
      <password>admin123</password>
     </server> 
 </servers>
       <mirrors>
            <id>nexus-releases</id>
            <mirrorOf>nexus</mirrorOf>
            <name>nexus releases</name>
            <url>http://127.0.0.1:8081/repository/maven-releases/</url>
        </mirror>
        <mirror>
            <id>nexus-central</id>
            <mirrorOf>*</mirrorOf>
            <name>nexus maven</name>
            <url>http://127.0.0.1:8081/repository/maven-public/</url>
        </mirror>
  </mirrors>
  <profiles>
  <profile>
  <repositories>
  <repository>
  <id>nexus</id>
  <name>nexus-snapshots</name>
  <url>http://127.0.0.1:8081/repository/maven-central/</url>
  <releases>
  <enabled>true</enabled>
  </releases>
  <snapshots>
  <enabled>true</enabled>
  </snapshots>
  <layout>default</layout>
  </repository>
  </repositories>
  </profile>
  </profiles>

修改pom.xml

注意此时的version是0.0.1-SNAPSHOT

 


 <parent>
        <artifactId>parent</artifactId>
        <groupId>com.project</groupId>
        <version>0.0.1-SNAPSHOT</version>
        <relativePath>../pom.xml</relativePath>
    </parent>
    <modelVersion>4.0.0</modelVersion>
    <version>0.0.1-SNAPSHOT</version>
    <artifactId>base-project</artifactId>
   

 <distributionManagement>
   <snapshotRepository>
            <id>nexus</id>
            <name>Nexus Snapshot</name>
            <url>http://127.0.0.1:8081/repository/maven-snapshots/</url>
        </snapshotRepository>
        <site>
            <id>nexus</id>
            <name>Nexus Sites</name>
            <url>dav:http://127.0.0.1:8081/repository/maven-snapshots/</url>
        </site>
    </distributionManagement>

maven会自动打上时间戳

如图

1b7dac789e607283015913e5c317ac252be.jpg

2db3eb4fd99866decd38795014bcfeecacd.jpg

deploy不会有时间戳的办法

继续修改pom.xml

把0.0.1-SNAPSHOT改为0.0.1-RELEASE

上传到maven-releases

 <parent>
        <artifactId>lanxingman-parent</artifactId>
        <groupId>com.lanxingman.project</groupId>
        <version>0.0.1-SNAPSHOT</version>
        <relativePath>../pom.xml</relativePath>
    </parent>
    <modelVersion>4.0.0</modelVersion>
    <version>0.0.1-RELEASE</version>
    <artifactId>lanxingman-base-project</artifactId>   

 <distributionManagement>
  <repository>
            <id>nexus</id>
            <name>Nexus Snapshot</name>
            <url>http://127.0.0.1:8081/repository/maven-releases/</url>
        </repository>
    </distributionManagement>

结果如下图所示

506a2672440e59a9ca5c863c2326617fb1b.jpg

 

或者是把版本直接写成0.0.1进行打包deploy

SNAPSHOT版本是快照保本–不稳定,尚处于开发中的版本,maven会自动加时间戳

RELEASE 发布版本–稳定版本

 

 

 

转载于:https://my.oschina.net/u/2270256/blog/2218977

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值