-
Notifications
You must be signed in to change notification settings - Fork 22
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
[MPOM-451] Move snapshot repositories in a profile #183
Conversation
How do these interfere with downstream builds? Shouldn't they only impact SNAPSHOT builds which, since they are for non-released code, should not have any impact on downstream? |
For example, in Apache Shiro, they download SNAPSHOT versions from the repository during CI builds instead of using the local CI-build artifacts. |
This sounds like an issue with your reactor then. Maven only tries to download dependencies which are not part of the current multimodule build. |
Not sure what it could possibly be. It took me 3+ hours of debugging to figure out why the builds weren't working correctly when I finally found that this was the issue. Not sure I have it in me to spend more hours figuring this out. However, it's pretty clear that the repository section in POMs are frowned upon. |
IMHO adding the ASF snapshot repo shouldn't do any harm for projects not leveraging it. So let us rather track the downstream issues separately. |
There is also a matter of pragmatism here. The repository entries really shouldn't be there in the first place. No matter what the downstream issues are, those should be removed anyway IMHO |
Please give some reasons, except for unclear downstream issues. This is very helpful for most ASF projects is my argument for keeping it in that place! |
Just did a quick google search "why repository in pom bad" and found this: |
Also see this Slack discussion: https://the-asf.slack.com/archives/C7Q9JB404/p1703540867035689 |
Maybe configure dependabot
|
Will try that. Thank you! Even if that works I still think the repository entries should be removed. |
@kwin See apache/shiro#1245 for an example However, that breaks dependabot (maybe I introduce @olamy 's fix!) but still, a lot of work just due to the repository entry in parent pom. Better to remove it :) |
If these are removed, this is probably going to create a huge headache for all downstream users of this, who use the ASF parent POM to build |
Why? It's not difficult to put those lines into |
It's not a difficultly issue... it's a scale problem. A lot of projects rely on this being already set up in the parent POM. |
Understandable, but since these upgrades don't happen automatically and "fail fast", I don't see this as a big issue. |
I don't see this as "fail fast"... bumping the parent version is trivial, but the requirement that every user on a project set up a repository in their local workspace or in each project and in any automated builder environment, like Jenkins, can happen later, when a non-reactor snapshot is added (typically done while testing a bugfix in a dependency prior to that dependency's release, or when co-releasing projects at the same time). After reading all the arguments listed in favor of this, I think it boils down to:
I'm just not convinced by the arguments in favor of doing this, and worry about the impact. It's been this way for so long, without any problems whatsoever. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As commented before I think this causes too much friction for ASF parent consumer who want to upgrade and leverage those repositories. Let us rather rely on dependabot coming up with a proper fix.
I still don't see this friction. Let's look at the actual use case where this is used. Am I missing something glaring here? Thanks! |
Every multi repo ASF project with inter repo dependencies needs that from time to time. |
Is this really a lot of impact? Also, doesn't Apache Jenkins have this built-in as well? |
I also want to reiterate that multi-module projects would not be affected at all. Only multi-repository ones that are built separately and are not using Apache Jenkins |
Local builds are affected, GitHub actions are affected (everything which does not use a centrally managed |
Not sure how. Usually local builds are either multi-module or 'installed' and do not use snapshot repository anyway. GH actions don't use snapshot repository either. Do you have an example project in mind that you think would be affected? How many do you think? I'd be happy to help fix any issues that would arise. |
This isn't always true. For example, Apache Accumulo is configured in ci-build Jenkins to publish daily snapshots from the main Similarly, if/when a snapshot build of a maven plugin is published, downstream projects can test to see if a specific bug in a plugin was fixed correctly. The same can happen with Apache commons libraries (I think I remember testing a bugfix for commons-vfs2 this way a long time ago). So, snapshots are very useful for sharing build snapshots between projects. They can also be useful across multiple repos in a single project. For example, Accumulo also uses our snapshot builds to test our examples repository, and to run some more complicated test suites that are stored in a separate testing repo. In short, there's a lot of use cases for these published snapshots, and developers do not limit themselves to just doing local installs for testing/development. Yes, all of these developers could adapt and start manually configuring all their repositories. But that is friction for them, even if it's not for everybody.
Yes, absolutely they do. This is precisely how accumulo-testing repo is configured to test accumulo snapshots: See https://github.com/apache/accumulo-testing/blob/main/pom.xml#L35 and https://github.com/apache/accumulo-testing/actions
It's not a complexity problem. It's a scale problem. I think most people could adapt pretty easily, without any help. It's also just a matter of convenience on a large scale (I don't know how large). Most people don't seem to be hitting the problems with dependabot that you seem to, and are content with the convenience of having it there. It's not causing a problem for everybody, and not everybody considers it worth changing, because it's more convenient the way it is. Personally, on a scale of |
@lprimak fwiw, I think interactions between the local build and the local repository and remote repositories is not new. Maven 4 tries to solve the problem with the introduction of a project local repository in |
Since Maven 4 is about to be released and break everything anyway, it's time to merge this as well |
What about moving the snapshot repository in a profile activated using a known property ? Projects depending on the repo could easily activate the profile by defining the needed property, while those that are not interested in the snapshot repo simply not define the property. |
That’s a fantastic idea. I’ll make it happen. |
9ea943a
to
ef7b6ef
Compare
Done |
I updated the description to better explain issues with the status quo |
@lprimak - documentation should be also updated - https://github.com/apache/maven-apache-parent/blob/master/docs/src/site/apt/index.apt.vm#L50 |
@slawekjaranowski This is probably more of a bugfix than enhancement but it's close :) |
ef7b6ef
to
3a4ff73
Compare
@slawekjaranowski done |
@lprimak we should also add information in |
3a4ff73
to
f0057ee
Compare
@slawekjaranowski Done |
@kwin It doesn't look like dependabot is going to fix anything anytime soon, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thank you everyone! |
Snapshot repositories interfere with downstream builds
Besides dependabot issues, this also causes issues with old
artifacts being brought in by https://github.com/shrinkwrap/resolver with Maven 3
Maven 4, however, works around that issue.
Both of those issues are very difficult to debug, so removing the SNAPSHOT repository
by default prevents 10s of hours of debugging and troubleshooting
Fixes dependabot/dependabot-core#8329