diff --git a/lib/manager/maven/extract.ts b/lib/manager/maven/extract.ts index 89407ca3d7e435239182b6bd79d190c833bc84f3..4484dad38a4cbe76548a08d4abfc6a69676ffb59 100644 --- a/lib/manager/maven/extract.ts +++ b/lib/manager/maven/extract.ts @@ -32,9 +32,14 @@ interface MavenProp { function depFromNode(node: XmlElement): PackageDependency | null { if (!node.valueWithPath) return null; - const groupId = node.valueWithPath('groupId'); + let groupId = node.valueWithPath('groupId'); const artifactId = node.valueWithPath('artifactId'); const currentValue = node.valueWithPath('version'); + + if (!groupId && node.name === 'plugin') { + groupId = 'org.apache.maven.plugins'; + } + if (groupId && artifactId && currentValue) { const depName = `${groupId}:${artifactId}`; const versionNode = node.descendantWithPath('version'); diff --git a/test/manager/maven/__snapshots__/extract.spec.ts.snap b/test/manager/maven/__snapshots__/extract.spec.ts.snap index 601c732451fc11802c0837f6a4d3083fc71af5e2..29929e446dd7334f3859946b497e474baa2b7ea0 100644 --- a/test/manager/maven/__snapshots__/extract.spec.ts.snap +++ b/test/manager/maven/__snapshots__/extract.spec.ts.snap @@ -34,6 +34,16 @@ Object { "https://maven.atlassian.com/content/repositories/atlassian-public/", ], }, + Object { + "currentValue": "2.4.2", + "datasource": "maven", + "depName": "org.apache.maven.plugins:maven-release-plugin", + "fileReplacePosition": 1287, + "registryUrls": Array [ + "https://repo.maven.apache.org/maven2", + "https://maven.atlassian.com/content/repositories/atlassian-public/", + ], + }, Object { "currentValue": "1.8.1", "datasource": "maven", diff --git a/test/manager/maven/__snapshots__/index.spec.ts.snap b/test/manager/maven/__snapshots__/index.spec.ts.snap index 0c5c78c660ec923a5885794635f4aeb4787efdb0..97decd360a63f40a9eb5955d621b71531c2d203c 100644 --- a/test/manager/maven/__snapshots__/index.spec.ts.snap +++ b/test/manager/maven/__snapshots__/index.spec.ts.snap @@ -35,6 +35,16 @@ Array [ "https://maven.atlassian.com/content/repositories/atlassian-public/", ], }, + Object { + "currentValue": "2.4.2", + "datasource": "maven", + "depName": "org.apache.maven.plugins:maven-release-plugin", + "fileReplacePosition": 1287, + "registryUrls": Array [ + "https://repo.maven.apache.org/maven2", + "https://maven.atlassian.com/content/repositories/atlassian-public/", + ], + }, Object { "currentValue": "1.8.1", "datasource": "maven",