parent pom with version ranges causes trouble with apps if I create a patch version of a library project #1640
Unanswered
davidmichaelkarr
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I spent a lot of time trying to word the title, but there's no way I can accurately describe the situation in a single line.
Using Eclipse 2023-12.
I support a bunch of Maven projects that all use a common parent pom, with a bom that specifies version ranges for internal libraries (not for external ones). I make sure that ALL projects have "Workspace Resolution" DISABLED, because I sometimes want to work on patch versions of libraries without having all the projects that use the latest released version of that library automatically getting the patch version (I wish I could make that the default).
Today I had to deal with a problem with m2e that I often run into. I thought I would describe the problem, and what I had to do to resolve it.
In one of my git repos, I created a branch to work on a patch version of one library, just so I could verify it works in one project, and then I removed it from my local maven repo, because I didn't want all the other projects to get it. I did still leave the feature branch checked out in that one library, so that one library project had a pom.xml with a patch version for that artifact, but that patch version did not exist in my local maven repo.
However, now many projects are now complaining about "missing artifacts", specifying the patch version of that library. Those projects are using the BOM with the version range, so they're not specifying that version directly. I've tried doing a Maven Update on those projects. I've tried doing a Clean on those projects. None of those steps make any difference.
What I finally did was go back to the repository for the library, which was checked out to the feature branch for the patch version, and I went back to the master branch and did a Maven Update on that project. I then did a Maven Update on the project that was complaining about the missing artifact. That resolved the problem.
Remember that I have set "Workspace Resolution" OFF for all projects. The behavior that I'm seeing sure looks like it's trying to resolve that dependency reference to the project in the workspace for that library, which I believe is what having "Workspace Resolution" ON would do.
Beta Was this translation helpful? Give feedback.
All reactions