Skip to content

Add Jackson 3 plugin and migrate publishing to maven-publish#185

Open
Sboti03 wants to merge 3 commits intoorigin-energy:masterfrom
Sboti03:feature/jackson3
Open

Add Jackson 3 plugin and migrate publishing to maven-publish#185
Sboti03 wants to merge 3 commits intoorigin-energy:masterfrom
Sboti03:feature/jackson3

Conversation

@Sboti03
Copy link
Copy Markdown

@Sboti03 Sboti03 commented Apr 17, 2026

What changed

Build and publishing

  • upgraded the Gradle build setup
  • migrated publishing from legacy maven / uploadArchives to maven-publish
  • updated release workflows to use publish
  • consolidated shared JUnit 5 and dependency configuration
  • kept publishToMavenLocal working with the upgraded build

Jackson 3 support

  • added a new java-snapshot-testing-plugin-jackson3 module
  • introduced Jackson 3 serializer implementations and tests
  • added snapshot fixtures for the new module
  • updated the README with Jackson 2 vs Jackson 3 usage examples

Validation

Ran:

./gradlew publishToMavenLocal
./gradlew :java-snapshot-testing-plugin-jackson3:test publishToMavenLocal

Notes

  • existing Java 8-targeted modules remain unchanged in intent
  • Jackson 3 support is provided as a separate module rather than changing the existing Jackson 2 plugin
  • the branch history is intentionally split into two commits for easier review

fixes #183

Comment thread gradle/publishing.gradle Outdated
Comment thread build.gradle
mavenCentral()
}

if (subproject.name == 'java-snapshot-testing-plugin-jackson3') {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why is this long if else needed as it wasn't required previously? Will the code work without it?

Comment thread build.gradle
relocate 'org.opentest4j', 'shadow.org.opentest4j'
exclude "module-info.class"
archiveClassifier = ''
if (subproject.name != 'java-snapshot-testing-plugin-jackson3') {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why is jackson3 skipping shadowing?

Comment thread build.gradle
compileOnly "org.slf4j:slf4j-api:${project.slf4jVersion}"
}

// Add verbose logging for Github Actions
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

keep comment

Comment thread build.gradle
compileOnly 'org.projectlombok:lombok:1.18.20'
annotationProcessor 'org.projectlombok:lombok:1.18.20'
testCompileOnly 'org.projectlombok:lombok:1.18.20'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.20'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Where are the lombok deps coming in now?

Comment thread README.md
// slf4j logging implementation if you don't already have one
testImplementation("org.slf4j:slf4j-simple:2.0.0-alpha0")

// Optional: Many will want to serialize into JSON. In this case you should also add the Jackson plugin
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Jackson 3 should come first now. Update comment for jackson2 as targeting jackson version 2

Comment thread README.md
serializer.json=au.com.origin.snapshots.jackson.serializers.v1.JacksonSnapshotSerializer
serializer.orderedJson=au.com.origin.snapshots.jackson.serializers.v1.DeterministicJacksonSnapshotSerializer

# Jackson 3 alternative
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Jackson3 should now be the preferred. Update comment on Jackson2 to make it clears it's targeting jackson2.

Comment thread gradle/publishing.gradle
afterEvaluate {
if (project.hasProperty("sign")) {
signing {
sign publishing.publications
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why did this get separated from the project.hasProperty("sign") step?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incompatibility with Jackson 3/ Spring Boot 4

2 participants