原文:https://my.oschina.net/lujianing/blog/297128

1通过网页上传

这种方法只是上传了jar包。通过maven引用当前jar,不能取得jar的依赖

from pom的方式,选择pom文件,以及jar。通过maven引入jar时,会自动加载jar的依赖

2通过maven的方式depoly

在maven的conf/setting.xml 配置nexus私服的管理账号

在servers标签下添加server

   <server>
      <id>nexus-snapshots</id>
      <username>repouser</username>
      <password>repopwd</password>
    </server>

id可自己定义一个名称  以及私服的管理管的账号密码

在mirrors和profiles下配置nexus私服

<mirrors>
    <mirror>
      <!--This sends everything else to /public -->
      <id>nexus</id>
      <mirrorOf>*</mirrorOf>
      <url>http://192.168.10.8:18080/nexus/content/repositories/releases/</url>
    </mirror>
  </mirrors>
  <profiles>
    <profile>
      <id>nexus</id>
      <!--Enable snapshots for the built in central repo to direct -->
      <!--all requests to nexus via the mirror -->
      <repositories> 
        <repository> 
            <id>nexus</id> 
            <name>local private nexus</name> 
            <url>http://192.168.10.8:18080/nexus/content/groups/public</url> 
            <releases><enabled>true</enabled><updatePolicy>always</updatePolicy>
            <checksumPolicy>warn</checksumPolicy></releases> 
            <snapshots><enabled>false</enabled></snapshots> 
        </repository>        
      </repositories> 
      <pluginRepositories> 
        <pluginRepository> 
            <id>nexus</id> 
            <name>local private nexus</name> 
            <url>http://192.168.10.8:18080/nexus/content/groups/public</url> 
            <releases><enabled>true</enabled><updatePolicy>always</updatePolicy>
            <checksumPolicy>warn</checksumPolicy></releases> 
            <snapshots><enabled>false</enabled></snapshots> 
        </pluginRepository>        
       </pluginRepositories> 
    </profile>
  </profiles>
  <activeProfiles>
    <!--make the profile active all the time -->
    <activeProfile>nexus</activeProfile>
  </activeProfiles>

在项目的pom.xml中配置

 <distributionManagement>
        <repository>
            <id>nexus-releases</id>
            <name>Nexus Release Repository</name>
            <url>http://192.168.10.8:18080/nexus/content/repositories/releases/</url>
        </repository>
        <snapshotRepository>
            <id>nexus-snapshots</id>
            <name>Nexus Snapshot Repository</name>
            <url>http://192.168.10.8:18080/nexus/content/repositories/snapshots/</url>
        </snapshotRepository>
    </distributionManagement>

id与settings.xml中的server的id对应

当项目package后

mvn deploy

就可以将jar上传到nexus私服

上传jar至Nexus Repository Manager失败问题总结

参考:https://my.oschina.net/skyzwg/blog/846195

上传一直各种原因失败。于是逐步排查,总结出了几个小Tips:

  • 创建的仓库类型一定要是hosted类型的,否则无法上传(之前一直报405)

  • Snapshot库发布的版本必须以SNAPSHOT结尾

  • release发布的版本不能以SNAPSHOT结尾

