fix: 修复 cola-archetype-light 5.0.0 中 test-container 依赖版本错误#601
Open
yiyongbo wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
一、变更内容
本次 PR 修复 cola-archetype-light:5.0.0 脚手架模板中的依赖版本问题。
当前使用 cola-archetype-light:5.0.0 创建项目后,生成项目中的 cola-component-test-container 依赖版本为:
xml com.alibaba.cola cola-component-test-container 4.4.0-SNAPSHOT
该版本在 Maven 仓库中无法解析,导致生成项目执行 Maven install 时构建失败。
本次修复将该依赖版本调整为:
xml com.alibaba.cola cola-component-test-container 5.0.0
二、问题原因
使用 IntelliJ IDEA 创建 Maven Archetype 项目时,选择:
text com.alibaba.cola:cola-archetype-light:5.0.0
项目创建成功后执行:
bash mvn clean install
会出现以下错误:
text Could not find artifact com.alibaba.cola:cola-component-test-container:jar:4.4.0-SNAPSHOT
经检查,生成项目的 pom.xml 中仍然引用了旧版本:
text 4.4.0-SNAPSHOT
而当前脚手架版本为 5.0.0,并且 Maven 仓库中无法找到对应的 4.4.0-SNAPSHOT 依赖。
因此判断是 cola-archetype-light:5.0.0 的模板文件中残留了旧的依赖版本号。
三、复现环境
四、复现步骤
text com.alibaba.cola:cola-archetype-light:5.0.0
bash mvn clean install
text Could not find artifact com.alibaba.cola:cola-component-test-container:jar:4.4.0-SNAPSHOT
五、验证结果
将 cola-component-test-container 的依赖版本从:
text 4.4.0-SNAPSHOT
修改为:
text 5.0.0
后,重新执行:
bash mvn clean install
项目可以正常构建。
六、关联 Issue
Fixes #600