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

“You need to add io.quarkus:quarkus-rest-client-reactive-jackson to your dependencies.” even though it’s present #499

Closed
patr1kt0th opened this issue Sep 24, 2023 · 6 comments · Fixed by #500
Assignees
Labels
added to backlog The issue was added to backlog bug Something isn't working pinned Issues and PRs that must not stale

Comments

@patr1kt0th
Copy link
Contributor

Hi guys. I was about to update our project to the latest Quarkus version (3.4.1) and got a strange error when trying to compile our conversion-connector (the only one using quarkus-openapi-generator version 2.2.10). We use the reactive versions of the dependencies:

    <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-resteasy-reactive-jackson</artifactId>
    </dependency>
    <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-rest-client-reactive-jackson</artifactId>
    </dependency>

and after I try to compile (or run) the application using ./mvnw clean compile, I get:

[ERROR] Failed to execute goal io.quarkus.platform:quarkus-maven-plugin:3.4.1:generate-code (default) on project conversion-connector: Quarkus code generation phase has failed: InvocationTargetException: You need to add io.quarkus:quarkus-rest-client-reactive-jackson to your dependencies. -> [Help 1]

By using the -e switch, the cause is shown:

Caused by: io.quarkus.bootstrap.prebuild.CodeGenException: You need to add io.quarkus:quarkus-rest-client-reactive-jackson to your dependencies.
    at io.quarkiverse.openapi.generator.deployment.codegen.OpenApiGeneratorCodeGenBase.trigger (OpenApiGeneratorCodeGenBase.java:103)

And after checking deployment/src/main/java/io/quarkiverse/openapi/generator/deployment/codegen/OpenApiGeneratorCodeGenBase.java's history and trying the same with the current code base from main, the throw moved to line 106.

Using the classic versions of the dependencies:

    <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-resteasy-jackson</artifactId>
    </dependency>
    <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-rest-client-jackson</artifactId>
    </dependency>
    <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-resteasy-multipart</artifactId>
    </dependency>

I'm able to compile and run the application without any issues.

@hbelmiro , @ricardozanini , do you have an idea what's going on here? I can check in more details tomorrow, but maybe you know it right away?

@hbelmiro
Copy link
Contributor

No idea @patr1kt0th 🙁
I’d have to take a further look.

@willemsendennis
Copy link

Same here with quarkus 3.4.1 on gradle.

@chberger
Copy link
Contributor

chberger commented Sep 27, 2023

@hbelmiro : I've analyzed this issue.

With Quarkus 3.4.1, the Quarkus team has changed the identifier for the REST_CLIENT_REACTIVE_JACKSON capability. That's the related commit: quarkusio/quarkus@29181b3

However, the latest version of quarkus-openapi-generator expects this capability via the id io.quarkus.rest.client.reactive.jackson as it has been compiled with Quarkus < 3.4.1. Now Quarkus provides this capability with the following id io.quarkus.rest.client.reactive.json.jackson. Obviously, this cannot work anymore.

I guess we just need to recompile the quarkus-openapi-generator with Quarkus version 3.4.1 and it should work again. However, this change is not backward compatible because the resulting version would not work with Quarkus apps < 3.4.1.

Solution idea: we could determine the Quarkus version at build time and request the correct capability id accordingly. By doing so, the extension would be compatible with Quarkus < 3.4.1 and >= 3.4.1.

Shall I implement a PR?

@hbelmiro
Copy link
Contributor

Many thanks for investigating @chberger ❤️
Please go ahead with the PR.

@hbelmiro hbelmiro added bug Something isn't working added to backlog The issue was added to backlog labels Sep 27, 2023
@hbelmiro hbelmiro added the pinned Issues and PRs that must not stale label Sep 27, 2023
@chberger
Copy link
Contributor

Here we go: #500

This PR is still marked as draft since I don't have automated tests. Maybe the community can test that version and verify that everything works as expected. @hbelmiro wdyt?

@patr1kt0th
Copy link
Contributor Author

patr1kt0th commented Sep 28, 2023

@chberger I can definitely give it a try on our codebase where we use Quarkus version 3.3.1 on main and 3.4.1 on dev.

UPDATE: I was able to start both versions locally (quarkus dev) using the changes from this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
added to backlog The issue was added to backlog bug Something isn't working pinned Issues and PRs that must not stale
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants