-
Notifications
You must be signed in to change notification settings - Fork 18
Add Jackson 3 plugin and migrate publishing to maven-publish #185
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
Changes from 2 commits
426810f
73647fb
4cdfeb1
05e2779
5addc1d
97abfe6
af3c9ca
4c60c31
4323a0b
573e335
84cec22
0ea43c3
e37e7b2
1bef5e2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,48 +1,107 @@ | ||
| import org.gradle.api.tasks.compile.GroovyCompile | ||
| import org.gradle.api.tasks.compile.JavaCompile | ||
| import org.gradle.api.tasks.javadoc.Javadoc | ||
| import org.gradle.api.tasks.testing.Test | ||
|
|
||
| plugins { | ||
| id 'net.researchgate.release' version '2.6.0' apply false | ||
| id 'com.github.johnrengelman.shadow' version '5.2.0' apply false | ||
| id 'com.gradleup.shadow' version '9.3.2' apply false | ||
| id 'io.codearte.nexus-staging' version '0.22.0' | ||
| id "com.diffplug.spotless" version "6.11.0" apply false | ||
| id 'com.diffplug.spotless' version '8.4.0' apply false | ||
| } | ||
|
|
||
| ext { | ||
| junit5Version = '5.10.2' | ||
| lombokVersion = '1.18.20' | ||
| slf4jVersion = '2.0.0-alpha0' | ||
| assertjVersion = '3.11.1' | ||
| } | ||
|
|
||
| subprojects { subproject -> | ||
| // FIXME this plugin is currently not working for multi-module projects even when defined at the top level only | ||
| // Will need to release and TAG manually for now | ||
| subproject.apply plugin: 'net.researchgate.release' | ||
| subproject.apply plugin: 'java-library' | ||
| subproject.apply plugin: 'com.github.johnrengelman.shadow' | ||
| subproject.apply plugin: 'com.gradleup.shadow' | ||
| subproject.apply plugin: 'maven-publish' | ||
|
|
||
| sourceCompatibility = '1.8' | ||
| targetCompatibility = '1.8' | ||
| java { | ||
| sourceCompatibility = JavaVersion.VERSION_1_8 | ||
| targetCompatibility = JavaVersion.VERSION_1_8 | ||
| } | ||
|
|
||
| repositories { | ||
| mavenCentral() | ||
| } | ||
|
|
||
| if (subproject.name == 'java-snapshot-testing-plugin-jackson3') { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The Jackson 3 module needs Java 17 because Jackson 3 artifacts require Java 17. |
||
| tasks.withType(JavaCompile).configureEach { | ||
| javaCompiler = javaToolchains.compilerFor { | ||
| languageVersion = JavaLanguageVersion.of(17) | ||
| } | ||
| } | ||
|
|
||
| tasks.withType(Javadoc).configureEach { | ||
| javadocTool = javaToolchains.javadocToolFor { | ||
| languageVersion = JavaLanguageVersion.of(17) | ||
| } | ||
| } | ||
|
|
||
| tasks.withType(Test).configureEach { | ||
| javaLauncher = javaToolchains.launcherFor { | ||
| languageVersion = JavaLanguageVersion.of(17) | ||
| } | ||
| } | ||
| } else { | ||
| tasks.withType(JavaCompile).configureEach { | ||
| javaCompiler = javaToolchains.compilerFor { | ||
| languageVersion = JavaLanguageVersion.of(11) | ||
| } | ||
| } | ||
|
|
||
| tasks.withType(Javadoc).configureEach { | ||
| javadocTool = javaToolchains.javadocToolFor { | ||
| languageVersion = JavaLanguageVersion.of(11) | ||
| } | ||
| } | ||
|
|
||
| tasks.withType(Test).configureEach { | ||
| javaLauncher = javaToolchains.launcherFor { | ||
| languageVersion = JavaLanguageVersion.of(11) | ||
| } | ||
| } | ||
|
|
||
| tasks.withType(GroovyCompile).configureEach { | ||
| javaLauncher = javaToolchains.launcherFor { | ||
| languageVersion = JavaLanguageVersion.of(11) | ||
| } | ||
| } | ||
| } | ||
|
|
||
| shadowJar { | ||
| classifier = '' | ||
| relocate 'org.assertj', 'shadow.org.assertj' | ||
| relocate 'org.opentest4j', 'shadow.org.opentest4j' | ||
| exclude "module-info.class" | ||
| archiveClassifier = '' | ||
| if (subproject.name != 'java-snapshot-testing-plugin-jackson3') { | ||
|
jackmatt2 marked this conversation as resolved.
Outdated
|
||
| relocate 'org.assertj', 'shadow.org.assertj' | ||
| relocate 'org.opentest4j', 'shadow.org.opentest4j' | ||
| } | ||
| exclude 'module-info.class' | ||
| } | ||
|
|
||
| jar { | ||
| archiveClassifier = 'thin' | ||
| } | ||
|
|
||
| dependencies { | ||
| // Lombok | ||
| 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' | ||
|
jackmatt2 marked this conversation as resolved.
|
||
|
|
||
| // Logging implementation | ||
| compileOnly 'org.slf4j:slf4j-api:2.0.0-alpha0' | ||
| compileOnly "org.projectlombok:lombok:${project.lombokVersion}" | ||
| annotationProcessor "org.projectlombok:lombok:${project.lombokVersion}" | ||
| testCompileOnly "org.projectlombok:lombok:${project.lombokVersion}" | ||
| testAnnotationProcessor "org.projectlombok:lombok:${project.lombokVersion}" | ||
|
|
||
| compileOnly "org.slf4j:slf4j-api:${project.slf4jVersion}" | ||
| } | ||
|
|
||
| // Add verbose logging for Github Actions | ||
|
jackmatt2 marked this conversation as resolved.
|
||
| test { | ||
| testLogging { | ||
| events "passed", "skipped", "failed" | ||
| exceptionFormat "full" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| dependencies { | ||
| testImplementation platform("org.junit:junit-bom:${project.junit5Version}") | ||
| testImplementation 'org.junit.jupiter:junit-jupiter' | ||
| testRuntimeOnly 'org.junit.platform:junit-platform-launcher' | ||
| } | ||
|
|
||
| test { | ||
| useJUnitPlatform() | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,6 @@ | ||
| #Fri Apr 17 09:29:12 CEST 2026 | ||
| distributionBase=GRADLE_USER_HOME | ||
| distributionPath=wrapper/dists | ||
| distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.3-bin.zip | ||
| distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip | ||
| zipStoreBase=GRADLE_USER_HOME | ||
| zipStorePath=wrapper/dists |
Uh oh!
There was an error while loading. Please reload this page.