Skip to content

[BUG] SpringBoot3: Use jackson-jakarta-rs-json-provider instead of jackson-jaxrs-json-provider #416

@corentin-pasquier

Description

@corentin-pasquier

Describe the bug.

We were trying to use the library to generate code; this code deployed as as jar to our repository and imported in a Spring Boot 3 project.
We have an error when starting our Spring Boot 3 project and we find out that this dependency is causing problem:

<dependency>
    <groupId>com.fasterxml.jackson.jaxrs</groupId>
    <artifactId>jackson-jaxrs-json-provider</artifactId>
    <scope>compile</scope>
</dependency>

This dependency is using old javax, this dependency should be replaced (when using springBoot3 and not springBoot2) by:

<dependency>
    <groupId>com.fasterxml.jackson.jakarta.rs</groupId>
    <artifactId>jackson-jakarta-rs-json-provider</artifactId>
    <scope>compile</scope>
</dependency>

Expected behavior

Use Jakarta compliant dependency for a Spring Boot 3 generated code.

<dependency>
    <groupId>com.fasterxml.jackson.jakarta.rs</groupId>
    <artifactId>jackson-jakarta-rs-json-provider</artifactId>
    <scope>compile</scope>
</dependency>

Screenshots

image

How to Reproduce

  1. Generate a Spring Boot 3 project
    Follow the link with every needed dependencies to reproduce Spring Initializr

  2. Generate code with spring template

$ node --version
v18.14.2
$ npm i -g @asyncapi/cli
$ npm i -g @asyncapi/java-spring-template
$ wget https://raw.githubusercontent.com/ab510/asyncapi/refs/heads/master/examples/2.0.0/streetlights.yml
$ asyncapi generate fromTemplate streetlights.yml @asyncapi/java-spring-template --param maven=true --output generated-
  1. Install package to your device maven repository
    Before I had to change StreetLightId equals function so it returns true (there is a compilation error).
    image
$ cd generated-code
$ mvn install -DskipTests
  1. Then add the dependency to your Spring Boot 3 project:
	<dependencies>
		<dependency>
			<groupId>com.asyncapi</groupId>
			<artifactId>untitled</artifactId>
			<version>1.0-SNAPSHOT</version>
		</dependency>
	</dependencies>
  1. Start your application
    image

  2. Change the dependency to the jakarta one, it works

🥦 Browser

Google Chrome

👀 Have you checked for similar open issues?

  • I checked and didn't find similar issue

🏢 Have you read the Contributing Guidelines?

Are you willing to work on this issue ?

Yes I am willing to submit a PR!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstale

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions