Skip to content
Snippets Groups Projects
Unverified Commit ead221dd authored by Nils Plaschke's avatar Nils Plaschke Committed by GitHub
Browse files

fix: remove default maven central registry (#13950)


* fix: remove default maven central registry

* chore: simplify maven extract tests

Co-authored-by: default avatarRhys Arkins <rhys@arkins.net>
Co-authored-by: default avatarMichael Kriese <michael.kriese@visualon.de>
parent 1525d38c
Branches
No related tags found
No related merge requests found
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0">
<modelVersion>4.0.0</modelVersion>
<groupId>org.example</groupId>
<artifactId>ExamplePomFile</artifactId>
<name>Example</name>
<version>0.0.1</version>
<description>Minimal example</description>
<url>http://example.org/index.html</url>
<scm>
<url>http://example.org/src.git</url>
</scm>
<issueManagement>
<url>http://example.org/</url>
</issueManagement>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.example</groupId>
<artifactId>foo</artifactId>
<version>0.0.1</version>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.example</groupId>
<artifactId>quuz</artifactId>
<version>1.2.3</version>
<scope>test</scope>
</dependency>
</dependencies>
<profiles>
<profile>
<id>profile-id</id>
<reporting>
<plugins>
<plugin>
<groupId>org.example</groupId>
<artifactId>profile-build-artefact</artifactId>
<version>2.17</version>
<configuration>
<configLocation>google_checks.xml</configLocation>
</configuration>
</plugin>
</plugins>
</reporting>
</profile>
</profiles>
<repositories>
<repository>
<id>nonsense</id>
<name>The item without url</name>
</repository>
</repositories>
</project>
...@@ -11,7 +11,6 @@ Object { ...@@ -11,7 +11,6 @@ Object {
"depType": "parent", "depType": "parent",
"fileReplacePosition": 186, "fileReplacePosition": 186,
"registryUrls": Array [ "registryUrls": Array [
"https://repo.maven.apache.org/maven2",
"https://maven.atlassian.com/content/repositories/atlassian-public/", "https://maven.atlassian.com/content/repositories/atlassian-public/",
], ],
}, },
...@@ -22,7 +21,6 @@ Object { ...@@ -22,7 +21,6 @@ Object {
"depType": "compile", "depType": "compile",
"fileReplacePosition": 905, "fileReplacePosition": 905,
"registryUrls": Array [ "registryUrls": Array [
"https://repo.maven.apache.org/maven2",
"https://maven.atlassian.com/content/repositories/atlassian-public/", "https://maven.atlassian.com/content/repositories/atlassian-public/",
], ],
}, },
...@@ -33,7 +31,6 @@ Object { ...@@ -33,7 +31,6 @@ Object {
"depType": "compile", "depType": "compile",
"fileReplacePosition": 1093, "fileReplacePosition": 1093,
"registryUrls": Array [ "registryUrls": Array [
"https://repo.maven.apache.org/maven2",
"https://maven.atlassian.com/content/repositories/atlassian-public/", "https://maven.atlassian.com/content/repositories/atlassian-public/",
], ],
}, },
...@@ -44,7 +41,6 @@ Object { ...@@ -44,7 +41,6 @@ Object {
"depType": "build", "depType": "build",
"fileReplacePosition": 1347, "fileReplacePosition": 1347,
"registryUrls": Array [ "registryUrls": Array [
"https://repo.maven.apache.org/maven2",
"https://maven.atlassian.com/content/repositories/atlassian-public/", "https://maven.atlassian.com/content/repositories/atlassian-public/",
], ],
}, },
...@@ -55,7 +51,6 @@ Object { ...@@ -55,7 +51,6 @@ Object {
"depType": "build", "depType": "build",
"fileReplacePosition": 1545, "fileReplacePosition": 1545,
"registryUrls": Array [ "registryUrls": Array [
"https://repo.maven.apache.org/maven2",
"https://maven.atlassian.com/content/repositories/atlassian-public/", "https://maven.atlassian.com/content/repositories/atlassian-public/",
], ],
}, },
...@@ -66,7 +61,6 @@ Object { ...@@ -66,7 +61,6 @@ Object {
"depType": "build", "depType": "build",
"fileReplacePosition": 2276, "fileReplacePosition": 2276,
"registryUrls": Array [ "registryUrls": Array [
"https://repo.maven.apache.org/maven2",
"https://maven.atlassian.com/content/repositories/atlassian-public/", "https://maven.atlassian.com/content/repositories/atlassian-public/",
], ],
}, },
...@@ -77,7 +71,6 @@ Object { ...@@ -77,7 +71,6 @@ Object {
"depType": "compile", "depType": "compile",
"fileReplacePosition": 2484, "fileReplacePosition": 2484,
"registryUrls": Array [ "registryUrls": Array [
"https://repo.maven.apache.org/maven2",
"https://maven.atlassian.com/content/repositories/atlassian-public/", "https://maven.atlassian.com/content/repositories/atlassian-public/",
], ],
}, },
...@@ -88,7 +81,6 @@ Object { ...@@ -88,7 +81,6 @@ Object {
"depType": "compile", "depType": "compile",
"fileReplacePosition": 2634, "fileReplacePosition": 2634,
"registryUrls": Array [ "registryUrls": Array [
"https://repo.maven.apache.org/maven2",
"https://maven.atlassian.com/content/repositories/atlassian-public/", "https://maven.atlassian.com/content/repositories/atlassian-public/",
], ],
}, },
...@@ -99,7 +91,6 @@ Object { ...@@ -99,7 +91,6 @@ Object {
"depType": "compile", "depType": "compile",
"fileReplacePosition": 2779, "fileReplacePosition": 2779,
"registryUrls": Array [ "registryUrls": Array [
"https://repo.maven.apache.org/maven2",
"https://maven.atlassian.com/content/repositories/atlassian-public/", "https://maven.atlassian.com/content/repositories/atlassian-public/",
], ],
}, },
...@@ -110,7 +101,6 @@ Object { ...@@ -110,7 +101,6 @@ Object {
"depType": "compile", "depType": "compile",
"fileReplacePosition": 2938, "fileReplacePosition": 2938,
"registryUrls": Array [ "registryUrls": Array [
"https://repo.maven.apache.org/maven2",
"https://maven.atlassian.com/content/repositories/atlassian-public/", "https://maven.atlassian.com/content/repositories/atlassian-public/",
], ],
}, },
...@@ -121,7 +111,6 @@ Object { ...@@ -121,7 +111,6 @@ Object {
"depType": "test", "depType": "test",
"fileReplacePosition": 3086, "fileReplacePosition": 3086,
"registryUrls": Array [ "registryUrls": Array [
"https://repo.maven.apache.org/maven2",
"https://maven.atlassian.com/content/repositories/atlassian-public/", "https://maven.atlassian.com/content/repositories/atlassian-public/",
], ],
}, },
...@@ -132,7 +121,6 @@ Object { ...@@ -132,7 +121,6 @@ Object {
"depType": "compile", "depType": "compile",
"fileReplacePosition": 3252, "fileReplacePosition": 3252,
"registryUrls": Array [ "registryUrls": Array [
"https://repo.maven.apache.org/maven2",
"https://maven.atlassian.com/content/repositories/atlassian-public/", "https://maven.atlassian.com/content/repositories/atlassian-public/",
], ],
}, },
...@@ -143,7 +131,6 @@ Object { ...@@ -143,7 +131,6 @@ Object {
"depType": "compile", "depType": "compile",
"fileReplacePosition": 3410, "fileReplacePosition": 3410,
"registryUrls": Array [ "registryUrls": Array [
"https://repo.maven.apache.org/maven2",
"https://maven.atlassian.com/content/repositories/atlassian-public/", "https://maven.atlassian.com/content/repositories/atlassian-public/",
], ],
}, },
...@@ -153,7 +140,6 @@ Object { ...@@ -153,7 +140,6 @@ Object {
"depName": "org.example:relocation-artifact", "depName": "org.example:relocation-artifact",
"fileReplacePosition": 3612, "fileReplacePosition": 3612,
"registryUrls": Array [ "registryUrls": Array [
"https://repo.maven.apache.org/maven2",
"https://maven.atlassian.com/content/repositories/atlassian-public/", "https://maven.atlassian.com/content/repositories/atlassian-public/",
], ],
}, },
...@@ -164,7 +150,6 @@ Object { ...@@ -164,7 +150,6 @@ Object {
"depType": "compile", "depType": "compile",
"fileReplacePosition": 3944, "fileReplacePosition": 3944,
"registryUrls": Array [ "registryUrls": Array [
"https://repo.maven.apache.org/maven2",
"https://maven.atlassian.com/content/repositories/atlassian-public/", "https://maven.atlassian.com/content/repositories/atlassian-public/",
], ],
}, },
...@@ -175,7 +160,6 @@ Object { ...@@ -175,7 +160,6 @@ Object {
"depType": "build", "depType": "build",
"fileReplacePosition": 4200, "fileReplacePosition": 4200,
"registryUrls": Array [ "registryUrls": Array [
"https://repo.maven.apache.org/maven2",
"https://maven.atlassian.com/content/repositories/atlassian-public/", "https://maven.atlassian.com/content/repositories/atlassian-public/",
], ],
}, },
...@@ -186,7 +170,6 @@ Object { ...@@ -186,7 +170,6 @@ Object {
"depType": "build", "depType": "build",
"fileReplacePosition": 4594, "fileReplacePosition": 4594,
"registryUrls": Array [ "registryUrls": Array [
"https://repo.maven.apache.org/maven2",
"https://maven.atlassian.com/content/repositories/atlassian-public/", "https://maven.atlassian.com/content/repositories/atlassian-public/",
], ],
}, },
...@@ -211,3 +194,37 @@ Object { ...@@ -211,3 +194,37 @@ Object {
"packageFile": null, "packageFile": null,
} }
`; `;
exports[`manager/maven/extract extractDependencies extract dependencies from any XML position with Central Maven 1`] = `
Object {
"datasource": "maven",
"deps": Array [
Object {
"currentValue": "0.0.1",
"datasource": "maven",
"depName": "org.example:foo",
"depType": "compile",
"fileReplacePosition": 637,
"registryUrls": Array [],
},
Object {
"currentValue": "1.2.3",
"datasource": "maven",
"depName": "org.example:quuz",
"depType": "test",
"fileReplacePosition": 842,
"registryUrls": Array [],
},
Object {
"currentValue": "2.17",
"datasource": "maven",
"depName": "org.example:profile-build-artefact",
"depType": "build",
"fileReplacePosition": 1153,
"registryUrls": Array [],
},
],
"mavenProps": Object {},
"packageFile": null,
}
`;
...@@ -12,7 +12,6 @@ Array [ ...@@ -12,7 +12,6 @@ Array [
"depType": "parent", "depType": "parent",
"fileReplacePosition": 186, "fileReplacePosition": 186,
"registryUrls": Array [ "registryUrls": Array [
"https://repo.maven.apache.org/maven2",
"https://maven.atlassian.com/content/repositories/atlassian-public/", "https://maven.atlassian.com/content/repositories/atlassian-public/",
], ],
}, },
...@@ -23,7 +22,6 @@ Array [ ...@@ -23,7 +22,6 @@ Array [
"depType": "compile", "depType": "compile",
"fileReplacePosition": 905, "fileReplacePosition": 905,
"registryUrls": Array [ "registryUrls": Array [
"https://repo.maven.apache.org/maven2",
"https://maven.atlassian.com/content/repositories/atlassian-public/", "https://maven.atlassian.com/content/repositories/atlassian-public/",
], ],
}, },
...@@ -34,7 +32,6 @@ Array [ ...@@ -34,7 +32,6 @@ Array [
"depType": "compile", "depType": "compile",
"fileReplacePosition": 1093, "fileReplacePosition": 1093,
"registryUrls": Array [ "registryUrls": Array [
"https://repo.maven.apache.org/maven2",
"https://maven.atlassian.com/content/repositories/atlassian-public/", "https://maven.atlassian.com/content/repositories/atlassian-public/",
], ],
}, },
...@@ -45,7 +42,6 @@ Array [ ...@@ -45,7 +42,6 @@ Array [
"depType": "build", "depType": "build",
"fileReplacePosition": 1347, "fileReplacePosition": 1347,
"registryUrls": Array [ "registryUrls": Array [
"https://repo.maven.apache.org/maven2",
"https://maven.atlassian.com/content/repositories/atlassian-public/", "https://maven.atlassian.com/content/repositories/atlassian-public/",
], ],
}, },
...@@ -56,7 +52,6 @@ Array [ ...@@ -56,7 +52,6 @@ Array [
"depType": "build", "depType": "build",
"fileReplacePosition": 1545, "fileReplacePosition": 1545,
"registryUrls": Array [ "registryUrls": Array [
"https://repo.maven.apache.org/maven2",
"https://maven.atlassian.com/content/repositories/atlassian-public/", "https://maven.atlassian.com/content/repositories/atlassian-public/",
], ],
}, },
...@@ -67,7 +62,6 @@ Array [ ...@@ -67,7 +62,6 @@ Array [
"depType": "build", "depType": "build",
"fileReplacePosition": 2276, "fileReplacePosition": 2276,
"registryUrls": Array [ "registryUrls": Array [
"https://repo.maven.apache.org/maven2",
"https://maven.atlassian.com/content/repositories/atlassian-public/", "https://maven.atlassian.com/content/repositories/atlassian-public/",
], ],
}, },
...@@ -78,7 +72,6 @@ Array [ ...@@ -78,7 +72,6 @@ Array [
"depType": "compile", "depType": "compile",
"fileReplacePosition": 2484, "fileReplacePosition": 2484,
"registryUrls": Array [ "registryUrls": Array [
"https://repo.maven.apache.org/maven2",
"https://maven.atlassian.com/content/repositories/atlassian-public/", "https://maven.atlassian.com/content/repositories/atlassian-public/",
], ],
"skipReason": "name-placeholder", "skipReason": "name-placeholder",
...@@ -90,7 +83,6 @@ Array [ ...@@ -90,7 +83,6 @@ Array [
"depType": "compile", "depType": "compile",
"fileReplacePosition": 2634, "fileReplacePosition": 2634,
"registryUrls": Array [ "registryUrls": Array [
"https://repo.maven.apache.org/maven2",
"https://maven.atlassian.com/content/repositories/atlassian-public/", "https://maven.atlassian.com/content/repositories/atlassian-public/",
], ],
"skipReason": "name-placeholder", "skipReason": "name-placeholder",
...@@ -103,7 +95,6 @@ Array [ ...@@ -103,7 +95,6 @@ Array [
"fileReplacePosition": 698, "fileReplacePosition": 698,
"groupName": "quuxVersion", "groupName": "quuxVersion",
"registryUrls": Array [ "registryUrls": Array [
"https://repo.maven.apache.org/maven2",
"https://maven.atlassian.com/content/repositories/atlassian-public/", "https://maven.atlassian.com/content/repositories/atlassian-public/",
], ],
}, },
...@@ -115,7 +106,6 @@ Array [ ...@@ -115,7 +106,6 @@ Array [
"fileReplacePosition": 698, "fileReplacePosition": 698,
"groupName": "quuxVersion", "groupName": "quuxVersion",
"registryUrls": Array [ "registryUrls": Array [
"https://repo.maven.apache.org/maven2",
"https://maven.atlassian.com/content/repositories/atlassian-public/", "https://maven.atlassian.com/content/repositories/atlassian-public/",
], ],
}, },
...@@ -126,7 +116,6 @@ Array [ ...@@ -126,7 +116,6 @@ Array [
"depType": "test", "depType": "test",
"fileReplacePosition": 3086, "fileReplacePosition": 3086,
"registryUrls": Array [ "registryUrls": Array [
"https://repo.maven.apache.org/maven2",
"https://maven.atlassian.com/content/repositories/atlassian-public/", "https://maven.atlassian.com/content/repositories/atlassian-public/",
], ],
}, },
...@@ -137,7 +126,6 @@ Array [ ...@@ -137,7 +126,6 @@ Array [
"depType": "compile", "depType": "compile",
"fileReplacePosition": 3252, "fileReplacePosition": 3252,
"registryUrls": Array [ "registryUrls": Array [
"https://repo.maven.apache.org/maven2",
"https://maven.atlassian.com/content/repositories/atlassian-public/", "https://maven.atlassian.com/content/repositories/atlassian-public/",
], ],
}, },
...@@ -148,7 +136,6 @@ Array [ ...@@ -148,7 +136,6 @@ Array [
"depType": "compile", "depType": "compile",
"fileReplacePosition": 3410, "fileReplacePosition": 3410,
"registryUrls": Array [ "registryUrls": Array [
"https://repo.maven.apache.org/maven2",
"https://maven.atlassian.com/content/repositories/atlassian-public/", "https://maven.atlassian.com/content/repositories/atlassian-public/",
], ],
}, },
...@@ -158,7 +145,6 @@ Array [ ...@@ -158,7 +145,6 @@ Array [
"depName": "org.example:relocation-artifact", "depName": "org.example:relocation-artifact",
"fileReplacePosition": 3612, "fileReplacePosition": 3612,
"registryUrls": Array [ "registryUrls": Array [
"https://repo.maven.apache.org/maven2",
"https://maven.atlassian.com/content/repositories/atlassian-public/", "https://maven.atlassian.com/content/repositories/atlassian-public/",
], ],
}, },
...@@ -169,7 +155,6 @@ Array [ ...@@ -169,7 +155,6 @@ Array [
"depType": "compile", "depType": "compile",
"fileReplacePosition": 3944, "fileReplacePosition": 3944,
"registryUrls": Array [ "registryUrls": Array [
"https://repo.maven.apache.org/maven2",
"https://maven.atlassian.com/content/repositories/atlassian-public/", "https://maven.atlassian.com/content/repositories/atlassian-public/",
], ],
"skipReason": "version-placeholder", "skipReason": "version-placeholder",
...@@ -181,7 +166,6 @@ Array [ ...@@ -181,7 +166,6 @@ Array [
"depType": "build", "depType": "build",
"fileReplacePosition": 4200, "fileReplacePosition": 4200,
"registryUrls": Array [ "registryUrls": Array [
"https://repo.maven.apache.org/maven2",
"https://maven.atlassian.com/content/repositories/atlassian-public/", "https://maven.atlassian.com/content/repositories/atlassian-public/",
], ],
}, },
...@@ -192,7 +176,6 @@ Array [ ...@@ -192,7 +176,6 @@ Array [
"depType": "build", "depType": "build",
"fileReplacePosition": 4594, "fileReplacePosition": 4594,
"registryUrls": Array [ "registryUrls": Array [
"https://repo.maven.apache.org/maven2",
"https://maven.atlassian.com/content/repositories/atlassian-public/", "https://maven.atlassian.com/content/repositories/atlassian-public/",
], ],
}, },
...@@ -215,7 +198,6 @@ Array [ ...@@ -215,7 +198,6 @@ Array [
"depType": "parent", "depType": "parent",
"fileReplacePosition": 185, "fileReplacePosition": 185,
"registryUrls": Array [ "registryUrls": Array [
"https://repo.maven.apache.org/maven2",
"http://example.com/nexus/xyz", "http://example.com/nexus/xyz",
"http://example.com/", "http://example.com/",
], ],
...@@ -229,7 +211,6 @@ Array [ ...@@ -229,7 +211,6 @@ Array [
"fileReplacePosition": 470, "fileReplacePosition": 470,
"groupName": "quuxVersion", "groupName": "quuxVersion",
"registryUrls": Array [ "registryUrls": Array [
"https://repo.maven.apache.org/maven2",
"http://example.com/", "http://example.com/",
"http://example.com/nexus/xyz", "http://example.com/nexus/xyz",
], ],
...@@ -248,7 +229,6 @@ Array [ ...@@ -248,7 +229,6 @@ Array [
"depType": "parent", "depType": "parent",
"fileReplacePosition": 186, "fileReplacePosition": 186,
"registryUrls": Array [ "registryUrls": Array [
"https://repo.maven.apache.org/maven2",
"http://example.com/", "http://example.com/",
"http://example.com/nexus/xyz", "http://example.com/nexus/xyz",
], ],
...@@ -260,7 +240,6 @@ Array [ ...@@ -260,7 +240,6 @@ Array [
"depType": "compile", "depType": "compile",
"fileReplacePosition": 806, "fileReplacePosition": 806,
"registryUrls": Array [ "registryUrls": Array [
"https://repo.maven.apache.org/maven2",
"http://example.com/", "http://example.com/",
"http://example.com/nexus/xyz", "http://example.com/nexus/xyz",
], ],
...@@ -272,7 +251,6 @@ Array [ ...@@ -272,7 +251,6 @@ Array [
"depType": "compile", "depType": "compile",
"fileReplacePosition": 954, "fileReplacePosition": 954,
"registryUrls": Array [ "registryUrls": Array [
"https://repo.maven.apache.org/maven2",
"http://example.com/", "http://example.com/",
"http://example.com/nexus/xyz", "http://example.com/nexus/xyz",
], ],
...@@ -284,7 +262,6 @@ Array [ ...@@ -284,7 +262,6 @@ Array [
"depType": "build", "depType": "build",
"fileReplacePosition": 1188, "fileReplacePosition": 1188,
"registryUrls": Array [ "registryUrls": Array [
"https://repo.maven.apache.org/maven2",
"http://example.com/", "http://example.com/",
"http://example.com/nexus/xyz", "http://example.com/nexus/xyz",
], ],
...@@ -296,7 +273,6 @@ Array [ ...@@ -296,7 +273,6 @@ Array [
"depType": "build", "depType": "build",
"fileReplacePosition": 1386, "fileReplacePosition": 1386,
"registryUrls": Array [ "registryUrls": Array [
"https://repo.maven.apache.org/maven2",
"http://example.com/", "http://example.com/",
"http://example.com/nexus/xyz", "http://example.com/nexus/xyz",
], ],
...@@ -308,7 +284,6 @@ Array [ ...@@ -308,7 +284,6 @@ Array [
"depType": "compile", "depType": "compile",
"fileReplacePosition": 2131, "fileReplacePosition": 2131,
"registryUrls": Array [ "registryUrls": Array [
"https://repo.maven.apache.org/maven2",
"http://example.com/", "http://example.com/",
"http://example.com/nexus/xyz", "http://example.com/nexus/xyz",
], ],
...@@ -321,7 +296,6 @@ Array [ ...@@ -321,7 +296,6 @@ Array [
"depType": "compile", "depType": "compile",
"fileReplacePosition": 2281, "fileReplacePosition": 2281,
"registryUrls": Array [ "registryUrls": Array [
"https://repo.maven.apache.org/maven2",
"http://example.com/", "http://example.com/",
"http://example.com/nexus/xyz", "http://example.com/nexus/xyz",
], ],
...@@ -334,7 +308,6 @@ Array [ ...@@ -334,7 +308,6 @@ Array [
"depType": "compile", "depType": "compile",
"fileReplacePosition": 2574, "fileReplacePosition": 2574,
"registryUrls": Array [ "registryUrls": Array [
"https://repo.maven.apache.org/maven2",
"http://example.com/", "http://example.com/",
"http://example.com/nexus/xyz", "http://example.com/nexus/xyz",
], ],
...@@ -346,7 +319,6 @@ Array [ ...@@ -346,7 +319,6 @@ Array [
"depType": "compile", "depType": "compile",
"fileReplacePosition": 2714, "fileReplacePosition": 2714,
"registryUrls": Array [ "registryUrls": Array [
"https://repo.maven.apache.org/maven2",
"http://example.com/", "http://example.com/",
"http://example.com/nexus/xyz", "http://example.com/nexus/xyz",
], ],
...@@ -358,7 +330,6 @@ Array [ ...@@ -358,7 +330,6 @@ Array [
"depType": "compile", "depType": "compile",
"fileReplacePosition": 2872, "fileReplacePosition": 2872,
"registryUrls": Array [ "registryUrls": Array [
"https://repo.maven.apache.org/maven2",
"http://example.com/", "http://example.com/",
"http://example.com/nexus/xyz", "http://example.com/nexus/xyz",
], ],
...@@ -370,7 +341,6 @@ Array [ ...@@ -370,7 +341,6 @@ Array [
"depType": "compile", "depType": "compile",
"fileReplacePosition": 3134, "fileReplacePosition": 3134,
"registryUrls": Array [ "registryUrls": Array [
"https://repo.maven.apache.org/maven2",
"http://example.com/", "http://example.com/",
"http://example.com/nexus/xyz", "http://example.com/nexus/xyz",
], ],
...@@ -383,7 +353,6 @@ Array [ ...@@ -383,7 +353,6 @@ Array [
"depType": "build", "depType": "build",
"fileReplacePosition": 3410, "fileReplacePosition": 3410,
"registryUrls": Array [ "registryUrls": Array [
"https://repo.maven.apache.org/maven2",
"http://example.com/", "http://example.com/",
"http://example.com/nexus/xyz", "http://example.com/nexus/xyz",
], ],
......
...@@ -3,6 +3,7 @@ import { extractPackage, extractRegistries } from './extract'; ...@@ -3,6 +3,7 @@ import { extractPackage, extractRegistries } from './extract';
const minimumContent = Fixtures.get(`minimum.pom.xml`); const minimumContent = Fixtures.get(`minimum.pom.xml`);
const simpleContent = Fixtures.get(`simple.pom.xml`); const simpleContent = Fixtures.get(`simple.pom.xml`);
const simpleCentralContent = Fixtures.get(`simple.central.pom.xml`);
const mirrorSettingsContent = Fixtures.get(`mirror.settings.xml`); const mirrorSettingsContent = Fixtures.get(`mirror.settings.xml`);
const profileSettingsContent = Fixtures.get(`profile.settings.xml`); const profileSettingsContent = Fixtures.get(`profile.settings.xml`);
...@@ -123,6 +124,32 @@ describe('manager/maven/extract', () => { ...@@ -123,6 +124,32 @@ describe('manager/maven/extract', () => {
packageFile: null, packageFile: null,
}); });
}); });
it('extract dependencies from any XML position with Central Maven', () => {
const res = extractPackage(simpleCentralContent);
expect(res).toMatchSnapshot({
deps: [
{
depName: 'org.example:foo',
currentValue: '0.0.1',
depType: 'compile',
registryUrls: [],
},
{
depName: 'org.example:quuz',
currentValue: '1.2.3',
depType: 'test',
registryUrls: [],
},
{
depName: 'org.example:profile-build-artefact',
currentValue: '2.17',
depType: 'build',
registryUrls: [],
},
],
packageFile: null,
});
});
it('tries minimum manifests', () => { it('tries minimum manifests', () => {
const res = extractPackage(minimumContent); const res = extractPackage(minimumContent);
expect(res).toEqual({ expect(res).toEqual({
......
...@@ -2,7 +2,6 @@ import is from '@sindresorhus/is'; ...@@ -2,7 +2,6 @@ import is from '@sindresorhus/is';
import upath from 'upath'; import upath from 'upath';
import { XmlDocument, XmlElement } from 'xmldoc'; import { XmlDocument, XmlElement } from 'xmldoc';
import * as datasourceMaven from '../../datasource/maven'; import * as datasourceMaven from '../../datasource/maven';
import { MAVEN_REPO } from '../../datasource/maven/common';
import { logger } from '../../logger'; import { logger } from '../../logger';
import { readLocalFile } from '../../util/fs'; import { readLocalFile } from '../../util/fs';
import { regEx } from '../../util/regex'; import { regEx } from '../../util/regex';
...@@ -57,7 +56,7 @@ function depFromNode( ...@@ -57,7 +56,7 @@ function depFromNode(
const versionNode = node.descendantWithPath('version'); const versionNode = node.descendantWithPath('version');
const fileReplacePosition = versionNode.position; const fileReplacePosition = versionNode.position;
const datasource = datasourceMaven.id; const datasource = datasourceMaven.id;
const registryUrls = [MAVEN_REPO]; const registryUrls = [];
const result: PackageDependency = { const result: PackageDependency = {
datasource, datasource,
depName, depName,
......
...@@ -38,7 +38,6 @@ describe('manager/maven/index', () => { ...@@ -38,7 +38,6 @@ describe('manager/maven/index', () => {
'simple.pom.xml', 'simple.pom.xml',
]); ]);
const urls = [ const urls = [
'https://repo.maven.apache.org/maven2',
'https://maven.atlassian.com/content/repositories/atlassian-public/', 'https://maven.atlassian.com/content/repositories/atlassian-public/',
'https://artifactory.company.com/artifactory/my-maven-repo', 'https://artifactory.company.com/artifactory/my-maven-repo',
]; ];
...@@ -180,7 +179,6 @@ describe('manager/maven/index', () => { ...@@ -180,7 +179,6 @@ describe('manager/maven/index', () => {
'child.pom.xml', 'child.pom.xml',
]); ]);
const urls = new Set([ const urls = new Set([
'https://repo.maven.apache.org/maven2',
'http://example.com/', 'http://example.com/',
'http://example.com/nexus/xyz', 'http://example.com/nexus/xyz',
]); ]);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment