Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove default maven central registry #13950

Merged
merged 8 commits into from
Feb 5, 2022
Merged
67 changes: 67 additions & 0 deletions lib/manager/maven/__fixtures__/simple.central.pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@



<?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>
51 changes: 34 additions & 17 deletions lib/manager/maven/__snapshots__/extract.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ Object {
"depType": "parent",
"fileReplacePosition": 186,
"registryUrls": Array [
"https://repo.maven.apache.org/maven2",
"https://maven.atlassian.com/content/repositories/atlassian-public/",
],
},
Expand All @@ -22,7 +21,6 @@ Object {
"depType": "compile",
"fileReplacePosition": 905,
"registryUrls": Array [
"https://repo.maven.apache.org/maven2",
"https://maven.atlassian.com/content/repositories/atlassian-public/",
],
},
Expand All @@ -33,7 +31,6 @@ Object {
"depType": "compile",
"fileReplacePosition": 1093,
"registryUrls": Array [
"https://repo.maven.apache.org/maven2",
"https://maven.atlassian.com/content/repositories/atlassian-public/",
],
},
Expand All @@ -44,7 +41,6 @@ Object {
"depType": "build",
"fileReplacePosition": 1347,
"registryUrls": Array [
"https://repo.maven.apache.org/maven2",
"https://maven.atlassian.com/content/repositories/atlassian-public/",
],
},
Expand All @@ -55,7 +51,6 @@ Object {
"depType": "build",
"fileReplacePosition": 1545,
"registryUrls": Array [
"https://repo.maven.apache.org/maven2",
"https://maven.atlassian.com/content/repositories/atlassian-public/",
],
},
Expand All @@ -66,7 +61,6 @@ Object {
"depType": "build",
"fileReplacePosition": 2276,
"registryUrls": Array [
"https://repo.maven.apache.org/maven2",
"https://maven.atlassian.com/content/repositories/atlassian-public/",
],
},
Expand All @@ -77,7 +71,6 @@ Object {
"depType": "compile",
"fileReplacePosition": 2484,
"registryUrls": Array [
"https://repo.maven.apache.org/maven2",
"https://maven.atlassian.com/content/repositories/atlassian-public/",
],
},
Expand All @@ -88,7 +81,6 @@ Object {
"depType": "compile",
"fileReplacePosition": 2634,
"registryUrls": Array [
"https://repo.maven.apache.org/maven2",
"https://maven.atlassian.com/content/repositories/atlassian-public/",
],
},
Expand All @@ -99,7 +91,6 @@ Object {
"depType": "compile",
"fileReplacePosition": 2779,
"registryUrls": Array [
"https://repo.maven.apache.org/maven2",
"https://maven.atlassian.com/content/repositories/atlassian-public/",
],
},
Expand All @@ -110,7 +101,6 @@ Object {
"depType": "compile",
"fileReplacePosition": 2938,
"registryUrls": Array [
"https://repo.maven.apache.org/maven2",
"https://maven.atlassian.com/content/repositories/atlassian-public/",
],
},
Expand All @@ -121,7 +111,6 @@ Object {
"depType": "test",
"fileReplacePosition": 3086,
"registryUrls": Array [
"https://repo.maven.apache.org/maven2",
"https://maven.atlassian.com/content/repositories/atlassian-public/",
],
},
Expand All @@ -132,7 +121,6 @@ Object {
"depType": "compile",
"fileReplacePosition": 3252,
"registryUrls": Array [
"https://repo.maven.apache.org/maven2",
"https://maven.atlassian.com/content/repositories/atlassian-public/",
],
},
Expand All @@ -143,7 +131,6 @@ Object {
"depType": "compile",
"fileReplacePosition": 3410,
"registryUrls": Array [
"https://repo.maven.apache.org/maven2",
"https://maven.atlassian.com/content/repositories/atlassian-public/",
],
},
Expand All @@ -153,7 +140,6 @@ Object {
"depName": "org.example:relocation-artifact",
"fileReplacePosition": 3612,
"registryUrls": Array [
"https://repo.maven.apache.org/maven2",
"https://maven.atlassian.com/content/repositories/atlassian-public/",
],
},
Expand All @@ -164,7 +150,6 @@ Object {
"depType": "compile",
"fileReplacePosition": 3944,
"registryUrls": Array [
"https://repo.maven.apache.org/maven2",
"https://maven.atlassian.com/content/repositories/atlassian-public/",
],
},
Expand All @@ -175,7 +160,6 @@ Object {
"depType": "build",
"fileReplacePosition": 4200,
"registryUrls": Array [
"https://repo.maven.apache.org/maven2",
"https://maven.atlassian.com/content/repositories/atlassian-public/",
],
},
Expand All @@ -186,7 +170,6 @@ Object {
"depType": "build",
"fileReplacePosition": 4594,
"registryUrls": Array [
"https://repo.maven.apache.org/maven2",
"https://maven.atlassian.com/content/repositories/atlassian-public/",
],
},
Expand All @@ -211,3 +194,37 @@ Object {
"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,
}
`;