fix(java): preserve Maven POM version spelling (#12714)

Co-authored-by: hhang <169027046+xu91102@users.noreply.github.com>
This commit is contained in:
hhangandhhang authored and GitHub committed 2026-11-19 23:04:11 -05:00
1 parent bb8e6833eb
commit e1218b0388
3 files changed
+41 -6

No files matched your search

@@ -449,6 +449,31 @@ it("applies XML end-of-line handling to POM text", () => {
]);
});
it.each([
["&#xA0;", "\u00a0"],
["&#xFEFF;", "\ufeff"],
["&#x20;", ""],
])(
"preserves declared POM version characters at a %s boundary",
(reference, retained) => {
const report = parse(`<project>
<modelVersion>4.0.0</modelVersion>
<groupId>example</groupId>
<artifactId>demo</artifactId>
<version> ${reference}1.0${reference} </version>
<dependencies>
<dependency>
<groupId>example</groupId>
<artifactId>library</artifactId>
<version> ${reference}2.0${reference} </version>
</dependency>
</dependencies>
</project>`);
expect(report.coordinates.version).toBe(`${retained}1.0${retained}`);
expect(report.dependencies[0]?.version).toBe(`${retained}2.0${retained}`);
},
);
it("lists properties in packaging, scope, type and classifier", () => {
const report = parse(`<project>
<groupId>com.example</groupId>