【转】上传jar包到nexus私服的更多相关文章

  1. maven上传jar包到nexus私服后的存放路径 以及 使用IDEA上传jar包的步骤

    maven上传jar包到nexus私服的方法,网上大神详解很多,那么上传后的jar包存放到哪里了呢? 在下使用nexus3.2.1版本,在本地搭建了私服,使用maven上传jar包.最后结果如下: 点 ...

  2. (转)上传jar包到nexus私服

    场景:在使用私服Nexus时候经常需要上传jar包,但是对上传jar包的方式不是很熟悉,所以很有必要学习下. 1 通过网页上传 GAV Definition:选择GAV Parameters 输入JA ...

  3. 上传jar包到nexus私服

    摘要 通过网页和maven两种方式,上传本地的jar到nexus私服,以及引用jar时,自动引用依赖 1通过网页上传 这种方法只是上传了jar包.通过maven引用当前jar,不能取得jar的依赖   ...

  4. Maven第四篇【私有仓库、上传jar包、引用私服jar包、上传本地项目到私服】

    搭建私有服务器 前面已经说过了,我们使用Maven的使用,如果需要导入相对应的jar包,Maven首先会在我们的本地仓库中寻找->私有仓库->中心仓库- 然而,我们的本地仓库常常没有想要的 ...

  5. 上传jar包至nexus

    上传命令: mvn deploy:deploy-file -DgroupId=com.xxx -DartifactId=xxx-pdf -Dversion=16.10.0 -Dpackaging=ja ...

  6. 上传jar包至maven私服

    1.maven环境变量配置(新建系统变量,编辑Path) 2.修改maven的setting文件 2.1 私服的用户配置 2.2 私服镜像配置 2.3 (我也不知道是啥) <profile> ...

  7. 上传jar包到nexus

    注释掉: org.springframework.boot.autoconfigure.EnableAutoConfiguration=com.meeno.boot.oa.OaAutoConfigur ...

  8. Nexus3.0搭建私服上传JAR包 Windows10

    背景 近期换了一个项目组,用的是公司自研产品,涉及到很多内部JAR包引用,版本号很多,每次更新都是产品部给出jar包,项目组成员各自复制一套本地替换,来了新人各种安装配置,复杂度太高,这不,我一来,又 ...

  9. 实测Maven上传jar包到私服的方法归纳

    Hello,各位小伙伴大家好,我是小栈君.好久不见,最近因为工作的缘故,导致了更新变慢,但是小栈君也在积极的做素材的规划,毕竟学习知识点的归纳和提炼需要一定的时间. 所以还请大家多多见谅,下一期的分享 ...

随机推荐

  1. 高并发第二弹:并发概念及内存模型(JMM)

    高并发第二弹:并发概念及内存模型(JMM) 感谢 : 深入Java内存模型 http://www.importnew.com/10589.html, cpu缓存一致性 https://www.cnbl ...

  2. zoj 3747 (DP)(连续至多,连续至少)

    http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=5170 参考: http://blog.csdn.net/cc_again/ar ...

  3. Microsoft ReportViewer 控件类型版本兼容问题及解决方法

    错误 Parser Error Message: The base class includes the field 'rvEquipment', but its type (Microsoft.Re ...

  4. BZOJ P1188 HNOI2007 分裂游戏——solution

    题目描述: (<--这个) 组合游戏,——把每个石头看做一个游戏, Multi_game——消去i上的石子后,,k上的游戏又多了一个: 于是就套用multi_game的模型即可 求解SG函数时, ...

  5. ASP.NET MVC学习笔记 第一天

    MVC:Mode(模型).View(视图).Controller(控制器)         在服务器接收到请求(Request)时,路由(Routing)定义了应该调用的控制器,以及应该调用的控制器动 ...

  6. 安卓app开发-01-开发工具及环境配置

    安卓app开发-01-开发工具及环境配置 请大家根据推荐指数和自己的意愿选择 使用 Android Studio 1.可以使用 Android Studio 下载地址:http://www.andro ...

  7. malloc()函数,calloc()函数,realloc()函数,free()函数

    malloc()函数 头文件:#include <stdlib.h> malloc() 函数用来动态地分配内存空间,其原型为:void* malloc (size_t size); [参数 ...

  8. Python中的基础数据类型

    Python中基础数据类型 1.数字 整型a=12或者a=int(2),本质上各种数据类型都可看成是类,声明一个变量时候则是在实例化一个类. 整型具备的功能: class int(object): & ...

  9. .net 的page的OnInit方法

    /// <summary> /// 重写父类的方法,父类要执行的方法已经被覆盖 /// </summary> /// <param name="e"& ...

  10. 网络编程进阶---->>> hamc模块 socketserver模块验证合法性 两者进行通信连接

    我们在工作中经常遇到,你公司内的某一台电脑要去访问你的服务器或者一个服务端电脑,那么你是让每一台都进行连接吗?  那不可能的  你肯定要进行限定的 验证客户端链接的合法性: hamc模块 hamc也是 ...