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

Bump Jackson to 2.15.2 #33762

Closed
wants to merge 11 commits into from
2 changes: 1 addition & 1 deletion bom/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
<graal-sdk.version>22.3.2</graal-sdk.version>
<graal-svm.version>${graal-sdk.version}</graal-svm.version>
<gizmo.version>1.6.1.Final</gizmo.version>
<jackson-bom.version>2.15.0</jackson-bom.version>
<jackson-bom.version>2.15.2</jackson-bom.version>
<commons-logging-jboss-logging.version>1.0.0.Final</commons-logging-jboss-logging.version>
<commons-lang3.version>3.12.0</commons-lang3.version>
<commons-codec.version>1.15</commons-codec.version>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package io.quarkus.it.resteasy.jackson;

import java.sql.Date;
import java.time.LocalDate;

public record GreetingRecord(String message, LocalDate date, Date sqlDate) {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package io.quarkus.it.resteasy.jackson;

import java.sql.Date;
import java.time.LocalDate;

import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;

@Path("/greetingRecord")
public class GreetingRecordResource {

@GET
public GreetingRecord hello() {
LocalDate localDate = LocalDate.of(2019, 01, 01);
return new GreetingRecord("hello", localDate, new Date(localDate.toEpochDay()));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package io.quarkus.it.resteasy.jackson;

import jakarta.inject.Singleton;

import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.PropertyAccessor;
import com.fasterxml.jackson.databind.ObjectMapper;

import io.quarkus.jackson.ObjectMapperCustomizer;

@Singleton
public class JacksonConfiguration implements ObjectMapperCustomizer {

@Override
public void customize(ObjectMapper mapper) {
mapper.setVisibility(PropertyAccessor.FIELD, JsonAutoDetect.Visibility.ANY);
mapper.setVisibility(PropertyAccessor.GETTER, JsonAutoDetect.Visibility.NONE);
mapper.setVisibility(PropertyAccessor.SETTER, JsonAutoDetect.Visibility.ANY);
mapper.setVisibility(PropertyAccessor.CREATOR, JsonAutoDetect.Visibility.NONE);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package io.quarkus.it.resteasy.jackson;

import static io.restassured.RestAssured.given;
import static org.hamcrest.CoreMatchers.containsString;

import org.junit.jupiter.api.Test;

import io.quarkus.test.junit.QuarkusTest;

@QuarkusTest
class GreetingRecordResourceTest {

@Test
void testEndpoint() {
given()
.when().get("/greetingRecord")
.then()
.statusCode(200)
.body(containsString("hello"))
.body(containsString("2019-01-01"));
}

}
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@
</issueManagement>

<properties>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.release>11</maven.compiler.release>
<maven.compiler.target>17</maven.compiler.target>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.release>17</maven.compiler.release>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We definitely don't want this :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed it to get my Test using "record" running. Is there another way to enable Java version with "record"??

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say let's remove the test altogether as it's not a Quarkus issue, it's a Jackson issue so we should not be testing for it (unless we have some problematic integration point)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a plan to update the maven.compiler settings to a newer version than 11?
So far i will remove the Test.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a plan to update the maven.compiler settings to a newer version than 11?

No.

But for Java 17 specific things, we do have a dedicated integration test.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, where can i find these dedicated Tests?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it’s a Jackson bug, I don’t think we need a test in our code base.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, than next time we need to check again manually...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we were to add such tests, we would need to add them for every feature under the sun, that just isn't practical.
What we do test extensively is our integration points with the various libraries and our workarounds for known problems.

The Jackson problem you linked to is neither - but of course we do want to bump to the latest Jackson version.

<maven.compiler.parameters>true</maven.compiler.parameters>

<graalvmHome>${env.GRAALVM_HOME}</graalvmHome>
Expand Down