加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > Java > 正文

使用release自动打包发布正式版详细教程

发布时间:2020-12-14 06:34:09 所属栏目:Java 来源:网络整理
导读:昨天写了个,今天就在自动发布过程中遇到了许多坑,只能再写一篇自动发布详细教程,纪念我那昨日逝去的青春?(╥ _ ╥`)?? p align="left" release正常打包发布流程按照如下几个阶段: Check that there are no uncommitted changes in the sources Check tha

  昨天写了个,今天就在自动发布过程中遇到了许多坑,只能再写一篇自动发布详细教程,纪念我那昨日逝去的青春?(╥ _ ╥`)??

<p align="left">  release正常打包发布流程按照如下几个阶段:

  • Check that there are no uncommitted changes in the sources
  • Check that there are no SNAPSHOT dependencies
  • Change the version in the POMs from x-SNAPSHOT to a new version (you will be prompted for the versions to use)
  • Transform the SCM information in the POM to include the final destination of the tag
  • Run the project tests against the modified POMs to confirm everything is in working order
  • Commit the modified POMs
  • Tag the code in the SCM with a version name (this will be prompted for)
  • Bump the version in the POMs to a new value y-SNAPSHOT (these values will also be prompted for)
  • Commit the modified POMs

1. 检出项目

?????? 由上述流程可知,release打包发布成功的前提条件是于svn库中代码完全一致(包括配置文件、target文件夹、.classpath文件等),所以不能直接在eclipse进行build。

?????? 因此我们需要新建一个文件夹,重新检出项目,专门进行打包发布。

?

2. ?开始打包

在platform中打开控制台输入命令:

正常应出现:??????????????????

如果要用默认值,就直接回车。?

“你想将1.1.7-SNAPSHOT发布为什么版本?默认1.1.7。” ?  我要1.1.7,直接回车。

“发布的tag标签名称是什么?默认为v1.1.7。”?   我还是要默认值,直接回车。

“主干上新的版本是什么?默认为1.1.8-SNAPSHOT。”  ?哈,release插件会自动帮我更新版本到1.1-SNAPSHOT,很好,直接回车。

  然后屏幕刷阿刷,maven在build我们的项目,并进行了一些svn操作,你可以仔细查看下日志。

? ?<)╯???┸┸)`ν?)?

?

解决方案:

    这是platform的子模块存在快照版本的依赖,应改为正式版。(即没有-SNAPSHOT的jar版本)

  运行发布命令直接失败,显示release无依赖!!!

解决方案:

    检查配置是否齐全。

  platform父级模块的配置:

scm:svn:svn://SVN主路径地址/trunk/ org.apache.maven.plugins maven-release-plugin 2.5.3 true v@{project.version} false -DskipTests

org.apache.maven.plugins maven-release-plugin 2.5.3

运行发布命令直接失败,显示有与SVN库代码不一致。

解决方案:

给你个传送门,快往这里跑!? ??

3. ?清除release configuration信息

在发布或测试发布之后,会产生发布配置信息,如果下次再发布就需要将其删除,保持和SVN库代码一致。

    所用命令:

??????????????????????????? ????

4. ?清除target文件夹

同上,必须和SVN库代码保持一致。

所用命令:

???????? ????????

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读