Skip to content
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

Apache HttpClient5 recipes should load classpath from resources #480

Merged
merged 1 commit into from
Jan 25, 2024

Conversation

timtebeek
Copy link
Contributor

As reported via Discord on https://github.com/apache/olingo-odata4

[ERROR] Failed to execute goal org.openrewrite.maven:rewrite-maven-plugin:5.21.0:run (default-cli) on project odata-server-sample: Execution default-cli of goal org.openrewrite.maven:rewrite-maven-plugin:5.21.0:run failed: Error while visiting lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/AsyncRequestWrapperImpl.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:244)
[ERROR]   org.openrewrite.java.internal.template.JavaTemplateParser.lambda$parseBlockStatements$9(JavaTemplateParser.java:163)
[ERROR]   org.openrewrite.java.internal.template.JavaTemplateParser.lambda$cacheIfContextFree$14(JavaTemplateParser.java:274)
[ERROR]   org.openrewrite.java.internal.template.JavaTemplateParser.cache(JavaTemplateParser.java:295)
[ERROR]   org.openrewrite.java.internal.template.JavaTemplateParser.cacheIfContextFree(JavaTemplateParser.java:274)
[ERROR]   org.openrewrite.java.internal.template.JavaTemplateParser.parseBlockStatements(JavaTemplateParser.java:158)
[ERROR]   org.openrewrite.java.internal.template.JavaTemplateJavaExtension$1.maybeReplaceStatement(JavaTemplateJavaExtension.java:469)
[ERROR]   org.openrewrite.java.internal.template.JavaTemplateJavaExtension$1.visitMethodInvocation(JavaTemplateJavaExtension.java:441)
[ERROR]   org.openrewrite.java.internal.template.JavaTemplateJavaExtension$1.visitMethodInvocation(JavaTemplateJavaExtension.java:56)
[ERROR]   org.openrewrite.java.tree.J$MethodInvocation.acceptJava(J.java:3932)
[ERROR]   org.openrewrite.java.tree.J.accept(J.java:59)
[ERROR]   org.openrewrite.TreeVisitor.visit(TreeVisitor.java:278)
[ERROR]   org.openrewrite.TreeVisitor.visit(TreeVisitor.java:184)
[ERROR]   org.openrewrite.java.JavaTemplate.apply(JavaTemplate.java:67)
[ERROR]   ...
[ERROR] -> [Help 1]

@timtebeek
Copy link
Contributor Author

Locally now get through parsing those files

[INFO] Validating active recipes...
[INFO] Project [Olingo-OData] Resolving Poms...
[INFO] Project [Olingo-OData] Parsing source files
[INFO] Project [odata-lib] Parsing source files
[INFO] Project [odata-commons-api] Parsing source files
[INFO] Project [odata-commons-core] Parsing source files
[INFO] Project [odata-client-api] Parsing source files
[INFO] Project [odata-client-core] Parsing source files
[INFO] Project [odata-server-api] Parsing source files
[INFO] Project [odata-server-core] Parsing source files
[INFO] Project [odata-server-core-ext] Parsing source files
[INFO] Project [odata-server-tecsvc] Parsing source files
[INFO] Project [odata-server-test] Parsing source files
[INFO] Project [odata-ext] Parsing source files
[INFO] Project [odata-client-proxy] Parsing source files
[INFO] Project [pojogen-maven-plugin] Parsing source files
[INFO] Project [odata-client-android] Parsing source files
[INFO] Project [odata-fit] Parsing source files
[INFO] Project [odata-dist] Parsing source files
[INFO] Project [Olingo-OData-Client-for-Android] Parsing source files
[INFO] Project [Olingo-OData-Client-for-Java] Parsing source files
[INFO] Project [Olingo-OData-Server-for-Java] Parsing source files
[INFO] Project [Olingo-OData-Server-Extension-for-Java] Parsing source files
[INFO] Project [Olingo-OData-JavaDoc] Parsing source files
[INFO] Project [odata-samples] Parsing source files
[INFO] Project [odata-server-sample] Parsing source files
[INFO] Running recipe(s)...

And makes the necessary changes

