需要在maven的setting.xml中配置servers.server节点,其值为nexus的对应的repository的id以及用户名及密码

  1. <servers>
  2. <server>
  3. <id>releases</id>
  4. <username>admin</username>
  5. <password>admin</password>
  6. </server>
  7. <server>
  8. <id>snapshots</id>
  9. <username>deployment</username>
  10. <password>deployment</password>
  11. </server>
  12. </servers>

mvn release:prepare -Pxxxx 将用setting.xml中定义的profile为我们提交,打tag,升级pom,再提交的一连串动作(但不要忘了setting.xml的profile定义及pom.xm中定义好maven-release-plugin的tagBase,username,password以及每个模块的scm信息)

maven conf/setting.xml

  1. <profiles>
  2. <profile>
  3. <id>xxxx</id>
  4. <properties>
  5. <svn.name>username</svn.name>
  6. <svn.pwd>password</svn.pwd>
  7. </properties>
  8. </profile>
  9. </profiles>

项目 pom.xml (让子模块都继承自另一个模块,类型为pom,假定名称为parent)

  1. <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  2. <modelVersion>4.0.0</modelVersion>
  3. <parent>
  4. <groupId>xxx.xx.xxx</groupId>
  5. <artifactId>xxxx</artifactId>
  6. <version>0.3-SNAPSHOT</version>
  7. </parent>
  8. <groupId><u><span style="color:#0066cc;">xxx.xx.xxx</span></u></groupId>
  9. <artifactId>parent</artifactId>
  10. <name>parent</name>
  11. <packaging>pom</packaging>
  12. <scm>
  13. <connection>scm:svn:https://192.168.1.88/svn/xxxx/trunk/parent</connection>
  14. <url>https://192.168.1.88/svn/xxxx/trunk/parent</url>
  15. </scm>
  16. <build>
  17. <plugins>
  18. <plugin>
  19. <groupId>org.apache.maven.plugins</groupId>
  20. <artifactId>maven-release-plugin</artifactId>
  21. <configuration>
  22. <tagBase>https://192.168.1.88/svn/xxxx/tags/</tagBase>
  23. <username>${svn.name}</username>
  24. <password>${svn.pwd}</password>
  25. </configuration>
  26. </plugin>
  27. </plugins>
  28. </build>
  29. </project>

这样mvn release:perform时maven-release-plugin会自动帮我们签出刚才打的tag,然后打包,分发到远程Maven仓库中(nexus).

注意:如果要把快照版本也发布到存储库,需要在trunk中执行mvn deploy,并且一定要配置snapshotRepository

