fix(archive): 修复 JarUtils.parseArtifactId 不支持解析 .jar-unpack 目录路径 (合并到 3.1.x)#1113
Open
LuotuoMianyang wants to merge 1 commit into
Open
fix(archive): 修复 JarUtils.parseArtifactId 不支持解析 .jar-unpack 目录路径 (合并到 3.1.x)#1113LuotuoMianyang wants to merge 1 commit into
LuotuoMianyang wants to merge 1 commit into
Conversation
In unpack mode, ExplodedBizArchive adds the unpacked directory to classpath URLs. JarUtils.parseArtifactId failed to handle paths ending with .jar-unpack, causing issues when declareMode is enabled. Add detection for .jar-unpack paths with fallback to directory name parsing. Cherry-picked from PR sofastack#1105 (master) to 3.1.x branch. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 3.1.x #1113 +/- ##
=====================================
Coverage 0.00% 0.00%
=====================================
Files 167 167
Lines 6986 7006 +20
Branches 1029 1035 +6
=====================================
- Misses 6986 7006 +20 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Collaborator
|
@LuotuoMianyang 感谢这个修复,unpack 模式下 有一个性能问题建议修复: unpack 分支绕过了
|
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.
概要
将 #1105 回合到
3.1.x分支。在 unpack 模式下,
ExplodedBizArchive会将解压目录添加到类路径 URL 列表中。JarUtils.parseArtifactId无法处理以.jar-unpack结尾的路径,导致启用declareMode=true时解析失败。改动内容
JarUtils.parseArtifactId()中增加对.jar-unpack路径的检测parseArtifactIdFromUnpackedDir()方法,从解压目录中的pom.properties提取 artifactIdpom.properties不存在时,回退到从目录名解析测试覆盖(9 个测试用例)
META-INF/maven-archiver位置测试结果
sofa-ark-archive模块全部 22 个测试通过JarUtilsTest— 原有测试正常通过JarUtilsParseArtifactIdFromUnpackedDirTest— 9 个新测试用例全部通过