[WARNING] Changes have been made to samples/client/src/main/java/org/apache/olingo/samples/client/core/http/SocketFactoryHttpClientFactory.java by:
[WARNING]     org.openrewrite.java.apache.httpclient5.UpgradeApacheHttpClient_5
[WARNING]         org.openrewrite.java.apache.httpclient5.UpgradeApacheHttpClient_5_ClassMapping
[WARNING]             org.openrewrite.java.ChangePackage: {oldPackageName=org.apache.http.impl.client, newPackageName=org.apache.hc.client5.http.impl.classic}
[WARNING]             org.openrewrite.java.ChangePackage: {oldPackageName=org.apache.http.client, newPackageName=org.apache.hc.client5.http}
[WARNING]             org.openrewrite.java.ChangePackage: {oldPackageName=org.apache.http.conn.ssl, newPackageName=org.apache.hc.core5.ssl}
[WARNING]             org.openrewrite.java.ChangePackage: {oldPackageName=org.apache.http.impl.conn, newPackageName=org.apache.hc.client5.http.impl.io}
[WARNING] Changes have been made to samples/client/src/main/java/org/apache/olingo/samples/client/core/http/ParametersHttpUriRequestFactory.java by:
[WARNING]     org.openrewrite.java.apache.httpclient5.UpgradeApacheHttpClient_5
[WARNING]         org.openrewrite.java.apache.httpclient5.UpgradeApacheHttpClient_5_ClassMapping
[WARNING]             org.openrewrite.java.ChangePackage: {oldPackageName=org.apache.http.client.methods, newPackageName=org.apache.hc.client5.http.classic.methods}
[WARNING]             org.openrewrite.java.ChangePackage: {oldPackageName=org.apache.http, newPackageName=org.apache.hc.core5.http}
[WARNING] Please review and commit the results.
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for Olingo-OData 5.0.1-SNAPSHOT:
[INFO] 
[INFO] Olingo-OData ....................................... SUCCESS [  0.650 s]
[INFO] odata-lib .......................................... SUCCESS [  0.022 s]
[INFO] odata-commons-api .................................. SUCCESS [  0.305 s]
[INFO] odata-commons-core ................................. SUCCESS [  0.076 s]
[INFO] odata-client-api ................................... SUCCESS [  0.136 s]
[INFO] odata-client-core .................................. SUCCESS [  0.195 s]
[INFO] odata-server-api ................................... SUCCESS [  0.127 s]
[INFO] odata-server-core .................................. SUCCESS [  0.132 s]
[INFO] odata-server-core-ext .............................. SUCCESS [  0.236 s]
[INFO] odata-server-tecsvc ................................ SUCCESS [  0.346 s]
[INFO] odata-server-test .................................. SUCCESS [  0.223 s]
[INFO] odata-ext .......................................... SUCCESS [  0.012 s]
[INFO] odata-client-proxy ................................. SUCCESS [  0.098 s]
[INFO] pojogen-maven-plugin ............................... SUCCESS [  1.790 s]
[INFO] odata-client-android ............................... SUCCESS [  0.139 s]
[INFO] odata-fit .......................................... SUCCESS [  0.986 s]
[INFO] odata-dist ......................................... SUCCESS [  0.010 s]
[INFO] Olingo-OData-Client-for-Android .................... SUCCESS [  0.094 s]
[INFO] Olingo-OData-Client-for-Java ....................... SUCCESS [  0.095 s]
[INFO] Olingo-OData-Server-for-Java ....................... SUCCESS [  0.135 s]
[INFO] Olingo-OData-Server-Extension-for-Java ............. SUCCESS [  0.116 s]
[INFO] Olingo-OData-JavaDoc ............................... SUCCESS [  0.013 s]
[INFO] odata-samples ...................................... SUCCESS [  0.012 s]
[INFO] odata-server-sample ................................ SUCCESS [01:08 min]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  01:14 min
[INFO] Finished at: 2024-01-25T12:19:34+01:00
[INFO] ------------------------------------------------------------------------

@timtebeek timtebeek self-assigned this Jan 25, 2024
@timtebeek timtebeek added bug Something isn't working dependencies Pull requests that update a dependency file boot-3.0 labels Jan 25, 2024
@timtebeek timtebeek merged commit 624df94 into main Jan 25, 2024
1 check passed
@timtebeek timtebeek deleted the apache-httpclient5-classpath-from-resources branch January 25, 2024 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
boot-3.0 bug Something isn't working dependencies Pull requests that update a dependency file
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

1 participant