Open rickie opened 10 months ago
Hmm; the key part here seems to be the
Unable to find runtime dependencies beginning with: 'httpclient5', 'httpcore5'
Which is odd, since we make that available on the classpath bundled into the jar: https://github.com/openrewrite/rewrite-spring/tree/main/src/main/resources/META-INF/rewrite/classpath
And I also see that in the latest 5.0.8 release available on Maven Central.
I've not often seen a mix of rewrite-maven-plugin in the pom.xml with additional recipeArtifactCoordinates
passed in through a command. Does it work if you either exclusively use the command, without rewrite added to the pom.xml, or with the recipe dependencies added to the pom.xml instead?
Ahh I did that because for some reason it started using a newer version than 5.4.2 of the rewrite-maven-plugin
when I was tweaking some things.
I looked into that now and with 5.5.0 it gave a different error 🤔:
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.openrewrite.maven:rewrite-maven-plugin:5.5.0:run (default-cli) on project openrewrite-httpclient-reproduction: Execution default-cli of goal org.openrewrite.maven:rewrite-maven-plugin:5.5.0:run failed: Error while visiting src/main/java/tech/picnic/openrewrite/Test.java: java.lang.IllegalStateException: Unable to construct Java17Parser.
[ERROR] org.openrewrite.java.Java17Parser$Builder.build(Java17Parser.java:96)
[ERROR] org.openrewrite.java.Java17Parser$Builder.build(Java17Parser.java:63)
[ERROR] org.openrewrite.java.internal.template.JavaTemplateParser.compileTemplate(JavaTemplateParser.java:238)
[ERROR] org.openrewrite.java.internal.template.JavaTemplateParser.parseMethodArguments(JavaTemplateParser.java:189)
[ERROR] org.openrewrite.java.internal.template.JavaTemplateJavaExtension$1.visitMethodInvocation(JavaTemplateJavaExtension.java:404)
[ERROR] org.openrewrite.java.internal.template.JavaTemplateJavaExtension$1.visitMethodInvocation(JavaTemplateJavaExtension.java:56)
[ERROR] org.openrewrite.java.tree.J$MethodInvocation.acceptJava(J.java:3723)
[ERROR] org.openrewrite.java.tree.J.accept(J.java:59)
I see that 5.5.0 is from yesterday 😄. So I just added the pom.xml definition to make sure it used 5.4.2 but we usually don't do that.
We did another batch of releases yesterday; you might want to try again with those to see if that has helped. (After your holiday; enjoy!)
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.
What is the smallest, simplest way to reproduce the problem?
I have a simple project that contains this in the
pom.xml
.And a simple Java class that contains the following:
What did you expect to see?
I expect that the build doesn't crash or throws an exception.
For most of our internal repositories at Picnic this recipe works fine, but in some cases it doesn't. Therefore I made a reproduction case to try and identify what is going wrong. Do you have an idea?
What did you see instead?
An error is shown instead.
What is the stack trace of any errors you encountered?