使用Nexus上传jar包


nexus将本地文件推送到nexus中心库
在本地搭建的nexus服务中,找到releases和snapshots这两个库对应的URL

http://localhost:8082/repository/maven-releases/  
http://localhost:8082/repository/maven-snapshots/ 

maven,找到settingxml 配置文件

<servers>  
      ...  
      <server>  
            <id>maven-releases</id>  
            <username>admin nexus用户名</username>  
            <password>admin123 nexus密码</password>  
      </server>  
      <server>  
            <id>maven-snapshots</id>  
            <username>admin</username>  
            <password>admin123</password>  
      </server>  
      ...  
</servers>

在项目pom.xml文件中,做如下配置:

<distributionManagement>  
      <repository>  
        <id>maven-releases</id>  
        <url>http://localhost:8082/repository/maven-releases/</url>  
      </repository>  
      <snapshotRepository>  
        <id>maven-snapshots</id>  
        <url>http://localhost:8082/repository/maven-snapshots/</url>  
      </snapshotRepository>  
    </distributionManagement>


注意层级
回到该项目文件的根目录先后执行 mvn clean install / mvn clean deploy

看到
Uploaded to maven-snapshots即为成功

打开nexus仓库页面可以看到上传的文件

还可以手动上传
maven私服nexus上传第三方jar包以及下载


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM