-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Build failure when using quarkus-amazon-lambda and smallrye-jwt extensions #27250
Comments
I'm not an expert on this, but yes, I think you can keep this additional dependency in your project for now as Quarkus documentation doesn't say much about Java EE 8 and Jakarta EE 9. I'll try to clarify this question: the runtime exception occurs because the smallrye-jwt dependency has In traditional Jakarta EE projects, you'll have a parent dependency of the EE and MicroProfile specifications that expects that all implementations are provided by a compatible application server (TCK certified), and then just deploy a thin war (KB size) of the application into the server deployment folder. For example: <dependency>
<groupId>jakarta.platform</groupId>
<artifactId>jakarta.jakartaee-api</artifactId>
<version>${jakarta.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.eclipse.microprofile</groupId>
<artifactId>microprofile</artifactId>
<version>${microprofile.version}</version>
<type>pom</type>
<scope>provided</scope>
</dependency> In legacy Java EE projects you'll see: <dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>${ee.version}</version>
<scope>provided</scope>
</dependency> An application server like WildFly contains EE and SmallRye implementations, the difference is that in Quarkus we have built-in extensions that run Ahead of Time Compilation (AOT) to optimize the code as much as possible, so always prefer to add an extension over a external dependency. As @mkouba said in this blog post:
If you want know more about the Quarkus approach to migrate from <dependency>
<groupId>jakarta.json</groupId>
<artifactId>jakarta.json-api</artifactId>
</dependency> A short history of Quarkus and Java EE: |
Thank you @fercomunello for your explanation. Now I understand better Quarkus relationship between traditional Java EE projects. I suppose we can close this issue since it's not a bug. Although it may be handy for people who bump into this scenario. |
Describe the bug
I'm trying to build an AWS Lambda application that uses smallrye-jwt dependency to inject JsonWebTokens values into lambda handler. But when building the application, quarkus is unable to index smallrye-jwt dependency properly by saying:
I was able to reproduce the error using the minimum of quarkus-amazon-lambda extension and smallrye-jwt dependency directly.
Expected behavior
A successfully build with no failures when running tests
Actual behavior
How to Reproduce?
To reproduce this error, you must do the following steps:
Output of
uname -a
orver
Linux fcortes-XPS-8700 5.15.0-43-generic #46~20.04.1-Ubuntu SMP Thu Jul 14 15:20:17 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Output of
java -version
penjdk version "11.0.14.1" 2022-02-08 LTS OpenJDK Runtime Environment Corretto-11.0.14.10.1 (build 11.0.14.1+10-LTS) OpenJDK 64-Bit Server VM Corretto-11.0.14.10.1 (build 11.0.14.1+10-LTS, mixed mode)
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.11.2.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.8.5 (3599d3414f046de2324203b78ddcf9b5e4388aa0) Maven home: /home/fcortes/.sdkman/candidates/maven/current Java version: 11.0.14.1, vendor: Amazon.com Inc., runtime: /home/fcortes/.sdkman/candidates/java/11.0.14.10.1-amzn Default locale: pt_BR, platform encoding: UTF-8 OS name: "linux", version: "5.15.0-43-generic", arch: "amd64", family: "unix"
Additional information
I found an workaround by adding the javax.json-api dependency, but I'm afraid this is not the best thing to do because no information is present in the security-jwt guide about this:
The text was updated successfully, but these errors were encountered: