renovate icon indicating copy to clipboard operation
renovate copied to clipboard

maven: support `extensions.xml`

Open rarkins opened this issue 9 months ago • 3 comments

Discussed in https://github.com/renovatebot/renovate/discussions/24316

Originally posted by jonesbusy September 8, 2023

How are you running Renovate?

Self-hosted

If you're self-hosting Renovate, tell us what version of Renovate you run.

36.82.0

If you're self-hosting Renovate, select which platform you are using.

Bitbucket Server

Was this something which used to work for you, and then stopped?

I never saw this working

Wanted end result.

Hi,

"Recent" version of maven allow the use of '.mvn/extensions.xml' with following format

<extensions xmlns="http://maven.apache.org/EXTENSIONS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/EXTENSIONS/1.0.0 http://maven.apache.org/xsd/core-extensions-1.0.0.xsd">
  <extension>
    <groupId>....</groupId>
    <artifactId>...</artifactId>
    <version>1.0.0</version>
  </extension>
</extensions>

The maven manager is supposed to renovate maven extension like any other plugin/dependency ?

Dependabot works well for extensions.xml but it seems it doesn't work out of the box by Renovate

I didn't find anything on the doc about this.

Should be supported by 'maven' manager ? Or should a 'maven-extensions' manager be implemented ?

Thanks for the help!

What you tried so far.

I can try to use regexManager with 'git-tags' but it's not very convenient

Also tried to use

  "maven": {
    "fileMatch": [
      "(^|/|\\.)pom\\.xml$",
      "(^|/|\\.)\\.mvn/extensions\\.xml$"
    ]
  },

But I don't see any check on my extensions even if

DEBUG: Matched 4 file(s) for manager maven: .mvn/extensions.xml, it/pom.xml, library/pom.xml, pom.xml (repository=local)

Relevant debug logs

No response

rarkins avatar May 05 '24 06:05 rarkins

  1. Add .mvn/extensions.xml as a default pattern to the maven manager
  2. Use the xmlns in the file to determine whether to use a pom parser (existing) or extensions parser (new). That way people can still use non-default filenames and each should work

rarkins avatar May 05 '24 06:05 rarkins

Reproduction repo: https://github.com/renovate-reproductions/24316

rarkins avatar May 05 '24 06:05 rarkins

  1. Use the xmlns in the file to determine whether to use a pom parser (existing) or extensions parser (new). That way people can still use non-default filenames and each should work

Just a small note but afaik there is no variety in filenames used for extension declarations. By design, the only repo-specific path where core extensions can be specified is .mvn/extensions.xml (also see here and here). Filename-based parsing (analogous to what is done for settings.xml) should be slightly simpler to implement.

Churro avatar May 05 '24 19:05 Churro

This is a duplicate of https://github.com/renovatebot/renovate/issues/24328

jonesbusy avatar May 07 '24 04:05 jonesbusy

Duplicate of #24328

viceice avatar May 07 '24 06:05 viceice