mirror of
https://github.com/morluto/rea.git
synced 2026-11-19 13:12:26 +00:00
fix(maven): preserve qualified property keys in metadata (#11860)
fix(maven): preserve qualified property keys
This commit is contained in:
1 parent
82e16b4dda
commit
004c43e32a
4 files changed
+98
-13
No files matched your search
@@ -54,6 +54,27 @@ export const mavenPomFixture = `<?xml version="1.0" encoding="UTF-8"?>
|
||||
</project>
|
||||
`;
|
||||
|
||||
/** Maven property keys keep their prefixes even when XML namespace URIs agree. */
|
||||
export const qualifiedMavenPropertiesFixture = `<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:a="urn:revisions" xmlns:b="urn:revisions">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>example</groupId>
|
||||
<artifactId>qualified-properties</artifactId>
|
||||
<version>\${a:revision}</version>
|
||||
<properties>
|
||||
<revision>0</revision>
|
||||
<a:revision>11</a:revision>
|
||||
<b:revision>22</b:revision>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>example</groupId>
|
||||
<artifactId>dependency</artifactId>
|
||||
<version>\${b:revision}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
`;
|
||||
|
||||
/** Tiny Gradle Module Metadata 1.1 document with library and platform variants. */
|
||||
export const gradleModuleFixture = `{
|
||||
"formatVersion": "1.1",
|
||||
|
||||
@@ -325,15 +325,15 @@ const parsePom = (
|
||||
const properties =
|
||||
propertiesElement === undefined
|
||||
? []
|
||||
: childElements(propertiesElement).flatMap((property) => {
|
||||
const name = nonempty(property.localName);
|
||||
if (name === null) return [];
|
||||
: childElements(propertiesElement).map((property) => {
|
||||
// A property may hold a repository URL; its userinfo never leaves the parser.
|
||||
const {
|
||||
url: value,
|
||||
url_credentials_redacted: value_credentials_redacted,
|
||||
} = redactRecordedTransportUrl(elementText(property));
|
||||
return [{ name, value, value_credentials_redacted }];
|
||||
// Maven property keys are the written qualified names, not XML
|
||||
// expanded names: different prefixes remain different keys.
|
||||
return { name: property.tagName, value, value_credentials_redacted };
|
||||
});
|
||||
const dependencyManagementElement = soleNamed(root, "dependencyManagement");
|
||||
const managedContainer = dependencyManagementElement
|
||||
|
||||
Reference in new issue
Block a user