Closed josemariavillar closed 2 years ago
Hi @josemariavillar, thanks for the report, we'll take a look!
@josemariavillar Having a similar problem. Can you tell me what version of the maven plugin maps back to 7.16.0?
-DskipMavenParsing=true saved me here.
@mpatnode the version of the plugin that includes the 7.16.0 version of rewrite is 4.16.0.
Regarding the workaround you comment, unfortunately in my case, I can't use skipMavenParsing to true as it causes no recipe to be executed in the pom.xml file. What I do think would be very useful, is if you could skip the parsing of Maven transitive poms which is where most of the problems occur.
@josemariavillar > I can't use skipMavenParsing to true as it causes no recipe to be executed in the pom.xml file That wasn't my experience. It does skip editing the pom.xml file (the failure happens when parsing a new generated version) but it still edited all my Java files.
@mpatnode At least in version 4.20 the tests I have done with this parameter set to true does not run any maven rules on the pom file. @tkvangorder, could this be an issue?
@josemariavillar yes, if you skip maven parsing, there will be no ability for maven-based recipes to transform maven build files. The commit I made last night should fix this problem, I just need to get all of the tests passing so the 7.20.0-SNAPSHOT is published to the snapshot repo.
Great, @tkvangorder thank you very much for your great work! I validate it and let you know
I'm experiencing the same issue even with the latest SNAPSHOT build. I've tried it in this project: https://github.com/smallrye/smallrye-reactive-messaging, but some dependencies are causing issues.
One issue is with an inactive profile dependency provided by Weld, which fails with a No version provided for dependency javax.xml.ws:jaxws-api
:
https://github.com/weld/core/blob/3.1.9.Final/impl/pom.xml#L167-L178
Another one is No version provided for dependency io.netty:netty-transport-native-epoll
, which seems to be caused by this:
https://github.com/apache/activemq-artemis/blob/2.19.0/artemis-server/pom.xml#L129-L138
@radcortez , In talking with @josemariavillar , he noted that I had not bumped the maven plugin to the latest snapshot of rewrite. I just applied this change this morning, can you try using the new snapshot version and see if that makes a difference?
https://github.com/openrewrite/rewrite-maven-plugin/commit/5993bb35f324cbb111b10309fc7dba69bf7f8c1f
Thanks
Thanks for the quick response.
Yes, I've noticed that. I did the build locally and updated it myself.
BTW to clarify, I did try before with a local build and with the SNAPSHOT manually update. Anyway, just to make sure I did try again today and the issue persists. Thanks!
Thanks @radcortez , I will take a look today.
@radcortez I have an update on the first issue you are having with the jaxws-api
dependency in the profile.
If I clone the weld repo, check out the tag 3.1.9.Final
and then attempt to run maven with that profile active, maven will also report this as an error.
mvn validate -Pjavax.xml.ws
[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] 'dependencies.dependency.version' for javax.xml.ws:jaxws-api:jar is missing. @ line 173, column 29
I also understand that this is completely out of your control since this happens in a transitively included pom. We take the approach of failing fast when we encounter an invalid maven build file, but maybe we need to relax this constraint and instead log a warning. I will get back to you shortly
@radcortez I have found and fixed the issue with the netty dependencies with #1454
Thank you for the detailed error descriptions, they really help.
I also understand that this is completely out of your control since this happens in a transitively included pom. We take the approach of failing fast when we encounter an invalid maven build file, but maybe we need to relax this constraint and instead log a warning. I will get back to you shortly
Thanks. Maybe an option could be to ignore inactive profiles?
@radcortez I have found and fixed the issue with the netty dependencies with #1454
Great. Thanks. I'll workaround the Weld issue and check if there is any other problem with the rest of the dependencies.
@radcortez I have fixed the issue you were seeing with weld. Please see #1462
Thanks. I'll give it a try!
Seems to work, thank you :)
Good morning,
With version 7.19.0 there is an error when parsing the original maven file because the parent POM contains an unversioned dependencyManagement.
This problem was solved in version 7.16.0 (https://github.com/openrewrite/rewrite/issues/1084) , but since version 7.18.2 (https://github.com/openrewrite/rewrite/issues/1406) it is happening again.
Attached is an example test, where the problem is reproduced.
Child project: https://github.com/josemariavillar/test_project/tree/no-version-provided Parent project: https://github.com/josemariavillar/test-project-parent/tree/no-version-provided