maven deploy到私服有時間戳的問題

 

 

修改 settings.xmlmaven

<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.xmlurl

注意此時的version是0.0.1-SNAPSHOTspa

 

<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會自動打上時間戳code

如圖server

deploy不會有時間戳的辦法xml

繼續修改pom.xmlblog

0.0.1-SNAPSHOT改成0.0.1-RELEASE開發

上傳到maven-releasesit

<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>

結果以下圖所示io

 

或者是把版本直接寫成0.0.1進行打包deploy

SNAPSHOT版本是快照保本–不穩定,尚處於開發中的版本,maven會自動加時間戳

RELEASE 發佈版本–穩定版本

相關文章
相關標籤/搜索