From 2024cf78375a1c23f4b42d356e4c58ba33a3127c Mon Sep 17 00:00:00 2001 From: Chumper Date: Tue, 1 Feb 2022 21:10:41 +0100 Subject: [PATCH 1/2] fix: remove default maven central registry --- .../maven/__fixtures__/simple.central.pom.xml | 190 ++++++++++++++++++ .../maven/__snapshots__/extract.spec.ts.snap | 178 ++++++++++++++-- lib/manager/maven/extract.spec.ts | 107 ++++++++++ lib/manager/maven/extract.ts | 3 +- 4 files changed, 459 insertions(+), 19 deletions(-) create mode 100644 lib/manager/maven/__fixtures__/simple.central.pom.xml diff --git a/lib/manager/maven/__fixtures__/simple.central.pom.xml b/lib/manager/maven/__fixtures__/simple.central.pom.xml new file mode 100644 index 00000000000000..86537a5edf21d6 --- /dev/null +++ b/lib/manager/maven/__fixtures__/simple.central.pom.xml @@ -0,0 +1,190 @@ + + + + + + + org.example + parent + 42 + + + 4.0.0 + org.example + ExamplePomFile + + Example + 0.0.1 + Minimal example + http://example.org/index.html + + + http://example.org/src.git + + + + http://example.org/ + + + + org.example + quux + + 1.2.3.4 + + + + + + + org.example + foo + 0.0.1 + + + + org.example + + + bar + + + 1.0.0 + + + + + + + SamplePomfile + + + maven-release-plugin + 2.4.2 + + + org.apache.maven.scm + maven-scm-provider-gitexe + 1.8.1 + + + + + maven-compiler-plugin + + 1.8 + 1.8 + + + + org.jasig.maven + maven-notice-plugin + + NOTICE.template + false + + + + + + org.example + extension-artefact + 1.0 + + + + + + + + org.example + ${artifact-id-placeholder} + 0.0.1 + + + ${group-id-placeholder} + baz + 0.0.1 + + + ${quuxGroup} + ${quuxId} + ${quuxVersion} + + + ${quuxGroup} + ${quuxId}-test + ${quuxVersion} + + + org.example + quuz + 1.2.3 + test + + + org.example + quuuz + it's not a version + + + org.example + hard-range + [1.0.0] + + + + + + org.example + relocation-artifact + 1.0 + We have moved the Project under Apache + + + + + + profile-id + + + org.example + profile-artifact + ${profile-placeholder} + + + + + + org.example + profile-build-artefact + 2.17 + + google_checks.xml + + + + + + + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + 2.17 + + google_checks.xml + + + + + + + + nonsense + The item without url + + + diff --git a/lib/manager/maven/__snapshots__/extract.spec.ts.snap b/lib/manager/maven/__snapshots__/extract.spec.ts.snap index 39f508a8fd53d6..4eb1a5c0221151 100644 --- a/lib/manager/maven/__snapshots__/extract.spec.ts.snap +++ b/lib/manager/maven/__snapshots__/extract.spec.ts.snap @@ -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/", ], }, @@ -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/", ], }, @@ -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/", ], }, @@ -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/", ], }, @@ -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/", ], }, @@ -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/", ], }, @@ -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/", ], }, @@ -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/", ], }, @@ -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/", ], }, @@ -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/", ], }, @@ -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/", ], }, @@ -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/", ], }, @@ -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/", ], }, @@ -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/", ], }, @@ -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/", ], }, @@ -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/", ], }, @@ -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/", ], }, @@ -211,3 +194,164 @@ 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": "42", + "datasource": "maven", + "depName": "org.example:parent", + "depType": "parent", + "fileReplacePosition": 186, + "registryUrls": Array [], + }, + Object { + "currentValue": "0.0.1", + "datasource": "maven", + "depName": "org.example:foo", + "depType": "compile", + "fileReplacePosition": 905, + "registryUrls": Array [], + }, + Object { + "currentValue": "1.0.0", + "datasource": "maven", + "depName": "org.example:bar", + "depType": "compile", + "fileReplacePosition": 1093, + "registryUrls": Array [], + }, + Object { + "currentValue": "2.4.2", + "datasource": "maven", + "depName": "org.apache.maven.plugins:maven-release-plugin", + "depType": "build", + "fileReplacePosition": 1347, + "registryUrls": Array [], + }, + Object { + "currentValue": "1.8.1", + "datasource": "maven", + "depName": "org.apache.maven.scm:maven-scm-provider-gitexe", + "depType": "build", + "fileReplacePosition": 1545, + "registryUrls": Array [], + }, + Object { + "currentValue": "1.0", + "datasource": "maven", + "depName": "org.example:extension-artefact", + "depType": "build", + "fileReplacePosition": 2276, + "registryUrls": Array [], + }, + Object { + "currentValue": "0.0.1", + "datasource": "maven", + "depName": "org.example:\${artifact-id-placeholder}", + "depType": "compile", + "fileReplacePosition": 2484, + "registryUrls": Array [], + }, + Object { + "currentValue": "0.0.1", + "datasource": "maven", + "depName": "\${group-id-placeholder}:baz", + "depType": "compile", + "fileReplacePosition": 2634, + "registryUrls": Array [], + }, + Object { + "currentValue": "\${quuxVersion}", + "datasource": "maven", + "depName": "\${quuxGroup}:\${quuxId}", + "depType": "compile", + "fileReplacePosition": 2779, + "registryUrls": Array [], + }, + Object { + "currentValue": "\${quuxVersion}", + "datasource": "maven", + "depName": "\${quuxGroup}:\${quuxId}-test", + "depType": "compile", + "fileReplacePosition": 2938, + "registryUrls": Array [], + }, + Object { + "currentValue": "1.2.3", + "datasource": "maven", + "depName": "org.example:quuz", + "depType": "test", + "fileReplacePosition": 3086, + "registryUrls": Array [], + }, + Object { + "currentValue": "it's not a version", + "datasource": "maven", + "depName": "org.example:quuuz", + "depType": "compile", + "fileReplacePosition": 3252, + "registryUrls": Array [], + }, + Object { + "currentValue": "[1.0.0]", + "datasource": "maven", + "depName": "org.example:hard-range", + "depType": "compile", + "fileReplacePosition": 3410, + "registryUrls": Array [], + }, + Object { + "currentValue": "1.0", + "datasource": "maven", + "depName": "org.example:relocation-artifact", + "fileReplacePosition": 3612, + "registryUrls": Array [], + }, + Object { + "currentValue": "\${profile-placeholder}", + "datasource": "maven", + "depName": "org.example:profile-artifact", + "depType": "compile", + "fileReplacePosition": 3944, + "registryUrls": Array [], + }, + Object { + "currentValue": "2.17", + "datasource": "maven", + "depName": "org.example:profile-build-artefact", + "depType": "build", + "fileReplacePosition": 4200, + "registryUrls": Array [], + }, + Object { + "currentValue": "2.17", + "datasource": "maven", + "depName": "org.apache.maven.plugins:maven-checkstyle-plugin", + "depType": "build", + "fileReplacePosition": 4594, + "registryUrls": Array [], + }, + ], + "mavenProps": Object { + "quuxGroup": Object { + "fileReplacePosition": 631, + "packageFile": null, + "val": "org.example", + }, + "quuxId": Object { + "fileReplacePosition": 667, + "packageFile": null, + "val": "quux", + }, + "quuxVersion": Object { + "fileReplacePosition": 698, + "packageFile": null, + "val": "1.2.3.4", + }, + }, + "packageFile": null, +} +`; diff --git a/lib/manager/maven/extract.spec.ts b/lib/manager/maven/extract.spec.ts index 2a576580489ec6..b610cd42ffe398 100644 --- a/lib/manager/maven/extract.spec.ts +++ b/lib/manager/maven/extract.spec.ts @@ -3,6 +3,7 @@ import { extractPackage, extractRegistries } from './extract'; const minimumContent = Fixtures.get(`minimum.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 profileSettingsContent = Fixtures.get(`profile.settings.xml`); @@ -123,6 +124,112 @@ describe('manager/maven/extract', () => { packageFile: null, }); }); + it('extract dependencies from any XML position with Central Maven', () => { + const res = extractPackage(simpleCentralContent); + expect(res).toMatchSnapshot({ + deps: [ + { + depName: 'org.example:parent', + currentValue: '42', + depType: 'parent', + }, + { + depName: 'org.example:foo', + currentValue: '0.0.1', + depType: 'compile', + }, + { + depName: 'org.example:bar', + currentValue: '1.0.0', + depType: 'compile', + }, + { + depName: 'org.apache.maven.plugins:maven-release-plugin', + currentValue: '2.4.2', + depType: 'build', + }, + { + depName: 'org.apache.maven.scm:maven-scm-provider-gitexe', + currentValue: '1.8.1', + depType: 'build', + }, + { + depName: 'org.example:extension-artefact', + currentValue: '1.0', + depType: 'build', + }, + { + depName: 'org.example:${artifact-id-placeholder}', + currentValue: '0.0.1', + depType: 'compile', + }, + { + depName: '${group-id-placeholder}:baz', + currentValue: '0.0.1', + depType: 'compile', + }, + { + depName: '${quuxGroup}:${quuxId}', + currentValue: '${quuxVersion}', + depType: 'compile', + }, + { + depName: '${quuxGroup}:${quuxId}-test', + currentValue: '${quuxVersion}', + depType: 'compile', + }, + { + depName: 'org.example:quuz', + currentValue: '1.2.3', + depType: 'test', + }, + { + depName: 'org.example:quuuz', + currentValue: "it's not a version", + depType: 'compile', + }, + { + depName: 'org.example:hard-range', + currentValue: '[1.0.0]', + depType: 'compile', + }, + { + depName: 'org.example:relocation-artifact', + currentValue: '1.0', + }, + { + depName: 'org.example:profile-artifact', + currentValue: '${profile-placeholder}', + depType: 'compile', + }, + { + depName: 'org.example:profile-build-artefact', + currentValue: '2.17', + depType: 'build', + }, + { + depName: 'org.apache.maven.plugins:maven-checkstyle-plugin', + currentValue: '2.17', + depType: 'build', + }, + ], + mavenProps: { + quuxGroup: { + packageFile: null, + val: 'org.example', + }, + quuxId: { + packageFile: null, + val: 'quux', + }, + quuxVersion: { + packageFile: null, + val: '1.2.3.4', + }, + }, + packageFile: null, + }); + }); it('tries minimum manifests', () => { const res = extractPackage(minimumContent); expect(res).toEqual({ diff --git a/lib/manager/maven/extract.ts b/lib/manager/maven/extract.ts index e56d97c5bb5525..de94657b4a115a 100644 --- a/lib/manager/maven/extract.ts +++ b/lib/manager/maven/extract.ts @@ -2,7 +2,6 @@ import is from '@sindresorhus/is'; import upath from 'upath'; import { XmlDocument, XmlElement } from 'xmldoc'; import * as datasourceMaven from '../../datasource/maven'; -import { MAVEN_REPO } from '../../datasource/maven/common'; import { logger } from '../../logger'; import { readLocalFile } from '../../util/fs'; import { regEx } from '../../util/regex'; @@ -57,7 +56,7 @@ function depFromNode( const versionNode = node.descendantWithPath('version'); const fileReplacePosition = versionNode.position; const datasource = datasourceMaven.id; - const registryUrls = [MAVEN_REPO]; + const registryUrls = []; const result: PackageDependency = { datasource, depName, From 0b7647f6fdd4b7f5c112738dc5fbb4fa989501d9 Mon Sep 17 00:00:00 2001 From: Chumper Date: Tue, 1 Feb 2022 22:33:03 +0100 Subject: [PATCH 2/2] chore: simplify maven extract tests --- .../maven/__fixtures__/simple.central.pom.xml | 123 ---------------- .../maven/__snapshots__/extract.spec.ts.snap | 135 +----------------- .../maven/__snapshots__/index.spec.ts.snap | 31 ---- lib/manager/maven/extract.spec.ts | 86 +---------- lib/manager/maven/index.spec.ts | 2 - 5 files changed, 7 insertions(+), 370 deletions(-) diff --git a/lib/manager/maven/__fixtures__/simple.central.pom.xml b/lib/manager/maven/__fixtures__/simple.central.pom.xml index 86537a5edf21d6..e246df80053a2e 100644 --- a/lib/manager/maven/__fixtures__/simple.central.pom.xml +++ b/lib/manager/maven/__fixtures__/simple.central.pom.xml @@ -3,11 +3,6 @@ - - org.example - parent - 42 - 4.0.0 org.example @@ -26,14 +21,6 @@ http://example.org/ - - org.example - quux - - 1.2.3.4 - - - @@ -41,118 +28,21 @@ foo 0.0.1 - - - org.example - - - bar - - - 1.0.0 - - - - SamplePomfile - - - maven-release-plugin - 2.4.2 - - - org.apache.maven.scm - maven-scm-provider-gitexe - 1.8.1 - - - - - maven-compiler-plugin - - 1.8 - 1.8 - - - - org.jasig.maven - maven-notice-plugin - - NOTICE.template - false - - - - - - org.example - extension-artefact - 1.0 - - - - - - - org.example - ${artifact-id-placeholder} - 0.0.1 - - - ${group-id-placeholder} - baz - 0.0.1 - - - ${quuxGroup} - ${quuxId} - ${quuxVersion} - - - ${quuxGroup} - ${quuxId}-test - ${quuxVersion} - org.example quuz 1.2.3 test - - org.example - quuuz - it's not a version - - - org.example - hard-range - [1.0.0] - - - - org.example - relocation-artifact - 1.0 - We have moved the Project under Apache - - - profile-id - - - org.example - profile-artifact - ${profile-placeholder} - - @@ -168,19 +58,6 @@ - - - - org.apache.maven.plugins - maven-checkstyle-plugin - 2.17 - - google_checks.xml - - - - - nonsense diff --git a/lib/manager/maven/__snapshots__/extract.spec.ts.snap b/lib/manager/maven/__snapshots__/extract.spec.ts.snap index 4eb1a5c0221151..f81ee37875a4cc 100644 --- a/lib/manager/maven/__snapshots__/extract.spec.ts.snap +++ b/lib/manager/maven/__snapshots__/extract.spec.ts.snap @@ -199,84 +199,12 @@ exports[`manager/maven/extract extractDependencies extract dependencies from any Object { "datasource": "maven", "deps": Array [ - Object { - "currentValue": "42", - "datasource": "maven", - "depName": "org.example:parent", - "depType": "parent", - "fileReplacePosition": 186, - "registryUrls": Array [], - }, Object { "currentValue": "0.0.1", "datasource": "maven", "depName": "org.example:foo", "depType": "compile", - "fileReplacePosition": 905, - "registryUrls": Array [], - }, - Object { - "currentValue": "1.0.0", - "datasource": "maven", - "depName": "org.example:bar", - "depType": "compile", - "fileReplacePosition": 1093, - "registryUrls": Array [], - }, - Object { - "currentValue": "2.4.2", - "datasource": "maven", - "depName": "org.apache.maven.plugins:maven-release-plugin", - "depType": "build", - "fileReplacePosition": 1347, - "registryUrls": Array [], - }, - Object { - "currentValue": "1.8.1", - "datasource": "maven", - "depName": "org.apache.maven.scm:maven-scm-provider-gitexe", - "depType": "build", - "fileReplacePosition": 1545, - "registryUrls": Array [], - }, - Object { - "currentValue": "1.0", - "datasource": "maven", - "depName": "org.example:extension-artefact", - "depType": "build", - "fileReplacePosition": 2276, - "registryUrls": Array [], - }, - Object { - "currentValue": "0.0.1", - "datasource": "maven", - "depName": "org.example:\${artifact-id-placeholder}", - "depType": "compile", - "fileReplacePosition": 2484, - "registryUrls": Array [], - }, - Object { - "currentValue": "0.0.1", - "datasource": "maven", - "depName": "\${group-id-placeholder}:baz", - "depType": "compile", - "fileReplacePosition": 2634, - "registryUrls": Array [], - }, - Object { - "currentValue": "\${quuxVersion}", - "datasource": "maven", - "depName": "\${quuxGroup}:\${quuxId}", - "depType": "compile", - "fileReplacePosition": 2779, - "registryUrls": Array [], - }, - Object { - "currentValue": "\${quuxVersion}", - "datasource": "maven", - "depName": "\${quuxGroup}:\${quuxId}-test", - "depType": "compile", - "fileReplacePosition": 2938, + "fileReplacePosition": 637, "registryUrls": Array [], }, Object { @@ -284,38 +212,7 @@ Object { "datasource": "maven", "depName": "org.example:quuz", "depType": "test", - "fileReplacePosition": 3086, - "registryUrls": Array [], - }, - Object { - "currentValue": "it's not a version", - "datasource": "maven", - "depName": "org.example:quuuz", - "depType": "compile", - "fileReplacePosition": 3252, - "registryUrls": Array [], - }, - Object { - "currentValue": "[1.0.0]", - "datasource": "maven", - "depName": "org.example:hard-range", - "depType": "compile", - "fileReplacePosition": 3410, - "registryUrls": Array [], - }, - Object { - "currentValue": "1.0", - "datasource": "maven", - "depName": "org.example:relocation-artifact", - "fileReplacePosition": 3612, - "registryUrls": Array [], - }, - Object { - "currentValue": "\${profile-placeholder}", - "datasource": "maven", - "depName": "org.example:profile-artifact", - "depType": "compile", - "fileReplacePosition": 3944, + "fileReplacePosition": 842, "registryUrls": Array [], }, Object { @@ -323,35 +220,11 @@ Object { "datasource": "maven", "depName": "org.example:profile-build-artefact", "depType": "build", - "fileReplacePosition": 4200, - "registryUrls": Array [], - }, - Object { - "currentValue": "2.17", - "datasource": "maven", - "depName": "org.apache.maven.plugins:maven-checkstyle-plugin", - "depType": "build", - "fileReplacePosition": 4594, + "fileReplacePosition": 1153, "registryUrls": Array [], }, ], - "mavenProps": Object { - "quuxGroup": Object { - "fileReplacePosition": 631, - "packageFile": null, - "val": "org.example", - }, - "quuxId": Object { - "fileReplacePosition": 667, - "packageFile": null, - "val": "quux", - }, - "quuxVersion": Object { - "fileReplacePosition": 698, - "packageFile": null, - "val": "1.2.3.4", - }, - }, + "mavenProps": Object {}, "packageFile": null, } `; diff --git a/lib/manager/maven/__snapshots__/index.spec.ts.snap b/lib/manager/maven/__snapshots__/index.spec.ts.snap index 7cf2c033c29157..ea8a204b0865a5 100644 --- a/lib/manager/maven/__snapshots__/index.spec.ts.snap +++ b/lib/manager/maven/__snapshots__/index.spec.ts.snap @@ -12,7 +12,6 @@ Array [ "depType": "parent", "fileReplacePosition": 186, "registryUrls": Array [ - "https://repo.maven.apache.org/maven2", "https://maven.atlassian.com/content/repositories/atlassian-public/", ], }, @@ -23,7 +22,6 @@ Array [ "depType": "compile", "fileReplacePosition": 905, "registryUrls": Array [ - "https://repo.maven.apache.org/maven2", "https://maven.atlassian.com/content/repositories/atlassian-public/", ], }, @@ -34,7 +32,6 @@ Array [ "depType": "compile", "fileReplacePosition": 1093, "registryUrls": Array [ - "https://repo.maven.apache.org/maven2", "https://maven.atlassian.com/content/repositories/atlassian-public/", ], }, @@ -45,7 +42,6 @@ Array [ "depType": "build", "fileReplacePosition": 1347, "registryUrls": Array [ - "https://repo.maven.apache.org/maven2", "https://maven.atlassian.com/content/repositories/atlassian-public/", ], }, @@ -56,7 +52,6 @@ Array [ "depType": "build", "fileReplacePosition": 1545, "registryUrls": Array [ - "https://repo.maven.apache.org/maven2", "https://maven.atlassian.com/content/repositories/atlassian-public/", ], }, @@ -67,7 +62,6 @@ Array [ "depType": "build", "fileReplacePosition": 2276, "registryUrls": Array [ - "https://repo.maven.apache.org/maven2", "https://maven.atlassian.com/content/repositories/atlassian-public/", ], }, @@ -78,7 +72,6 @@ Array [ "depType": "compile", "fileReplacePosition": 2484, "registryUrls": Array [ - "https://repo.maven.apache.org/maven2", "https://maven.atlassian.com/content/repositories/atlassian-public/", ], "skipReason": "name-placeholder", @@ -90,7 +83,6 @@ Array [ "depType": "compile", "fileReplacePosition": 2634, "registryUrls": Array [ - "https://repo.maven.apache.org/maven2", "https://maven.atlassian.com/content/repositories/atlassian-public/", ], "skipReason": "name-placeholder", @@ -103,7 +95,6 @@ Array [ "fileReplacePosition": 698, "groupName": "quuxVersion", "registryUrls": Array [ - "https://repo.maven.apache.org/maven2", "https://maven.atlassian.com/content/repositories/atlassian-public/", ], }, @@ -115,7 +106,6 @@ Array [ "fileReplacePosition": 698, "groupName": "quuxVersion", "registryUrls": Array [ - "https://repo.maven.apache.org/maven2", "https://maven.atlassian.com/content/repositories/atlassian-public/", ], }, @@ -126,7 +116,6 @@ Array [ "depType": "test", "fileReplacePosition": 3086, "registryUrls": Array [ - "https://repo.maven.apache.org/maven2", "https://maven.atlassian.com/content/repositories/atlassian-public/", ], }, @@ -137,7 +126,6 @@ Array [ "depType": "compile", "fileReplacePosition": 3252, "registryUrls": Array [ - "https://repo.maven.apache.org/maven2", "https://maven.atlassian.com/content/repositories/atlassian-public/", ], }, @@ -148,7 +136,6 @@ Array [ "depType": "compile", "fileReplacePosition": 3410, "registryUrls": Array [ - "https://repo.maven.apache.org/maven2", "https://maven.atlassian.com/content/repositories/atlassian-public/", ], }, @@ -158,7 +145,6 @@ Array [ "depName": "org.example:relocation-artifact", "fileReplacePosition": 3612, "registryUrls": Array [ - "https://repo.maven.apache.org/maven2", "https://maven.atlassian.com/content/repositories/atlassian-public/", ], }, @@ -169,7 +155,6 @@ Array [ "depType": "compile", "fileReplacePosition": 3944, "registryUrls": Array [ - "https://repo.maven.apache.org/maven2", "https://maven.atlassian.com/content/repositories/atlassian-public/", ], "skipReason": "version-placeholder", @@ -181,7 +166,6 @@ Array [ "depType": "build", "fileReplacePosition": 4200, "registryUrls": Array [ - "https://repo.maven.apache.org/maven2", "https://maven.atlassian.com/content/repositories/atlassian-public/", ], }, @@ -192,7 +176,6 @@ Array [ "depType": "build", "fileReplacePosition": 4594, "registryUrls": Array [ - "https://repo.maven.apache.org/maven2", "https://maven.atlassian.com/content/repositories/atlassian-public/", ], }, @@ -215,7 +198,6 @@ Array [ "depType": "parent", "fileReplacePosition": 185, "registryUrls": Array [ - "https://repo.maven.apache.org/maven2", "http://example.com/nexus/xyz", "http://example.com/", ], @@ -229,7 +211,6 @@ Array [ "fileReplacePosition": 470, "groupName": "quuxVersion", "registryUrls": Array [ - "https://repo.maven.apache.org/maven2", "http://example.com/", "http://example.com/nexus/xyz", ], @@ -248,7 +229,6 @@ Array [ "depType": "parent", "fileReplacePosition": 186, "registryUrls": Array [ - "https://repo.maven.apache.org/maven2", "http://example.com/", "http://example.com/nexus/xyz", ], @@ -260,7 +240,6 @@ Array [ "depType": "compile", "fileReplacePosition": 806, "registryUrls": Array [ - "https://repo.maven.apache.org/maven2", "http://example.com/", "http://example.com/nexus/xyz", ], @@ -272,7 +251,6 @@ Array [ "depType": "compile", "fileReplacePosition": 954, "registryUrls": Array [ - "https://repo.maven.apache.org/maven2", "http://example.com/", "http://example.com/nexus/xyz", ], @@ -284,7 +262,6 @@ Array [ "depType": "build", "fileReplacePosition": 1188, "registryUrls": Array [ - "https://repo.maven.apache.org/maven2", "http://example.com/", "http://example.com/nexus/xyz", ], @@ -296,7 +273,6 @@ Array [ "depType": "build", "fileReplacePosition": 1386, "registryUrls": Array [ - "https://repo.maven.apache.org/maven2", "http://example.com/", "http://example.com/nexus/xyz", ], @@ -308,7 +284,6 @@ Array [ "depType": "compile", "fileReplacePosition": 2131, "registryUrls": Array [ - "https://repo.maven.apache.org/maven2", "http://example.com/", "http://example.com/nexus/xyz", ], @@ -321,7 +296,6 @@ Array [ "depType": "compile", "fileReplacePosition": 2281, "registryUrls": Array [ - "https://repo.maven.apache.org/maven2", "http://example.com/", "http://example.com/nexus/xyz", ], @@ -334,7 +308,6 @@ Array [ "depType": "compile", "fileReplacePosition": 2574, "registryUrls": Array [ - "https://repo.maven.apache.org/maven2", "http://example.com/", "http://example.com/nexus/xyz", ], @@ -346,7 +319,6 @@ Array [ "depType": "compile", "fileReplacePosition": 2714, "registryUrls": Array [ - "https://repo.maven.apache.org/maven2", "http://example.com/", "http://example.com/nexus/xyz", ], @@ -358,7 +330,6 @@ Array [ "depType": "compile", "fileReplacePosition": 2872, "registryUrls": Array [ - "https://repo.maven.apache.org/maven2", "http://example.com/", "http://example.com/nexus/xyz", ], @@ -370,7 +341,6 @@ Array [ "depType": "compile", "fileReplacePosition": 3134, "registryUrls": Array [ - "https://repo.maven.apache.org/maven2", "http://example.com/", "http://example.com/nexus/xyz", ], @@ -383,7 +353,6 @@ Array [ "depType": "build", "fileReplacePosition": 3410, "registryUrls": Array [ - "https://repo.maven.apache.org/maven2", "http://example.com/", "http://example.com/nexus/xyz", ], diff --git a/lib/manager/maven/extract.spec.ts b/lib/manager/maven/extract.spec.ts index b610cd42ffe398..ac5461dd75fc09 100644 --- a/lib/manager/maven/extract.spec.ts +++ b/lib/manager/maven/extract.spec.ts @@ -128,105 +128,25 @@ describe('manager/maven/extract', () => { const res = extractPackage(simpleCentralContent); expect(res).toMatchSnapshot({ deps: [ - { - depName: 'org.example:parent', - currentValue: '42', - depType: 'parent', - }, { depName: 'org.example:foo', currentValue: '0.0.1', depType: 'compile', - }, - { - depName: 'org.example:bar', - currentValue: '1.0.0', - depType: 'compile', - }, - { - depName: 'org.apache.maven.plugins:maven-release-plugin', - currentValue: '2.4.2', - depType: 'build', - }, - { - depName: 'org.apache.maven.scm:maven-scm-provider-gitexe', - currentValue: '1.8.1', - depType: 'build', - }, - { - depName: 'org.example:extension-artefact', - currentValue: '1.0', - depType: 'build', - }, - { - depName: 'org.example:${artifact-id-placeholder}', - currentValue: '0.0.1', - depType: 'compile', - }, - { - depName: '${group-id-placeholder}:baz', - currentValue: '0.0.1', - depType: 'compile', - }, - { - depName: '${quuxGroup}:${quuxId}', - currentValue: '${quuxVersion}', - depType: 'compile', - }, - { - depName: '${quuxGroup}:${quuxId}-test', - currentValue: '${quuxVersion}', - depType: 'compile', + registryUrls: [], }, { depName: 'org.example:quuz', currentValue: '1.2.3', depType: 'test', - }, - { - depName: 'org.example:quuuz', - currentValue: "it's not a version", - depType: 'compile', - }, - { - depName: 'org.example:hard-range', - currentValue: '[1.0.0]', - depType: 'compile', - }, - { - depName: 'org.example:relocation-artifact', - currentValue: '1.0', - }, - { - depName: 'org.example:profile-artifact', - currentValue: '${profile-placeholder}', - depType: 'compile', + registryUrls: [], }, { depName: 'org.example:profile-build-artefact', currentValue: '2.17', depType: 'build', - }, - { - depName: 'org.apache.maven.plugins:maven-checkstyle-plugin', - currentValue: '2.17', - depType: 'build', + registryUrls: [], }, ], - mavenProps: { - quuxGroup: { - packageFile: null, - val: 'org.example', - }, - quuxId: { - packageFile: null, - val: 'quux', - }, - quuxVersion: { - packageFile: null, - val: '1.2.3.4', - }, - }, packageFile: null, }); }); diff --git a/lib/manager/maven/index.spec.ts b/lib/manager/maven/index.spec.ts index 1cd584c6b81eb6..214a060a5bc221 100644 --- a/lib/manager/maven/index.spec.ts +++ b/lib/manager/maven/index.spec.ts @@ -38,7 +38,6 @@ describe('manager/maven/index', () => { 'simple.pom.xml', ]); const urls = [ - 'https://repo.maven.apache.org/maven2', 'https://maven.atlassian.com/content/repositories/atlassian-public/', 'https://artifactory.company.com/artifactory/my-maven-repo', ]; @@ -180,7 +179,6 @@ describe('manager/maven/index', () => { 'child.pom.xml', ]); const urls = new Set([ - 'https://repo.maven.apache.org/maven2', 'http://example.com/', 'http://example.com/nexus/xyz', ]);