-
Notifications
You must be signed in to change notification settings - Fork 330
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
rewrite:run (warns about) failing to download SNAPSHOT parent from local repository #4508
rewrite:run (warns about) failing to download SNAPSHOT parent from local repository #4508
Comments
I decided to try debugging it. Despite the log messages coming from rewrite-maven-plugin, I think the issue comes from rewrite-maven: String uri = repo.getUri() + (repo.getUri().endsWith("/") ? "" : "/") +
requireNonNull(gav.getGroupId()).replace('.', '/') + '/' +
gav.getArtifactId() + '/' +
(gav.getVersion() == null ? "" : gav.getVersion() + '/') +
"maven-metadata.xml"; Indeed, in local, the metadata files are called I don’t know if this ticket should be moved to rewrite then? Or should I recreate it myself maybe? |
Hi! Thanks for logging your findings & the patience before a reply. We've pushed a change in 5.40.2 that might change the behavior that you're seeing here:
Although in this case it seems a child module is still looking for the parent in |
This will also happen when using non-snapshot versions not available on configured maven repositories. I think I found a possible solution for this while writing the unit test for There, I'm adding the snapshot versions manually to the maven pom cache. If this is a viable solution, I can submit a PR. Any thoughts, @timtebeek? |
The issue here was about a warning emitted when depending on snapshot, which turned out to be because it was trying to retrieve the Maven Metadata with the wrong file name. I think that issue is solved now but I didn’t recheck. @timtebeek indeed noticed a strange behavior, to which I forgot to reply:
In this particular case, it was two separate folders and the parent was not actually located there when I tried this. I should have put |
What version of OpenRewrite are you using?
I am using
How are you running OpenRewrite?
I am using the Maven plugin, and my project is a single module project with a parent in SHAPSHOT version.
What is the smallest, simplest way to reproduce the problem?
Parent pom
Just install it in your local repository with
mvn install
.Child pom
I’m running
rewrite:run
on the child pom.What did you expect to see?
No warning from the maven plugin.
What did you see instead?
Multiple warnings about failing to download the parent from the local repository. I’m not sure about the impact – parent gets ignored in recipes?
What is the full stack trace of any errors you encountered?
With debug output:
Note the
Downloaded com.example:parent-pom:1.0-SNAPSHOT from com.example:child-pom:1.0-SNAPSHOT
– so it failed successfully?Also note that there is no warning when parent is not
-SNAPSHOT
.The text was updated successfully, but these errors were encountered: