Open DidierLoiseau opened 1 week ago
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 maven-metadata-<repo-id>.xml
– so maven-metadata-local.xml
for the local repository itself. See Maven Repository Metadata Model.
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 ~/.m2/repository
as opposed to looking up the <relativePath>../</relativePath>
? Indeed seems odd that you're seeing warnings on that. Appreciate you calling it out and doing some initial debugging, and the helpful link to the meta data model. Indeed would lean towards an issue with openrewrite/rewrite then. I'll move the issue accordingly.
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
.