maven release插件将一版本发布到仓库中时Return code is: 401, ReasonPhrase:Unauthorized的更多相关文章

  1. Maven-008-Nexus 私服部署发布报错 Failed to deploy artifacts: Failed to transfer file: ... Return code is: 4XX, ReasonPhrase: ... 解决方案

    我在部署构件至 maven nexus 私服时,有时会出现 Failed to deploy artifacts: Failed to transfer file: ... Return code i ...

  2. 到底如何配置 maven 编译插件的 JDK 版本

    千言万语不及官方文档,详情请阅读 compiler:compile 文档 配置 maven 编译插件的 JDK 版本 maven 编译插件(maven-compiler-plugin)有默认编译 JD ...

  3. Maven私有仓库: 发布release版本报错:Return code is: 400, ReasonPhrase: Repository does not allow upd ating assets: maven-releases.

    今天在将一个maven组件由SNAPSHORT升级为正式版本1.0.0,然后执行发布: mvn clean deploy -pl ielong-common -am -DskipTests, 报错:R ...

  4. 解决Maven 报 Return code is: 400 , ReasonPhrase:Repository version policy: SNAPSHOT does not allow version: 2.1.0.RELEASE. 的错误

    最近在搭建公司的基础框架,业务需求用到elasticsearch,所以需要整合到基础框架里,供各业务线使用同时也便于管理,但在整合的过程中,出现了莫名的问题,同时maven的提示也不够明确. 我的版本 ...

  5. 【Maven错误】 Non-resolvable parent POM for ...... Return code is: 500 , ReasonPhrase:Internal Server Error. and 'parent.relativePath' points at no local POM @ line 14, column 11

    一.异常信息 [INFO] Scanning for projects... Downloading: http://www.myhost.com/maven/jdk18/org/springfram ...

  6. maven deploy Return code is: 400, ReasonPhrase: Bad Request.

    最近在自己本地deploy jar 到本地 nexus的时候,报错 Return code is: 400, ReasonPhrase: Bad Request. 解决思路: 1.查看maven pr ...

  7. maven报错:Return code is: 501 , ReasonPhrase:HTTPS Required

    今天把一个去年没做完的项目翻出来做时,发现maven无法正常导入依赖.检查了一遍项目配置,没发现有什么问题.而且依赖在本地仓库存在. 随后发现报错:Failed to transfer file:** ...

  8. JEECG-P3首个开源插件诞生!CMS网站插件 Jeecg-p3-biz-cms1.0版本发布!

    Jeecg-P3-Biz-Cms   ( JEECG 首个微服务插件,支持小程序的CMS系统) 是基于JEECG-P3 微服务框架开发的CMS建站系统,可轻量级集成进jeecg系统,定制各类网站模板, ...

  9. 挖一下插件v1.5版本发布

    Chrome图片下载插件,支持网页截屏 v.1.5更新说明: 1.增加下载图片按日期分类保存选项,便于管理,用户可根据需要开启/关闭此设置 2.增加网页图片采集快捷键: (1)采集页面图片(Ctrl+ ...

随机推荐

  1. sphinx是支持结果聚类的

    Coreseek 4.1 参考手册 / Sphinx 2.0.1-beta Sphinx--强大的开源全文检索引擎,Coreseek--免费开源的中文全文检索引擎 版权 © 2001-2011 And ...

  2. AutoIT: 下载文件函数

    Func down() $Size=InetGetSize($a[$j][]);获得FTP上的文件的大小 InetGet($a[$j][],$a[$j][],,);下载 ProgressOn(],), ...

  3. python名片管理系统V2

    主程序: #! /usr/bin env python3 # -*- coding: utf-8 -*- # 项目三: # 1.要求:编写一个名片管理系统,功能如下: # 用户输入相对应的指令,实现对 ...

  4. E20170520-ts

    regexp  n. 正则表达式 metacharacter メタ文字 元字符 quote   vt. 引述,引用; escape  v. 逃脱; 逃离;   n. 逃走; 逃跑工具或方法;  reg ...

  5. bzoj 2216: [Poi2011]Lightning Conductor【决策单调性dp+分治】

    参考:https://blog.csdn.net/clove_unique/article/details/57405845 死活不过样例看了题解才发现要用double.... \[ a_j \leq ...

  6. SSM框架手动搭建

    SSM框架手动搭建 创建web项目 IDEA创建Maven项目 [File]-->[new]-->[project..] 将项目变为web项目 [File]-->[Project S ...

  7. Luogu P1638 逛画展 【二分答案】

    题目描述 博览馆正在展出由世上最佳的 M 位画家所画的图画. wangjy想到博览馆去看这几位大师的作品. 可是,那里的博览馆有一个很奇怪的规定,就是在购买门票时必须说明两个数字, a和b,代表他要看 ...

  8. Logstash读取文本信息并写入到ES

    Logstash读取文本信息并写入到ES 前提是ELK安装没问题 进入到logstash安装目录下的bin目录(我的logstash安装目录:/usr/local/) [root@es1 bin]# ...

  9. Java键盘输入的方法

    转载:http://blog.csdn.net/u012249177/article/details/49586383 java输入的方法: import java.io.BufferedReader ...

  10. QString:常用成员函数总结

    QString是Qt中使用频率最高的几种数据类型之一,主要在于其提供了大量功能强大的成员函数,这里重点介绍一些常用的成员函数: 一.字符串处理相关 1.1 split() (拆分字符串) split( ...