昨天写了个,今天就在自动发布过程中遇到了许多坑,只能再写一篇自动发布详细教程,纪念我那昨日逝去的青春 (╥ _ ╥`)
<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父级模块的配置:
运行发布命令直接失败,显示有与SVN库代码不一致。
解决方案:
3. 清除release configuration信息
在发布或测试发布之后,会产生发布配置信息,如果下次再发布就需要将其删除,保持和SVN库代码一致。
所用命令:
4. 清除target文件夹
同上,必须和SVN库代码保持一致。
所用命令:
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。