需要在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. Linux IO多路复用之epoll网络编程(含源码)

    前言 本章节是用基本的Linux基本函数加上epoll调用编写一个完整的服务器和客户端例子,可在Linux上运行,客户端和服务端的功能如下: 客户端从标准输入读入一行,发送到服务端 服务端从网络读取一 ...

  2. 476. Number Complement(补数)

    Given a positive integer, output its complement number. The complement strategy is to flip the bits ...

  3. mybatis基础学习5-一对多和多对多(简写)

    1:建实体类 建mysql表

  4. bzoj 303: [CQOI2009]中位数图【前缀和+瞎搞】

    处理出一个序列c,a[i]>b,c[i]=1;a[i]==b,c[i]=0;a[i]<b,c[i]=-1,然后s为c的前缀和,设w为b在a序列里的下标 注意到子序列一定横跨w,并且一个符合 ...

  5. 【HDU - 1241】Oil Deposits(dfs+染色)

    Oil Deposits Descriptions: The GeoSurvComp geologic survey company is responsible for detecting unde ...

  6. Luogu P1140 相似基因 【dp】By cellur925

    最近博客更不起来...然后又(照例)犯鼻炎了唉难受. 题目传送门 我们首先可以预处理碱基间的权值表.然后讲读入的碱基转化为数字,就变成了“数字匹配使权值最大”的问题.我们显然可以用动态规划解决. 两个 ...

  7. IE兼容之中文汉字请求乱码-network

    IE兼容之中文汉字请求乱码 IE控制台报错: IE网络报错: 解决方法: encodeURI('--- @ -- 子卿 -'); // "---%20@%20--%20%E5%AD%90%E ...

  8. 例题 3-5 生成元 digit generator

    #include<stdio.h> #include<string.h> #define maxn 100005 int ans[maxn]; //类似于 比较大的数组还是开导 ...

  9. ueditor 编辑

    1.net  config.json imageUrlPrefix

  10. bzoj1925 [Sdoi2010] 地精部落【DP】

    传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=1925 一个多月前“过”了这道题,还自欺欺人地认为懂了这道题,这直接导致了昨晚多校联测2的T3 ...