Add Jackson 3 plugin and migrate publishing to maven-publish#185
Add Jackson 3 plugin and migrate publishing to maven-publish#185Sboti03 wants to merge 7 commits intoorigin-energy:masterfrom
Conversation
| mavenCentral() | ||
| } | ||
|
|
||
| if (subproject.name == 'java-snapshot-testing-plugin-jackson3') { |
There was a problem hiding this comment.
Why is this long if else needed as it wasn't required previously? Will the code work without it?
There was a problem hiding this comment.
The Jackson 3 module needs Java 17 because Jackson 3 artifacts require Java 17.
The long root if/else is not needed the default can stay Java 11 and Jackson 3 can override locally.
| relocate 'org.opentest4j', 'shadow.org.opentest4j' | ||
| exclude "module-info.class" | ||
| archiveClassifier = '' | ||
| if (subproject.name != 'java-snapshot-testing-plugin-jackson3') { |
There was a problem hiding this comment.
Why is jackson3 skipping shadowing?
There was a problem hiding this comment.
It is not skipping shadowJar, it only skipped two relocation rules.
But I checked again and the Jackson 3 jar file does not contain these dependencies, the exception can be removed.
| compileOnly "org.slf4j:slf4j-api:${project.slf4jVersion}" | ||
| } | ||
|
|
||
| // Add verbose logging for Github Actions |
| // 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 |
There was a problem hiding this comment.
Jackson 3 should come first now. Update comment for jackson2 as targeting jackson version 2
| serializer.json=au.com.origin.snapshots.jackson.serializers.v1.JacksonSnapshotSerializer | ||
| serializer.orderedJson=au.com.origin.snapshots.jackson.serializers.v1.DeterministicJacksonSnapshotSerializer | ||
|
|
||
| # Jackson 3 alternative |
There was a problem hiding this comment.
Jackson3 should now be the preferred. Update comment on Jackson2 to make it clears it's targeting jackson2.
| afterEvaluate { | ||
| if (project.hasProperty("sign")) { | ||
| signing { | ||
| sign publishing.publications |
There was a problem hiding this comment.
Why did this get separated from the project.hasProperty("sign") step?
There was a problem hiding this comment.
Because publishing metadata is required for every Maven publication.
Signing is optional and should only control signature generation.
|
@jackmatt2 I've made the fixes you requested and fixed the pipelines. |
What changed
Build and publishing
Jackson 3 support
Validation
Ran:
./gradlew publishToMavenLocal
./gradlew :java-snapshot-testing-plugin-jackson3:test publishToMavenLocal
Notes
fixes #183