-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Detect and follow Maven group and artifact moves #5667
Comments
Is essentially the same concept as #5535 ? |
Similar concept, this would not be a manual rename, but could be automatically extracted from maven central. |
ran into this on uPortal-Project/SimpleContentPortlet#152 |
OK, we would need to get that info out of the API somehow though. |
It looks like this can be detected through the relocation metadata https://maven.apache.org/guides/mini/guide-relocation.html |
OK, waiting on #2223 |
There is a maven plugin, oga-maven-plugin, to detect these artifact moves. It works with a curated JSON file: https://github.com/jonathanlermitage/oga-maven-plugin/blob/master/uc/og-definitions.json |
Yesterday (almost) all of my projects got the same update from renovate that broke the CI build.
all of them failed with
The rootcause was that this plugin got moved to a different package. https://maven.apache.org/guides/mini/guide-relocation.html They created a
The effect can for example be seen here
@rarkins since this is apparently |
Hi there, Help us by making a minimal reproduction repository. Before we can start work on your issue we first need to know exactly what's causing the current behavior. A minimal reproduction helps us with this. To get started, please read our guide on creating a minimal reproduction to understand what is needed. We may close the issue if you (or someone else) have not provided a minimal reproduction within two weeks. If you need more time, or are stuck, please ask for help or more time in a comment. Good luck, The Renovate team |
Can you create a minimal reproduction of that case? We are still blocked on a generic way to "replace" packages though |
@rarkins The full error here is
|
Thank you for providing a reproduction! 🎉 🚀 The Renovate team will take a look at the reproduction repository. |
Hello, IMHO I just wanted to make users aware that the plugin moved to new coordinates and thus published a relocation pom only. I intentionally did not publish a jar since I wanted to keep the option open to publish hotfix releases with old coordinates (I really can't be asked to change the coordinates for old releases). If this works (now confirmed) then the relocation can be one of the following publication-types:
Edit: I can confirm that after publishing the plugin to the new coordinates (git-commit-id/git-commit-id-maven-plugin#570) one can use the old artifact/group combination or new. I don't know what would happen if one published the jar to the old coordinates and the new coordinates.... Note: The relocation itself can be boiled down to the following snippet: <distributionManagement>
<relocation>
<groupId>io.github.git-commit-id</groupId>
<artifactId>git-commit-id-maven-plugin</artifactId>
</relocation>
</distributionManagement> For the full pom refer to https://repo1.maven.org/maven2/pl/project13/maven/git-commit-id-plugin/4.9.9/git-commit-id-plugin-4.9.9.pom |
Now that #5558 is merged into the trunk, I'd like to take a stab at this one. I had already worked on this this summer, but @JamieMagee was not fully done with the replacement impl back then. |
Watchers, can you guide me a bit, as I'm not too familiar with the standard development practices in this community? There are the datasource aspects of this task, and then there are the managers. The datasource was easy to get done, but now that it detects the replacement, none (but the NPM changes set up by @JamieMagee) of the managers know how to handle it. The DD will propose to create a PR, but the manager is gonna ignore the replacement name while generating the proposed new code. What's the default approach for phasing in such changes? Would it make sense to add a boolean property |
Yes, could be good to add that flag and log a warning if we find an attempted replacement for a manager which doesn't support it. |
I'm not sure we require a new flag. I was looking into this for Docker, and this is the key codepath: renovate/lib/workers/branch/get-updated.ts Lines 97 to 103 in ab01819
If a manager has a custom renovate/lib/manager/maven/update.ts Lines 27 to 42 in aa56d49
That should be the only change required for this issue. |
FWIW (not related to Maven) I'm assuming that autoReplace could be enhanced to support a replacement name in a similar way it today can support a new value/version. I would suggest we do them as two separate routines, i.e. don't try to replace both package name and version at once. |
First part to solve issue renovatebot#5667
First part to solve issue renovatebot#5667
What would you like Renovate to be able to do?
Some maven artifacts change group and artifact ids on major releases.
Many projects include a link forward to the new location, for example the "Note: This artifact was moved to" sections of:
Describe the solution you'd like
When group and artifacts have their next major version linked in maven central, allow renovate updates to upgrade to the new version at the new group/artifact location.
Describe alternatives you've considered
N/A
Additional context
NOTE: this applies to all maven based package managers, including gradle and sbt
The text was updated successfully, but these errors were encountered: