diff --git a/CHANGELOG.md b/CHANGELOG.md index 170f99b64..e061cb6d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Release Notes +# 0.30.0 +* Update to spring-boot 3.0.6 + # 0.25.2 * Dependency updates diff --git a/build.gradle b/build.gradle index c034988e2..80f9161dc 100644 --- a/build.gradle +++ b/build.gradle @@ -9,21 +9,14 @@ buildscript { } dependencies { classpath "io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.30.0" - //classpath "com.adarshr:gradle-test-logger-plugin:3.2.0" } } -//import org.gradle.api.tasks.testing.logging.TestExceptionFormat -//import org.gradle.api.tasks.testing.logging.TestLogEvent ext { - awsSdkVersion = "2.17.283" - springVersion = "5.3.23" - springSecurityVersion = "5.7.4" - springBootVersion = "2.7.5" - edisonVersion = "2.7.5" - jacksonVersion = "2.14.2" - logbackVersion = "1.2.11" + awsSdkVersion = "2.20.12" + springBootVersion = "3.0.6" + edisonVersion = "3.0.0-M2" } apply plugin: 'java' @@ -32,17 +25,18 @@ apply plugin: 'eclipse' apply plugin: 'io.codearte.nexus-staging' apply from: "${rootDir}/jacoco.gradle" -task startLocalStack(type:Exec) { - commandLine "docker", "run", "--name", "synapse_localstack", "-d", "-p", "4566:4566", "localstack/localstack:1.4.0" +tasks.register('startLocalStack', Exec) { + commandLine "docker", "run", "--name", "synapse_localstack", "-d", "-p", "4566:4566", "localstack/localstack:2.0.2" } -task stopLocalStack(type: Exec) { + +tasks.register('stopLocalStack', Exec) { commandLine 'docker', 'rm', '-f', 'synapse_localstack' } nexusStaging { - username=sonatypeUsername - password=sonatypePassword - packageGroup='de.otto' + username = sonatypeUsername + password = sonatypePassword + packageGroup = 'de.otto' } subprojects { @@ -50,21 +44,27 @@ subprojects { apply plugin: 'java' apply plugin: 'idea' apply plugin: 'eclipse' - //apply plugin: "com.adarshr.test-logger" apply from: "${rootDir}/jacoco.gradle" - sourceCompatibility = '1.8' - targetCompatibility = '1.8' + sourceCompatibility = '17' + targetCompatibility = '17' dependencies { annotationProcessor "org.springframework.boot:spring-boot-configuration-processor:${springBootVersion}" + + implementation(platform("org.springframework.boot:spring-boot-dependencies:${springBootVersion}")) + + testImplementation(platform("org.springframework.boot:spring-boot-dependencies:${springBootVersion}")) + + implementation(platform("software.amazon.awssdk:bom:${awsSdkVersion}")) + } task allDeps(type: DependencyReportTask) {} compileJava.dependsOn(processResources) - version = '0.25.3-SNAPSHOT' + version = '0.30.0-SNAPSHOT' group = 'de.otto.synapse' repositories { @@ -74,47 +74,4 @@ subprojects { maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' } } -// testlogger { -// showStandardStreams true -// showPassedStandardStreams false -// showSkippedStandardStreams false -// showFailedStandardStreams true -// } - -// tasks.withType(Test) { -// testLogging { -// // set options for log level LIFECYCLE -// events TestLogEvent.FAILED, -// TestLogEvent.PASSED, -// TestLogEvent.SKIPPED, -// TestLogEvent.STANDARD_OUT -// exceptionFormat TestExceptionFormat.FULL -// showExceptions true -// showCauses true -// showStackTraces true -// -// // set options for log level DEBUG and INFO -// debug { -// events TestLogEvent.STARTED, -// TestLogEvent.FAILED, -// TestLogEvent.PASSED, -// TestLogEvent.SKIPPED, -// TestLogEvent.STANDARD_ERROR, -// TestLogEvent.STANDARD_OUT -// exceptionFormat TestExceptionFormat.FULL -// } -// info.events = debug.events -// info.exceptionFormat = debug.exceptionFormat -// -// afterSuite { desc, result -> -// if (!desc.parent) { // will match the outermost suite -// def output = "Results: ${result.resultType} (${result.testCount} tests, ${result.successfulTestCount} passed, ${result.failedTestCount} failed, ${result.skippedTestCount} skipped)" -// def startItem = '| ', endItem = ' |' -// def repeatLength = startItem.length() + output.length() + endItem.length() -// println('\n' + ('-' * repeatLength) + '\n' + startItem + output + endItem + '\n' + ('-' * repeatLength)) -// } -// } -// } -// } - } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 3ab0b725e..070cb702f 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/jacoco.gradle b/jacoco.gradle index b21b5c466..f056dcc80 100644 --- a/jacoco.gradle +++ b/jacoco.gradle @@ -1,13 +1,9 @@ apply plugin: 'jacoco' -jacoco { - toolVersion = "0.8.6" -} - jacocoTestReport { reports { - xml.enabled = true - html.enabled = true + xml.required.set(true) + html.required.set(true) } } diff --git a/synapse-aws-auth/build.gradle b/synapse-aws-auth/build.gradle index 8e2c28804..fb2be8eaa 100644 --- a/synapse-aws-auth/build.gradle +++ b/synapse-aws-auth/build.gradle @@ -4,26 +4,25 @@ dependencies { api project(':synapse-core:') api "com.google.guava:guava:31.1-jre" - api "software.amazon.awssdk:auth:${awsSdkVersion}" - api "software.amazon.awssdk:core:${awsSdkVersion}" - api "software.amazon.awssdk:profiles:${awsSdkVersion}" - api "software.amazon.awssdk:regions:${awsSdkVersion}" - api "software.amazon.awssdk:utils:${awsSdkVersion}" + api "software.amazon.awssdk:auth" + api "software.amazon.awssdk:profiles" + api "software.amazon.awssdk:regions" + api "software.amazon.awssdk:utils" testImplementation project(':synapse-testsupport') - testImplementation 'junit:junit:4.13.2' + testImplementation 'junit:junit' testImplementation 'org.hamcrest:hamcrest-all:1.3' - testImplementation "org.springframework.boot:spring-boot-starter-test:${springBootVersion}" - testImplementation "com.jayway.jsonpath:json-path-assert:2.7.0" + testImplementation "org.springframework.boot:spring-boot-starter-test" + testImplementation "com.jayway.jsonpath:json-path-assert" testImplementation 'com.tngtech.java:junit-dataprovider:1.13.1' - testImplementation "org.awaitility:awaitility:4.2.0" - testImplementation "org.mockito:mockito-core:5.1.1" - testImplementation "ch.qos.logback:logback-core:${logbackVersion}" - testImplementation "ch.qos.logback:logback-classic:${logbackVersion}" + testImplementation "org.awaitility:awaitility" + testImplementation "org.mockito:mockito-core" + testImplementation "ch.qos.logback:logback-core" + testImplementation "ch.qos.logback:logback-classic" } -apply plugin: 'maven' +apply plugin: 'maven-publish' apply plugin: 'signing' @@ -38,78 +37,94 @@ task javadocJar(type: Jar, dependsOn: javadoc) { task sourcesJar(type: Jar) { from sourceSets.main.allSource - classifier = 'sources' + archiveClassifier = 'sources' } -uploadArchives { - repositories { - mavenDeployer { - beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } - - repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { - authentication(userName: sonatypeUsername, password: sonatypePassword) - } - snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") { - authentication(userName: sonatypeUsername, password: sonatypePassword) +publishing { + publications { + mavenJava(MavenPublication) { + artifactId = 'synapse-aws-auth' + from components.java + versionMapping { + usage('java-api') { + fromResolutionOf('runtimeClasspath') + } + usage('java-runtime') { + fromResolutionResult() + } } - - pom.project { - name 'synapse-aws-auth' + pom { + name = 'synapse-aws-auth' packaging 'jar' - description 'AWS authentication for Synapse' - url 'http://github.com/otto-de/synapse' + description = 'AWS authentication for Synapse' + url = 'http://github.com/otto-de/synapse' scm { - url 'scm:git@github.com:otto-de/synapse.git' - connection 'scm:git@github.com:otto-de/synapse.git' - developerConnection 'scm:git@github.com:otto-de/synapse.git' + url = 'scm:git@github.com:otto-de/synapse.git' + connection = 'scm:git@github.com:otto-de/synapse.git' + developerConnection = 'scm:git@github.com:otto-de/synapse.git' } licenses { license { - name 'The Apache Software License, Version 2.0' - url 'http://www.apache.org/licenses/LICENSE-2.0.txt' - distribution 'repo' + name = "The Apache Software License, Version 2.0" + url = "http://www.apache.org/licenses/LICENSE-2.0.txt" + distribution = 'repo' } } - developers { developer { - id 'gsteinacker' - name 'Guido Steinacker' + id = 'gsteinacker' + name = 'Guido Steinacker' } developer { - id 'mbargmann' - name 'Matthias Bargmann' + id = 'mbargmann' + name = 'Matthias Bargmann' } developer { - id 'fbregulla' - name 'Frank Bregulla' + id = 'fbregulla' + name = 'Frank Bregulla' } developer { - id 'ftorkler' - name 'Florian Torkler' + id = 'ftorkler' + name = 'Florian Torkler' } developer { - id 'miregel' - name 'Micha Regel' + id = 'miregel' + name = 'Micha Regel' } developer { - id 'hstruebe' - name 'Henning Strueber' + id = 'hstruebe' + name = 'Henning Strueber' } } } } } + + repositories { + maven { + name = "Sonatype" + url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/") + credentials { + username = findProperty("sonatypeUsername") + password = findProperty("sonatypePassword") + } + } + maven { + name = "Sonatype_Snapshots" + url = uri("https://oss.sonatype.org/content/repositories/snapshots/") + credentials { + username = findProperty("sonatypeUsername") + password = findProperty("sonatypePassword") + } + } + } } signing { - required { gradle.taskGraph.hasTask("uploadArchives") } - sign jar - sign javadocJar - sign sourcesJar + sign publishing.publications.mavenJava } artifacts { diff --git a/synapse-aws-kinesis/build.gradle b/synapse-aws-kinesis/build.gradle index 36fdc27a0..eb92fd48e 100644 --- a/synapse-aws-kinesis/build.gradle +++ b/synapse-aws-kinesis/build.gradle @@ -5,24 +5,24 @@ dependencies { api project(':synapse-aws-auth:') implementation "com.google.guava:guava:31.1-jre" - implementation "software.amazon.awssdk:kinesis:${awsSdkVersion}" - implementation "software.amazon.awssdk:netty-nio-client:${awsSdkVersion}" - implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:${jacksonVersion}" - implementation "org.springframework.retry:spring-retry:1.3.4" + implementation "software.amazon.awssdk:kinesis" + implementation "software.amazon.awssdk:netty-nio-client" + implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310" + implementation "org.springframework.retry:spring-retry" - testImplementation 'junit:junit:4.13.2' + testImplementation 'junit:junit' testImplementation 'org.hamcrest:hamcrest-all:1.3' - testImplementation "org.springframework.boot:spring-boot-starter-test:${springBootVersion}" - testImplementation "com.jayway.jsonpath:json-path-assert:2.7.0" + testImplementation "org.springframework.boot:spring-boot-starter-test" + testImplementation "com.jayway.jsonpath:json-path-assert" testImplementation 'com.tngtech.java:junit-dataprovider:1.13.1' - testImplementation "org.awaitility:awaitility:4.2.0" - testImplementation "org.mockito:mockito-core:5.1.1" - testImplementation "ch.qos.logback:logback-core:${logbackVersion}" - testImplementation "ch.qos.logback:logback-classic:${logbackVersion}" + testImplementation "org.awaitility:awaitility" + testImplementation "org.mockito:mockito-core" + testImplementation "ch.qos.logback:logback-core" + testImplementation "ch.qos.logback:logback-classic" } -apply plugin: 'maven' +apply plugin: 'maven-publish' apply plugin: 'signing' @@ -40,74 +40,91 @@ task sourcesJar(type: Jar) { classifier = 'sources' } -uploadArchives { - repositories { - mavenDeployer { - beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } - - repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { - authentication(userName: sonatypeUsername, password: sonatypePassword) - } - snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") { - authentication(userName: sonatypeUsername, password: sonatypePassword) +publishing { + publications { + mavenJava(MavenPublication) { + artifactId = 'synapse-aws-kinesis' + from components.java + versionMapping { + usage('java-api') { + fromResolutionOf('runtimeClasspath') + } + usage('java-runtime') { + fromResolutionResult() + } } - - pom.project { - name 'synapse-aws-kinesis' + pom { + name = 'synapse-aws-kinesis' packaging 'jar' - description 'Kinesis implementations for message logs in Synapse services.' - url 'http://github.com/otto-de/synapse' + description = 'Kinesis implementations for message logs in Synapse services.' + url = 'http://github.com/otto-de/synapse' scm { - url 'scm:git@github.com:otto-de/synapse.git' - connection 'scm:git@github.com:otto-de/synapse.git' - developerConnection 'scm:git@github.com:otto-de/synapse.git' + url = 'scm:git@github.com:otto-de/synapse.git' + connection = 'scm:git@github.com:otto-de/synapse.git' + developerConnection = 'scm:git@github.com:otto-de/synapse.git' } licenses { license { - name 'The Apache Software License, Version 2.0' - url 'http://www.apache.org/licenses/LICENSE-2.0.txt' - distribution 'repo' + name = "The Apache Software License, Version 2.0" + url = "http://www.apache.org/licenses/LICENSE-2.0.txt" + distribution = 'repo' } } - developers { developer { - id 'gsteinacker' - name 'Guido Steinacker' + id = 'gsteinacker' + name = 'Guido Steinacker' } developer { - id 'mbargmann' - name 'Matthias Bargmann' + id = 'mbargmann' + name = 'Matthias Bargmann' } developer { - id 'fbregulla' - name 'Frank Bregulla' + id = 'fbregulla' + name = 'Frank Bregulla' } developer { - id 'ftorkler' - name 'Florian Torkler' + id = 'ftorkler' + name = 'Florian Torkler' } developer { - id 'miregel' - name 'Micha Regel' + id = 'miregel' + name = 'Micha Regel' } developer { - id 'hstruebe' - name 'Henning Strueber' + id = 'hstruebe' + name = 'Henning Strueber' } } } } } + + repositories { + maven { + name = "Sonatype" + url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/") + credentials { + username = findProperty("sonatypeUsername") + password = findProperty("sonatypePassword") + } + } + maven { + name = "Sonatype_Snapshots" + url = uri("https://oss.sonatype.org/content/repositories/snapshots/") + credentials { + username = findProperty("sonatypeUsername") + password = findProperty("sonatypePassword") + } + } + } } + signing { - required { gradle.taskGraph.hasTask("uploadArchives") } - sign jar - sign javadocJar - sign sourcesJar + sign publishing.publications.mavenJava } artifacts { diff --git a/synapse-aws-kinesis/src/test/java/de/otto/synapse/endpoint/receiver/kinesis/KinesisMessageLogReaderTest.java b/synapse-aws-kinesis/src/test/java/de/otto/synapse/endpoint/receiver/kinesis/KinesisMessageLogReaderTest.java index ecdbf42d5..5bb7261c2 100644 --- a/synapse-aws-kinesis/src/test/java/de/otto/synapse/endpoint/receiver/kinesis/KinesisMessageLogReaderTest.java +++ b/synapse-aws-kinesis/src/test/java/de/otto/synapse/endpoint/receiver/kinesis/KinesisMessageLogReaderTest.java @@ -16,6 +16,7 @@ import software.amazon.awssdk.core.SdkBytes; import software.amazon.awssdk.services.kinesis.KinesisAsyncClient; import software.amazon.awssdk.services.kinesis.model.*; +import software.amazon.awssdk.services.kinesis.model.Record; import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; diff --git a/synapse-aws-kinesis/src/test/java/de/otto/synapse/endpoint/receiver/kinesis/KinesisShardIteratorTest.java b/synapse-aws-kinesis/src/test/java/de/otto/synapse/endpoint/receiver/kinesis/KinesisShardIteratorTest.java index 49c83579e..959d72b53 100644 --- a/synapse-aws-kinesis/src/test/java/de/otto/synapse/endpoint/receiver/kinesis/KinesisShardIteratorTest.java +++ b/synapse-aws-kinesis/src/test/java/de/otto/synapse/endpoint/receiver/kinesis/KinesisShardIteratorTest.java @@ -9,6 +9,7 @@ import org.mockito.stubbing.Answer; import software.amazon.awssdk.services.kinesis.KinesisAsyncClient; import software.amazon.awssdk.services.kinesis.model.*; +import software.amazon.awssdk.services.kinesis.model.Record; import java.time.Instant; import java.util.concurrent.CompletableFuture; diff --git a/synapse-aws-sqs/build.gradle b/synapse-aws-sqs/build.gradle index 32cf1fb6a..4b4f080e7 100644 --- a/synapse-aws-sqs/build.gradle +++ b/synapse-aws-sqs/build.gradle @@ -5,23 +5,23 @@ dependencies { api project(':synapse-aws-auth:') implementation "com.google.guava:guava:31.1-jre" - implementation "software.amazon.awssdk:sqs:${awsSdkVersion}" + implementation "software.amazon.awssdk:sqs" // Use JUnit test framework - testImplementation 'junit:junit:4.13.2' + testImplementation 'junit:junit' testImplementation 'org.hamcrest:hamcrest-all:1.3' - testImplementation "org.springframework.boot:spring-boot-starter-test:${springBootVersion}" - testImplementation "org.springframework.boot:spring-boot-starter-web:${springBootVersion}" - testImplementation "com.jayway.jsonpath:json-path-assert:2.7.0" + testImplementation "org.springframework.boot:spring-boot-starter-test" + testImplementation "org.springframework.boot:spring-boot-starter-web" + testImplementation "com.jayway.jsonpath:json-path-assert" testImplementation 'com.tngtech.java:junit-dataprovider:1.13.1' - testImplementation "org.awaitility:awaitility:4.2.0" - testImplementation "org.mockito:mockito-core:5.1.1" - testImplementation "ch.qos.logback:logback-core:${logbackVersion}" - testImplementation "ch.qos.logback:logback-classic:${logbackVersion}" + testImplementation "org.awaitility:awaitility" + testImplementation "org.mockito:mockito-core" + testImplementation "ch.qos.logback:logback-core" + testImplementation "ch.qos.logback:logback-classic" } -apply plugin: 'maven' +apply plugin: 'maven-publish' apply plugin: 'signing' jar { @@ -29,83 +29,101 @@ jar { } task javadocJar(type: Jar, dependsOn: javadoc) { - classifier = 'javadoc' + archiveClassifier = 'javadoc' from 'build/docs/javadoc' } task sourcesJar(type: Jar) { from sourceSets.main.allSource - classifier = 'sources' + archiveClassifier = 'sources' } -uploadArchives { - repositories { - mavenDeployer { - beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } - repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { - authentication(userName: sonatypeUsername, password: sonatypePassword) - } - snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") { - authentication(userName: sonatypeUsername, password: sonatypePassword) +publishing { + publications { + mavenJava(MavenPublication) { + artifactId = 'synapse-aws-sqs' + from components.java + versionMapping { + usage('java-api') { + fromResolutionOf('runtimeClasspath') + } + usage('java-runtime') { + fromResolutionResult() + } } - - pom.project { - name 'synapse-aws-sqs' + pom { + name = 'synapse-aws-sqs' packaging 'jar' - description 'SQS implementations for message queues in Synapse services.' - url 'http://github.com/otto-de/synapse' + description = 'SQS implementations for message queues in Synapse services.' + url = 'http://github.com/otto-de/synapse' scm { - url 'scm:git@github.com:otto-de/synapse.git' - connection 'scm:git@github.com:otto-de/synapse.git' - developerConnection 'scm:git@github.com:otto-de/synapse.git' + url = 'scm:git@github.com:otto-de/synapse.git' + connection = 'scm:git@github.com:otto-de/synapse.git' + developerConnection = 'scm:git@github.com:otto-de/synapse.git' } licenses { license { - name 'The Apache Software License, Version 2.0' - url 'http://www.apache.org/licenses/LICENSE-2.0.txt' - distribution 'repo' + name = "The Apache Software License, Version 2.0" + url = "http://www.apache.org/licenses/LICENSE-2.0.txt" + distribution = 'repo' } } - developers { developer { - id 'gsteinacker' - name 'Guido Steinacker' + id = 'gsteinacker' + name = 'Guido Steinacker' } developer { - id 'mbargmann' - name 'Matthias Bargmann' + id = 'mbargmann' + name = 'Matthias Bargmann' } developer { - id 'fbregulla' - name 'Frank Bregulla' + id = 'fbregulla' + name = 'Frank Bregulla' } developer { - id 'ftorkler' - name 'Florian Torkler' + id = 'ftorkler' + name = 'Florian Torkler' } developer { - id 'miregel' - name 'Micha Regel' + id = 'miregel' + name = 'Micha Regel' } developer { - id 'hstruebe' - name 'Henning Strueber' + id = 'hstruebe' + name = 'Henning Strueber' } } } } } + + repositories { + maven { + name = "Sonatype" + url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/") + credentials { + username = findProperty("sonatypeUsername") + password = findProperty("sonatypePassword") + } + } + maven { + name = "Sonatype_Snapshots" + url = uri("https://oss.sonatype.org/content/repositories/snapshots/") + credentials { + username = findProperty("sonatypeUsername") + password = findProperty("sonatypePassword") + } + } + } } + signing { - required { gradle.taskGraph.hasTask("uploadArchives") } - sign jar - sign javadocJar - sign sourcesJar + sign publishing.publications.mavenJava } artifacts { diff --git a/synapse-aws-sqs/src/test/java/de/otto/synapse/endpoint/receiver/sqs/SqsMessageQueueReceiverEndpointIntegrationTest.java b/synapse-aws-sqs/src/test/java/de/otto/synapse/endpoint/receiver/sqs/SqsMessageQueueReceiverEndpointIntegrationTest.java index 0394ff6dc..4d24a9550 100644 --- a/synapse-aws-sqs/src/test/java/de/otto/synapse/endpoint/receiver/sqs/SqsMessageQueueReceiverEndpointIntegrationTest.java +++ b/synapse-aws-sqs/src/test/java/de/otto/synapse/endpoint/receiver/sqs/SqsMessageQueueReceiverEndpointIntegrationTest.java @@ -7,6 +7,7 @@ import de.otto.synapse.configuration.sqs.SqsAutoConfiguration; import de.otto.synapse.endpoint.SqsClientHelper; import de.otto.synapse.endpoint.sender.MessageSenderEndpoint; +import jakarta.servlet.http.HttpServletRequest; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -33,7 +34,6 @@ import software.amazon.awssdk.services.sqs.model.ReceiveMessageRequest; import software.amazon.awssdk.services.sqs.model.ReceiveMessageResponse; -import javax.servlet.http.HttpServletRequest; import java.net.URI; import java.time.Duration; import java.time.LocalDateTime; diff --git a/synapse-compaction-aws-s3/build.gradle b/synapse-compaction-aws-s3/build.gradle index 6825134b7..c193b44ff 100644 --- a/synapse-compaction-aws-s3/build.gradle +++ b/synapse-compaction-aws-s3/build.gradle @@ -5,28 +5,28 @@ dependencies { api project(':synapse-aws-auth:') implementation "com.google.guava:guava:31.1-jre" - implementation "software.amazon.awssdk:s3:${awsSdkVersion}" - implementation "software.amazon.awssdk:netty-nio-client:${awsSdkVersion}" + implementation "software.amazon.awssdk:s3" + implementation "software.amazon.awssdk:netty-nio-client" - implementation "com.fasterxml.jackson.core:jackson-core:${jacksonVersion}" + implementation "com.fasterxml.jackson.core:jackson-core" - testImplementation "software.amazon.awssdk:kinesis:${awsSdkVersion}" + testImplementation "software.amazon.awssdk:kinesis" testImplementation project(':synapse-aws-kinesis') testImplementation project(':synapse-testsupport') - testImplementation 'junit:junit:4.13.2' + testImplementation 'junit:junit' testImplementation 'org.hamcrest:hamcrest-all:1.3' - testImplementation "org.springframework.boot:spring-boot-starter-test:${springBootVersion}" - testImplementation "com.jayway.jsonpath:json-path-assert:2.7.0" + testImplementation "org.springframework.boot:spring-boot-starter-test" + testImplementation "com.jayway.jsonpath:json-path-assert" testImplementation 'com.tngtech.java:junit-dataprovider:1.13.1' - testImplementation "org.awaitility:awaitility:4.2.0" - testImplementation "org.mockito:mockito-core:5.1.1" - testImplementation "ch.qos.logback:logback-core:${logbackVersion}" - testImplementation "ch.qos.logback:logback-classic:${logbackVersion}" + testImplementation "org.awaitility:awaitility" + testImplementation "org.mockito:mockito-core" + testImplementation "ch.qos.logback:logback-core" + testImplementation "ch.qos.logback:logback-classic" testImplementation "commons-io:commons-io:2.11.0" } -apply plugin: 'maven' +apply plugin: 'maven-publish' apply plugin: 'signing' jar { @@ -34,83 +34,100 @@ jar { } task javadocJar(type: Jar, dependsOn: javadoc) { - classifier = 'javadoc' + archiveClassifier = 'javadoc' from 'build/docs/javadoc' } task sourcesJar(type: Jar) { from sourceSets.main.allSource - classifier = 'sources' + archiveClassifier = 'sources' } -uploadArchives { - repositories { - mavenDeployer { - beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } - - repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { - authentication(userName: sonatypeUsername, password: sonatypePassword) - } - snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") { - authentication(userName: sonatypeUsername, password: sonatypePassword) +publishing { + publications { + mavenJava(MavenPublication) { + artifactId = 'synapse-compaction-aws-s3' + from components.java + versionMapping { + usage('java-api') { + fromResolutionOf('runtimeClasspath') + } + usage('java-runtime') { + fromResolutionResult() + } } - - pom.project { - name 'synapse-compaction-aws-s3' + pom { + name = 'synapse-compaction-aws-s3' packaging 'jar' - description 'S3 implementation of Synapse compaction.' - url 'http://github.com/otto-de/synapse' + description = 'S3 implementation of Synapse compaction.' + url = 'http://github.com/otto-de/synapse' scm { - url 'scm:git@github.com:otto-de/synapse.git' - connection 'scm:git@github.com:otto-de/synapse.git' - developerConnection 'scm:git@github.com:otto-de/synapse.git' + url = 'scm:git@github.com:otto-de/synapse.git' + connection = 'scm:git@github.com:otto-de/synapse.git' + developerConnection = 'scm:git@github.com:otto-de/synapse.git' } licenses { license { - name 'The Apache Software License, Version 2.0' - url 'http://www.apache.org/licenses/LICENSE-2.0.txt' - distribution 'repo' + name = "The Apache Software License, Version 2.0" + url = "http://www.apache.org/licenses/LICENSE-2.0.txt" + distribution = 'repo' } } - developers { developer { - id 'gsteinacker' - name 'Guido Steinacker' + id = 'gsteinacker' + name = 'Guido Steinacker' } developer { - id 'mbargmann' - name 'Matthias Bargmann' + id = 'mbargmann' + name = 'Matthias Bargmann' } developer { - id 'fbregulla' - name 'Frank Bregulla' + id = 'fbregulla' + name = 'Frank Bregulla' } developer { - id 'ftorkler' - name 'Florian Torkler' + id = 'ftorkler' + name = 'Florian Torkler' } developer { - id 'miregel' - name 'Micha Regel' + id = 'miregel' + name = 'Micha Regel' } developer { - id 'hstruebe' - name 'Henning Strueber' + id = 'hstruebe' + name = 'Henning Strueber' } } } } } + + repositories { + maven { + name = "Sonatype" + url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/") + credentials { + username = findProperty("sonatypeUsername") + password = findProperty("sonatypePassword") + } + } + maven { + name = "Sonatype_Snapshots" + url = uri("https://oss.sonatype.org/content/repositories/snapshots/") + credentials { + username = findProperty("sonatypeUsername") + password = findProperty("sonatypePassword") + } + } + } } + signing { - required { gradle.taskGraph.hasTask("uploadArchives") } - sign jar - sign javadocJar - sign sourcesJar + sign publishing.publications.mavenJava } artifacts { diff --git a/synapse-compaction-aws-s3/src/test/java/de/otto/synapse/configuration/aws/S3TestConfiguration.java b/synapse-compaction-aws-s3/src/test/java/de/otto/synapse/configuration/aws/S3TestConfiguration.java index 8c3ae3f0d..56e270d30 100644 --- a/synapse-compaction-aws-s3/src/test/java/de/otto/synapse/configuration/aws/S3TestConfiguration.java +++ b/synapse-compaction-aws-s3/src/test/java/de/otto/synapse/configuration/aws/S3TestConfiguration.java @@ -18,8 +18,12 @@ public class S3TestConfiguration { @Bean public S3Client localStackS3Client() throws URISyntaxException { - S3Client s3Client = S3Client.builder().endpointOverride(new URI("http://localhost:4566")).region(Region.US_EAST_1) - .credentialsProvider(StaticCredentialsProvider.create(AwsBasicCredentials.create("foobar", "foobar"))).build(); + S3Client s3Client = S3Client.builder() + .endpointOverride(new URI("http://localhost:4566")) + .region(Region.US_EAST_1) + .credentialsProvider(StaticCredentialsProvider.create(AwsBasicCredentials.create("foobar", "foobar"))) + .forcePathStyle(true) + .build(); //localS3Client.createBucket(CreateBucketRequest.builder().bucket(INTEGRATION_TEST_SNAPSHOT_BUCKET).build()); return s3Client; } diff --git a/synapse-compaction-aws-s3/src/test/java/de/otto/synapse/helper/s3/S3HelperIntegrationTest.java b/synapse-compaction-aws-s3/src/test/java/de/otto/synapse/helper/s3/S3HelperIntegrationTest.java index c04fa65d6..76a96665a 100644 --- a/synapse-compaction-aws-s3/src/test/java/de/otto/synapse/helper/s3/S3HelperIntegrationTest.java +++ b/synapse-compaction-aws-s3/src/test/java/de/otto/synapse/helper/s3/S3HelperIntegrationTest.java @@ -48,6 +48,7 @@ public void setUp() throws URISyntaxException, IOException { .endpointOverride(new URI("http://localhost:4566")) .overrideConfiguration(ClientOverrideConfiguration.builder().build()) .credentialsProvider(StaticCredentialsProvider.create(AwsBasicCredentials.create("foobar", "foobar"))) + .forcePathStyle(true) .region(Region.US_EAST_1).build(); s3Helper = new S3Helper(s3Client); s3Helper.createBucket(TESTBUCKET); diff --git a/synapse-core/build.gradle b/synapse-core/build.gradle index 812f69803..b4b682c07 100644 --- a/synapse-core/build.gradle +++ b/synapse-core/build.gradle @@ -1,24 +1,24 @@ apply plugin: 'java-library' dependencies { - // This dependency is exported to consumers, that is to say found on their compile classpath. api 'com.google.guava:guava:31.1-jre' - api "org.springframework.boot:spring-boot:${springBootVersion}" - api "org.springframework.boot:spring-boot-autoconfigure:${springBootVersion}" + api "org.springframework.boot:spring-boot" + api "org.springframework.boot:spring-boot-autoconfigure" + implementation(platform("net.openhft:chronicle-bom:2.24ea58")) implementation "javax.annotation:javax.annotation-api:1.3.2" // This dependency is used internally, and not exposed to consumers on their own compile classpath. - implementation "org.springframework:spring-context:${springVersion}" + implementation "org.springframework:spring-context" - implementation "org.springframework:spring-aop:${springVersion}" - implementation "org.aspectj:aspectjweaver:1.9.19" + implementation "org.springframework:spring-aop" + implementation "org.aspectj:aspectjweaver" - implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:${jacksonVersion}" - implementation "com.fasterxml.jackson.datatype:jackson-datatype-jdk8:${jacksonVersion}" + implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310" + implementation "com.fasterxml.jackson.datatype:jackson-datatype-jdk8" - implementation("net.openhft:chronicle-map:3.24ea2") { + implementation("net.openhft:chronicle-map") { exclude group: "com.intellij", module: "annotations" } @@ -30,18 +30,18 @@ dependencies { testImplementation project(':synapse-testsupport:') - testImplementation 'junit:junit:4.13.2' + testImplementation 'junit:junit' testImplementation 'org.hamcrest:hamcrest-all:1.3' - testImplementation "org.springframework.boot:spring-boot-starter-test:${springBootVersion}" - testImplementation "com.jayway.jsonpath:json-path-assert:2.7.0" + testImplementation "org.springframework.boot:spring-boot-starter-test" + testImplementation "com.jayway.jsonpath:json-path-assert" testImplementation 'com.tngtech.java:junit-dataprovider:1.13.1' - testImplementation "org.awaitility:awaitility:4.2.0" - testImplementation "org.mockito:mockito-core:5.1.1" - testImplementation "ch.qos.logback:logback-core:${logbackVersion}" - testImplementation "ch.qos.logback:logback-classic:${logbackVersion}" + testImplementation "org.awaitility:awaitility" + testImplementation "org.mockito:mockito-core" + testImplementation "ch.qos.logback:logback-core" + testImplementation "ch.qos.logback:logback-classic" } -apply plugin: 'maven' +apply plugin: 'maven-publish' apply plugin: 'signing' @@ -50,87 +50,112 @@ jar { } task javadocJar(type: Jar, dependsOn: javadoc) { - classifier = 'javadoc' + archiveClassifier = 'javadoc' from 'build/docs/javadoc' } task sourcesJar(type: Jar) { from sourceSets.main.allSource - classifier = 'sources' + archiveClassifier = 'sources' } -uploadArchives { - repositories { - mavenDeployer { - beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } +// these jvm args are required so that chronicle map works with java 17 (see https://chronicle.software/chronicle-support-java-17/) +tasks.named('test', Test) { + jvmArgs("--add-exports=java.base/jdk.internal.ref=ALL-UNNAMED", + "--add-exports=java.base/sun.nio.ch=ALL-UNNAMED", + "--add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED", + "--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED", + "--add-opens=jdk.compiler/com.sun.tools.javac=ALL-UNNAMED", + "--add-opens=java.base/java.lang=ALL-UNNAMED", + "--add-opens=java.base/java.lang.reflect=ALL-UNNAMED", + "--add-opens=java.base/java.io=ALL-UNNAMED", + "--add-opens=java.base/java.util=ALL-UNNAMED") +} - repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { - authentication(userName: sonatypeUsername, password: sonatypePassword) - } - snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") { - authentication(userName: sonatypeUsername, password: sonatypePassword) +publishing { + publications { + mavenJava(MavenPublication) { + artifactId = 'synapse-core' + from components.java + versionMapping { + usage('java-api') { + fromResolutionOf('runtimeClasspath') + } + usage('java-runtime') { + fromResolutionResult() + } } - - pom.project { - name 'synapse-core' + pom { + name = 'synapse-core' packaging 'jar' - description 'A library used at otto.de to implement Spring Boot based event-sourcing microservices.' - url 'http://github.com/otto-de/synapse' + description = 'A library used at otto.de to implement Spring Boot based event-sourcing microservices.' + url = 'http://github.com/otto-de/synapse' scm { - url 'scm:git@github.com:otto-de/synapse.git' - connection 'scm:git@github.com:otto-de/synapse.git' - developerConnection 'scm:git@github.com:otto-de/synapse.git' + url = 'scm:git@github.com:otto-de/synapse.git' + connection = 'scm:git@github.com:otto-de/synapse.git' + developerConnection = 'scm:git@github.com:otto-de/synapse.git' } licenses { license { - name 'The Apache Software License, Version 2.0' - url 'http://www.apache.org/licenses/LICENSE-2.0.txt' - distribution 'repo' + name = "The Apache Software License, Version 2.0" + url = "http://www.apache.org/licenses/LICENSE-2.0.txt" + distribution = 'repo' } } - developers { developer { - id 'gsteinacker' - name 'Guido Steinacker' + id = 'gsteinacker' + name = 'Guido Steinacker' } developer { - id 'mbargmann' - name 'Matthias Bargmann' + id = 'mbargmann' + name = 'Matthias Bargmann' } developer { - id 'fbregulla' - name 'Frank Bregulla' + id = 'fbregulla' + name = 'Frank Bregulla' } developer { - id 'ftorkler' - name 'Florian Torkler' + id = 'ftorkler' + name = 'Florian Torkler' } developer { - id 'miregel' - name 'Micha Regel' + id = 'miregel' + name = 'Micha Regel' } developer { - id 'hstruebe' - name 'Henning Strueber' - } - developer { - id 'sweiler' - name 'Simon Weiler' + id = 'hstruebe' + name = 'Henning Strueber' } } } } } + + repositories { + maven { + name = "Sonatype" + url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/") + credentials { + username = findProperty("sonatypeUsername") + password = findProperty("sonatypePassword") + } + } + maven { + name = "Sonatype_Snapshots" + url = uri("https://oss.sonatype.org/content/repositories/snapshots/") + credentials { + username = findProperty("sonatypeUsername") + password = findProperty("sonatypePassword") + } + } + } } signing { - required { gradle.taskGraph.hasTask("uploadArchives") } - sign jar - sign javadocJar - sign sourcesJar + sign publishing.publications.mavenJava } artifacts { diff --git a/synapse-core/src/main/java/de/otto/synapse/configuration/EventSourcingAutoConfiguration.java b/synapse-core/src/main/java/de/otto/synapse/configuration/EventSourcingAutoConfiguration.java index d18c390d6..455d990c5 100644 --- a/synapse-core/src/main/java/de/otto/synapse/configuration/EventSourcingAutoConfiguration.java +++ b/synapse-core/src/main/java/de/otto/synapse/configuration/EventSourcingAutoConfiguration.java @@ -24,7 +24,6 @@ @Configuration @Import(SynapseAutoConfiguration.class) -@EnableConfigurationProperties(SynapseProperties.class) public class EventSourcingAutoConfiguration { private static final Logger LOG = getLogger(EventSourcingAutoConfiguration.class); diff --git a/synapse-core/src/main/java/de/otto/synapse/configuration/MessageLogReceiverEndpointAutoConfiguration.java b/synapse-core/src/main/java/de/otto/synapse/configuration/MessageLogReceiverEndpointAutoConfiguration.java index d551ad976..872c422fc 100644 --- a/synapse-core/src/main/java/de/otto/synapse/configuration/MessageLogReceiverEndpointAutoConfiguration.java +++ b/synapse-core/src/main/java/de/otto/synapse/configuration/MessageLogReceiverEndpointAutoConfiguration.java @@ -1,27 +1,15 @@ package de.otto.synapse.configuration; import de.otto.synapse.annotation.MessageLogConsumerBeanPostProcessor; -import de.otto.synapse.endpoint.receiver.MessageLogConsumerContainer; -import de.otto.synapse.endpoint.receiver.MessageLogReceiverEndpoint; -import org.slf4j.Logger; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Role; -import java.util.List; - -import static org.slf4j.LoggerFactory.getLogger; import static org.springframework.beans.factory.config.BeanDefinition.ROLE_INFRASTRUCTURE; @Import(SynapseAutoConfiguration.class) -@EnableConfigurationProperties(SynapseProperties.class) public class MessageLogReceiverEndpointAutoConfiguration { - private static final Logger LOG = getLogger(MessageLogReceiverEndpointAutoConfiguration.class); - @Bean @Role(ROLE_INFRASTRUCTURE) public MessageLogConsumerBeanPostProcessor messageLogConsumerAnnotationBeanPostProcessor() { diff --git a/synapse-core/src/main/java/de/otto/synapse/configuration/MessageQueueReceiverEndpointAutoConfiguration.java b/synapse-core/src/main/java/de/otto/synapse/configuration/MessageQueueReceiverEndpointAutoConfiguration.java index 730c1b120..06955645b 100644 --- a/synapse-core/src/main/java/de/otto/synapse/configuration/MessageQueueReceiverEndpointAutoConfiguration.java +++ b/synapse-core/src/main/java/de/otto/synapse/configuration/MessageQueueReceiverEndpointAutoConfiguration.java @@ -3,25 +3,19 @@ import de.otto.synapse.annotation.MessageQueueConsumerBeanPostProcessor; import de.otto.synapse.endpoint.receiver.MessageQueueConsumerProcess; import de.otto.synapse.endpoint.receiver.MessageQueueReceiverEndpoint; -import org.slf4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Role; import java.util.List; -import static org.slf4j.LoggerFactory.getLogger; import static org.springframework.beans.factory.config.BeanDefinition.ROLE_INFRASTRUCTURE; @Import(SynapseAutoConfiguration.class) -@EnableConfigurationProperties(SynapseProperties.class) public class MessageQueueReceiverEndpointAutoConfiguration { - private static final Logger LOG = getLogger(MessageQueueReceiverEndpointAutoConfiguration.class); - @Autowired(required = false) private List messageQueueReceiverEndpoints; diff --git a/synapse-core/src/main/java/de/otto/synapse/configuration/SynapseAutoConfiguration.java b/synapse-core/src/main/java/de/otto/synapse/configuration/SynapseAutoConfiguration.java index 10a675bf8..e3a9979e7 100644 --- a/synapse-core/src/main/java/de/otto/synapse/configuration/SynapseAutoConfiguration.java +++ b/synapse-core/src/main/java/de/otto/synapse/configuration/SynapseAutoConfiguration.java @@ -8,8 +8,10 @@ import de.otto.synapse.journal.Journal; import de.otto.synapse.journal.JournalRegistry; import org.slf4j.Logger; +import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.Bean; @@ -26,7 +28,6 @@ import static org.springframework.core.Ordered.LOWEST_PRECEDENCE; @Configuration -@EnableConfigurationProperties(SynapseProperties.class) public class SynapseAutoConfiguration { private static final Logger LOG = getLogger(SynapseAutoConfiguration.class); @@ -39,6 +40,12 @@ public ObjectMapper objectMapper() { return currentObjectMapper(); } + @Bean + @ConfigurationProperties(prefix = "synapse") + public SynapseProperties synapseProperties(@Value("${spring.application.name:Synapse}") String defaultName) { + return new SynapseProperties(defaultName); + } + @Bean public MessageInterceptorRegistry messageInterceptorRegistry(final ApplicationContext applicationContext) { if (registry == null) { diff --git a/synapse-core/src/main/java/de/otto/synapse/configuration/SynapseProperties.java b/synapse-core/src/main/java/de/otto/synapse/configuration/SynapseProperties.java index 54fcea6a5..e0c0f5f78 100644 --- a/synapse-core/src/main/java/de/otto/synapse/configuration/SynapseProperties.java +++ b/synapse-core/src/main/java/de/otto/synapse/configuration/SynapseProperties.java @@ -1,15 +1,11 @@ package de.otto.synapse.configuration; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.context.properties.ConfigurationProperties; - -@ConfigurationProperties(prefix = "synapse") public class SynapseProperties { private final ConsumerProcess consumerProcess = new ConsumerProcess(); private final Sender sender; private final Receiver receiver; - public SynapseProperties(@Value("${spring.application.name:Synapse}") String defaultName) { + public SynapseProperties(String defaultName) { this.sender = new Sender(defaultName); this.receiver = new Receiver(); } diff --git a/synapse-core/src/test/java/de/otto/synapse/configuration/SynapsePropertiesTest.java b/synapse-core/src/test/java/de/otto/synapse/configuration/SynapsePropertiesTest.java index b181d74fb..9085b6a90 100644 --- a/synapse-core/src/test/java/de/otto/synapse/configuration/SynapsePropertiesTest.java +++ b/synapse-core/src/test/java/de/otto/synapse/configuration/SynapsePropertiesTest.java @@ -19,12 +19,12 @@ public void close() { } @Test - public void shoulResolveSenderNamePlaceHolder() { + public void shouldResolveSenderNamePlaceHolder() { - context.register(SynapseAutoConfiguration.class); TestPropertyValues.of( "spring.application.name=my service" ).applyTo(context); + context.register(SynapseAutoConfiguration.class); context.refresh(); assertThat(context.getBean(SynapseProperties.class).getSender().getName()).isEqualTo("my service"); diff --git a/synapse-edison/build.gradle b/synapse-edison/build.gradle index 29e8e37e3..1fd75b109 100644 --- a/synapse-edison/build.gradle +++ b/synapse-edison/build.gradle @@ -3,23 +3,23 @@ apply plugin: 'java-library' dependencies { api project(':synapse-core:') implementation "de.otto.edison:edison-core:${edisonVersion}" - implementation "org.springframework.boot:spring-boot-actuator:${springBootVersion}" - implementation "org.springframework:spring-context:${springVersion}" - implementation "software.amazon.awssdk:s3:${awsSdkVersion}" - implementation "software.amazon.awssdk:kinesis:${awsSdkVersion}" + implementation "org.springframework.boot:spring-boot-actuator" + implementation "org.springframework:spring-context" + implementation "software.amazon.awssdk:s3" + implementation "software.amazon.awssdk:kinesis" implementation "de.otto.edison:edison-hal:2.1.1" - implementation "io.micrometer:micrometer-core:1.10.4" + implementation "io.micrometer:micrometer-core" testImplementation project(':synapse-testsupport:') - testImplementation 'junit:junit:4.13.2' + testImplementation 'junit:junit' testImplementation 'org.hamcrest:hamcrest-all:1.3' testImplementation "de.otto.edison:edison-testsupport:${edisonVersion}" - testImplementation "org.mockito:mockito-core:5.1.1" - testImplementation "ch.qos.logback:logback-core:${logbackVersion}" - testImplementation "ch.qos.logback:logback-classic:${logbackVersion}" + testImplementation "org.mockito:mockito-core" + testImplementation "ch.qos.logback:logback-core" + testImplementation "ch.qos.logback:logback-classic" } -apply plugin: 'maven' +apply plugin: 'maven-publish' apply plugin: 'signing' jar { @@ -27,83 +27,99 @@ jar { } task javadocJar(type: Jar, dependsOn: javadoc) { - classifier = 'javadoc' + archiveClassifier = 'javadoc' from 'build/docs/javadoc' } task sourcesJar(type: Jar) { from sourceSets.main.allSource - classifier = 'sources' + archiveClassifier = 'sources' } -uploadArchives { - repositories { - mavenDeployer { - beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } - - repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { - authentication(userName: sonatypeUsername, password: sonatypePassword) - } - snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") { - authentication(userName: sonatypeUsername, password: sonatypePassword) +publishing { + publications { + mavenJava(MavenPublication) { + artifactId = 'synapse-edison' + from components.java + versionMapping { + usage('java-api') { + fromResolutionOf('runtimeClasspath') + } + usage('java-runtime') { + fromResolutionResult() + } } - - pom.project { - name 'synapse-edison' + pom { + name = 'synapse-edison' packaging 'jar' - description 'A library used at otto.de to integrate synapse-core with edison-microservice.' - url 'http://github.com/otto-de/synapse' + description = 'A library used at otto.de to integrate synapse-core with edison-microservice.' + url = 'http://github.com/otto-de/synapse' scm { - url 'scm:git@github.com:otto-de/synapse.git' - connection 'scm:git@github.com:otto-de/synapse.git' - developerConnection 'scm:git@github.com:otto-de/synapse.git' + url = 'scm:git@github.com:otto-de/synapse.git' + connection = 'scm:git@github.com:otto-de/synapse.git' + developerConnection = 'scm:git@github.com:otto-de/synapse.git' } licenses { license { - name 'The Apache Software License, Version 2.0' - url 'http://www.apache.org/licenses/LICENSE-2.0.txt' - distribution 'repo' + name = "The Apache Software License, Version 2.0" + url = "http://www.apache.org/licenses/LICENSE-2.0.txt" + distribution = 'repo' } } - developers { developer { - id 'gsteinacker' - name 'Guido Steinacker' + id = 'gsteinacker' + name = 'Guido Steinacker' } developer { - id 'mbargmann' - name 'Matthias Bargmann' + id = 'mbargmann' + name = 'Matthias Bargmann' } developer { - id 'fbregulla' - name 'Frank Bregulla' + id = 'fbregulla' + name = 'Frank Bregulla' } developer { - id 'ftorkler' - name 'Florian Torkler' + id = 'ftorkler' + name = 'Florian Torkler' } developer { - id 'miregel' - name 'Micha Regel' + id = 'miregel' + name = 'Micha Regel' } developer { - id 'hstruebe' - name 'Henning Strueber' + id = 'hstruebe' + name = 'Henning Strueber' } } } } } + + repositories { + maven { + name = "Sonatype" + url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/") + credentials { + username = findProperty("sonatypeUsername") + password = findProperty("sonatypePassword") + } + } + maven { + name = "Sonatype_Snapshots" + url = uri("https://oss.sonatype.org/content/repositories/snapshots/") + credentials { + username = findProperty("sonatypeUsername") + password = findProperty("sonatypePassword") + } + } + } } signing { - required { gradle.taskGraph.hasTask("uploadArchives") } - sign jar - sign javadocJar - sign sourcesJar + sign publishing.publications.mavenJava } artifacts { diff --git a/synapse-edison/src/main/java/de/otto/synapse/edison/state/StateRepositoryRestController.java b/synapse-edison/src/main/java/de/otto/synapse/edison/state/StateRepositoryRestController.java index 39cd4f17c..3329f3c1e 100644 --- a/synapse-edison/src/main/java/de/otto/synapse/edison/state/StateRepositoryRestController.java +++ b/synapse-edison/src/main/java/de/otto/synapse/edison/state/StateRepositoryRestController.java @@ -9,6 +9,7 @@ import de.otto.synapse.journal.Journal; import de.otto.synapse.journal.JournalRegistry; import de.otto.synapse.state.StateRepository; +import jakarta.servlet.http.HttpServletRequest; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; @@ -20,11 +21,9 @@ import org.springframework.web.server.ResponseStatusException; import org.springframework.web.util.UriComponentsBuilder; -import javax.servlet.http.HttpServletRequest; import java.util.List; import java.util.Set; import java.util.stream.Collectors; -import java.util.stream.Stream; import static com.damnhandy.uri.template.UriTemplate.fromTemplate; import static com.google.common.collect.Maps.uniqueIndex; diff --git a/synapse-examples/example-edison/build.gradle b/synapse-examples/example-edison/build.gradle index 0e6c187ff..32d5fd22f 100644 --- a/synapse-examples/example-edison/build.gradle +++ b/synapse-examples/example-edison/build.gradle @@ -1,45 +1,38 @@ apply plugin: 'java' apply plugin: 'application' -apply plugin: 'org.springframework.boot' - buildscript { repositories { mavenCentral() } - dependencies { - classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") - } } repositories { mavenCentral() } -ext['jackson.version'] = "${jacksonVersion}" - dependencies { - compile project(':synapse-core:') - compile project(':synapse-edison:') + implementation project(':synapse-core:') + implementation project(':synapse-edison:') - compile "de.otto.edison:edison-core:${edisonVersion}" - compile "software.amazon.awssdk:kinesis:${awsSdkVersion}" + implementation "de.otto.edison:edison-core:${edisonVersion}" + implementation "software.amazon.awssdk:kinesis" - compile("org.springframework.boot:spring-boot-starter-web:${springBootVersion}") { - exclude module: "spring-boot-starter-tomcat:${springBootVersion}" + implementation("org.springframework.boot:spring-boot-starter-web") { + exclude module: "spring-boot-starter-tomcat" } - compile("org.springframework.boot:spring-boot-starter-jetty:${springBootVersion}") + implementation("org.springframework.boot:spring-boot-starter-jetty") - compile "ch.qos.logback:logback-core:${logbackVersion}" - compile "ch.qos.logback:logback-classic:${logbackVersion}" + implementation "ch.qos.logback:logback-core" + implementation "ch.qos.logback:logback-classic" implementation project(':synapse-testsupport:') - testCompile 'junit:junit:4.13.2' - testImplementation "org.springframework.boot:spring-boot-test:${springBootVersion}" - testImplementation "org.springframework:spring-test:${springVersion}" - testImplementation "org.awaitility:awaitility:4.2.0" + testImplementation 'junit:junit' + testImplementation "org.springframework.boot:spring-boot-test" + testImplementation "org.springframework:spring-test" + testImplementation "org.awaitility:awaitility" } // Define the main class for the application diff --git a/synapse-examples/example-eventsource-consumer/build.gradle b/synapse-examples/example-eventsource-consumer/build.gradle index 2bb4e6bf6..af8d24baf 100644 --- a/synapse-examples/example-eventsource-consumer/build.gradle +++ b/synapse-examples/example-eventsource-consumer/build.gradle @@ -1,42 +1,49 @@ apply plugin: 'java' apply plugin: 'application' -apply plugin: 'org.springframework.boot' - buildscript { repositories { mavenCentral() } - dependencies { - classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") - } } repositories { mavenCentral() } -ext['jackson.version'] = "${jacksonVersion}" +tasks.named('test', Test) { + // these jvm args are required so that chronicle map works with java 17 (see https://chronicle.software/chronicle-support-java-17/) + jvmArgs("--add-exports=java.base/jdk.internal.ref=ALL-UNNAMED", + "--add-exports=java.base/sun.nio.ch=ALL-UNNAMED", + "--add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED", + "--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED", + "--add-opens=jdk.compiler/com.sun.tools.javac=ALL-UNNAMED", + "--add-opens=java.base/java.lang=ALL-UNNAMED", + "--add-opens=java.base/java.lang.reflect=ALL-UNNAMED", + "--add-opens=java.base/java.io=ALL-UNNAMED", + "--add-opens=java.base/java.util=ALL-UNNAMED") +} + dependencies { - compile project(':synapse-core:') - compile "software.amazon.awssdk:kinesis:${awsSdkVersion}" + implementation project(':synapse-core:') + implementation "software.amazon.awssdk:kinesis" - compile("org.springframework.boot:spring-boot-starter-web:${springBootVersion}") { - exclude module: "spring-boot-starter-tomcat:${springBootVersion}" + implementation("org.springframework.boot:spring-boot-starter-web") { + exclude module: "spring-boot-starter-tomcat" } - compile("org.springframework.boot:spring-boot-starter-jetty:${springBootVersion}") + implementation("org.springframework.boot:spring-boot-starter-jetty") - compile "ch.qos.logback:logback-core:${logbackVersion}" - compile "ch.qos.logback:logback-classic:${logbackVersion}" + implementation "ch.qos.logback:logback-core" + implementation "ch.qos.logback:logback-classic" implementation project(':synapse-testsupport:') - testCompile 'junit:junit:4.13.2' + testImplementation 'junit:junit' - testImplementation "org.springframework.boot:spring-boot-test:${springBootVersion}" - testImplementation "org.springframework:spring-test:${springVersion}" - testImplementation "org.awaitility:awaitility:4.2.0" + testImplementation "org.springframework.boot:spring-boot-test" + testImplementation "org.springframework:spring-test" + testImplementation "org.awaitility:awaitility" } // Define the main class for the application diff --git a/synapse-examples/example-eventsource-consumer/src/test/java/de/otto/synapse/example/consumer/ExampleConsumerTest.java b/synapse-examples/example-eventsource-consumer/src/test/java/de/otto/synapse/example/consumer/ExampleConsumerTest.java index 38f1ab5fa..6b1513ee0 100644 --- a/synapse-examples/example-eventsource-consumer/src/test/java/de/otto/synapse/example/consumer/ExampleConsumerTest.java +++ b/synapse-examples/example-eventsource-consumer/src/test/java/de/otto/synapse/example/consumer/ExampleConsumerTest.java @@ -22,7 +22,7 @@ public class ExampleConsumerTest { private StateRepository stateRepository; @Before - public void setUp() throws Exception { + public void setUp() { stateRepository = new ConcurrentMapStateRepository<>(""); exampleConsumer = new ExampleConsumer(stateRepository); } diff --git a/synapse-examples/example-messagequeue-consumer/build.gradle b/synapse-examples/example-messagequeue-consumer/build.gradle index 5f93c2e53..d14a4202e 100644 --- a/synapse-examples/example-messagequeue-consumer/build.gradle +++ b/synapse-examples/example-messagequeue-consumer/build.gradle @@ -1,43 +1,36 @@ apply plugin: 'java' apply plugin: 'application' -apply plugin: 'org.springframework.boot' - buildscript { repositories { mavenCentral() } - dependencies { - classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") - } } repositories { mavenCentral() } -ext['jackson.version'] = "${jacksonVersion}" - dependencies { - compile project(':synapse-core:') - compile "software.amazon.awssdk:sqs:${awsSdkVersion}" + implementation project(':synapse-core:') + implementation "software.amazon.awssdk:sqs" - compile("org.springframework.boot:spring-boot-starter-web:${springBootVersion}") { - exclude module: "spring-boot-starter-tomcat:${springBootVersion}" + implementation("org.springframework.boot:spring-boot-starter-web") { + exclude module: "spring-boot-starter-tomcat" } - compile("org.springframework.boot:spring-boot-starter-jetty:${springBootVersion}") + implementation("org.springframework.boot:spring-boot-starter-jetty") - compile "ch.qos.logback:logback-core:${logbackVersion}" - compile "ch.qos.logback:logback-classic:${logbackVersion}" + implementation "ch.qos.logback:logback-core" + implementation "ch.qos.logback:logback-classic" implementation project(':synapse-testsupport:') - testCompile 'junit:junit:4.13.2' + testImplementation 'junit:junit' - testImplementation "org.springframework.boot:spring-boot-test:${springBootVersion}" - testImplementation "org.springframework:spring-test:${springVersion}" - testImplementation "org.awaitility:awaitility:4.2.0" + testImplementation "org.springframework.boot:spring-boot-test" + testImplementation "org.springframework:spring-test" + testImplementation "org.awaitility:awaitility" } // Define the main class for the application diff --git a/synapse-examples/example-producer/build.gradle b/synapse-examples/example-producer/build.gradle index 218f09abb..68c88e9d7 100644 --- a/synapse-examples/example-producer/build.gradle +++ b/synapse-examples/example-producer/build.gradle @@ -1,43 +1,36 @@ apply plugin: 'java' apply plugin: 'application' -apply plugin: 'org.springframework.boot' - buildscript { repositories { mavenCentral() } - dependencies { - classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") - } } repositories { mavenCentral() } -ext['jackson.version'] = "${jacksonVersion}" - dependencies { implementation project(':synapse-core:') - implementation "software.amazon.awssdk:kinesis:${awsSdkVersion}" - implementation "org.springframework.security:spring-security-core:${springSecurityVersion}" - implementation("org.springframework.boot:spring-boot-starter-web:${springBootVersion}") { - exclude module: "spring-boot-starter-tomcat:${springBootVersion}" + implementation "software.amazon.awssdk:kinesis" + implementation "org.springframework.security:spring-security-core" + implementation("org.springframework.boot:spring-boot-starter-web") { + exclude module: "spring-boot-starter-tomcat" } - implementation("org.springframework.boot:spring-boot-starter-validation:${springBootVersion}") - implementation("org.springframework.boot:spring-boot-starter-jetty:${springBootVersion}") + implementation("org.springframework.boot:spring-boot-starter-validation") + implementation("org.springframework.boot:spring-boot-starter-jetty") - implementation "ch.qos.logback:logback-core:${logbackVersion}" - implementation "ch.qos.logback:logback-classic:${logbackVersion}" + implementation "ch.qos.logback:logback-core" + implementation "ch.qos.logback:logback-classic" implementation project(':synapse-testsupport:') - testImplementation 'junit:junit:4.13.2' - testImplementation "org.mockito:mockito-core:5.1.1" - testImplementation "org.springframework.boot:spring-boot-test:${springBootVersion}" - testImplementation "org.springframework:spring-test:${springVersion}" - testImplementation "org.awaitility:awaitility:4.2.0" + testImplementation 'junit:junit' + testImplementation "org.mockito:mockito-core" + testImplementation "org.springframework.boot:spring-boot-test" + testImplementation "org.springframework:spring-test" + testImplementation "org.awaitility:awaitility" } diff --git a/synapse-examples/example-producer/src/main/java/de/otto/synapse/example/producer/Server.java b/synapse-examples/example-producer/src/main/java/de/otto/synapse/example/producer/Server.java index 32eed5ce2..f9ec25e61 100644 --- a/synapse-examples/example-producer/src/main/java/de/otto/synapse/example/producer/Server.java +++ b/synapse-examples/example-producer/src/main/java/de/otto/synapse/example/producer/Server.java @@ -6,7 +6,6 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties; @SpringBootApplication(scanBasePackages = {"de.otto.synapse"}) -@EnableConfigurationProperties(SynapseProperties.class) public class Server { public static void main(String[] args) { SpringApplication.run(Server.class, args); diff --git a/synapse-examples/example-producer/src/main/java/de/otto/synapse/example/producer/payload/ProductPayload.java b/synapse-examples/example-producer/src/main/java/de/otto/synapse/example/producer/payload/ProductPayload.java index 7709e4bee..7b7bf910d 100644 --- a/synapse-examples/example-producer/src/main/java/de/otto/synapse/example/producer/payload/ProductPayload.java +++ b/synapse-examples/example-producer/src/main/java/de/otto/synapse/example/producer/payload/ProductPayload.java @@ -2,9 +2,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; -import javax.validation.Payload; +import jakarta.validation.Payload; -public class ProductPayload implements Payload{ +public class ProductPayload implements Payload { @JsonProperty private String id; @@ -28,7 +28,6 @@ public void setPrice(long price) { } - @Override public String toString() { return "ProductPayload{" + diff --git a/synapse-examples/example-producer/src/test/java/de/otto/synapse/example/producer/ExampleProducerIntegrationTest.java b/synapse-examples/example-producer/src/test/java/de/otto/synapse/example/producer/ExampleProducerIntegrationTest.java index ca39c6e43..4cac34a82 100644 --- a/synapse-examples/example-producer/src/test/java/de/otto/synapse/example/producer/ExampleProducerIntegrationTest.java +++ b/synapse-examples/example-producer/src/test/java/de/otto/synapse/example/producer/ExampleProducerIntegrationTest.java @@ -32,7 +32,7 @@ public class ExampleProducerIntegrationTest { TestConsumer testConsumer; @Test - public void shouldProduceEvent() throws Exception { + public void shouldProduceEvent() { // when producer.produceSampleData(); @@ -51,7 +51,7 @@ static class InMemoryTestConsumerConfiguration { @Component public static class TestConsumer { - private AtomicInteger count = new AtomicInteger(); + private final AtomicInteger count = new AtomicInteger(); @EventSourceConsumer( eventSource = "inMemorySource", diff --git a/synapse-redis/build.gradle b/synapse-redis/build.gradle index 5b62adb37..ff2063062 100644 --- a/synapse-redis/build.gradle +++ b/synapse-redis/build.gradle @@ -5,30 +5,30 @@ dependencies { // This dependency is exported to consumers, that is to say found on their compile classpath. api project(':synapse-core') - api "org.springframework.boot:spring-boot-starter-data-redis:${springBootVersion}" - api "org.springframework.boot:spring-boot-starter-web:${springBootVersion}" - api "org.springframework.boot:spring-boot-actuator-autoconfigure:${springBootVersion}" - api "org.redisson:redisson-spring-boot-starter:3.17.7" + api "org.springframework.boot:spring-boot-starter-data-redis" + api "org.springframework.boot:spring-boot-starter-web" + api "org.springframework.boot:spring-boot-actuator-autoconfigure" + api "org.redisson:redisson-spring-boot-starter:3.21.3" - implementation "org.springframework:spring-context:${springVersion}" - implementation "org.springframework:spring-aop:${springVersion}" + implementation "org.springframework:spring-context" + implementation "org.springframework:spring-aop" testImplementation project(':synapse-testsupport:') testImplementation 'com.github.kstyrc:embedded-redis:0.6' - testImplementation 'junit:junit:4.13.2' + testImplementation 'junit:junit' testImplementation 'org.hamcrest:hamcrest-all:1.3' - testImplementation "org.springframework.boot:spring-boot-starter-test:${springBootVersion}" - testImplementation "com.jayway.jsonpath:json-path-assert:2.7.0" + testImplementation "org.springframework.boot:spring-boot-starter-test" + testImplementation "com.jayway.jsonpath:json-path-assert" testImplementation 'com.tngtech.java:junit-dataprovider:1.13.1' - testImplementation "org.awaitility:awaitility:4.2.0" - testImplementation "org.mockito:mockito-core:5.1.1" - testImplementation "ch.qos.logback:logback-core:${logbackVersion}" - testImplementation "ch.qos.logback:logback-classic:${logbackVersion}" + testImplementation "org.awaitility:awaitility" + testImplementation "org.mockito:mockito-core" + testImplementation "ch.qos.logback:logback-core" + testImplementation "ch.qos.logback:logback-classic" } -apply plugin: 'maven' +apply plugin: 'maven-publish' apply plugin: 'signing' jar { @@ -36,87 +36,101 @@ jar { } task javadocJar(type: Jar, dependsOn: javadoc) { - classifier = 'javadoc' + archiveClassifier = 'javadoc' from 'build/docs/javadoc' } task sourcesJar(type: Jar) { from sourceSets.main.allSource - classifier = 'sources' + archiveClassifier = 'sources' } -uploadArchives { - repositories { - mavenDeployer { - beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } - repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { - authentication(userName: sonatypeUsername, password: sonatypePassword) - } - snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") { - authentication(userName: sonatypeUsername, password: sonatypePassword) +publishing { + publications { + mavenJava(MavenPublication) { + artifactId = 'synapse-redis' + from components.java + versionMapping { + usage('java-api') { + fromResolutionOf('runtimeClasspath') + } + usage('java-runtime') { + fromResolutionResult() + } } - - pom.project { - name 'synapse-redis' + pom { + name = 'synapse-redis' packaging 'jar' - description 'Support for Redis as a MessageStore.' - url 'http://github.com/otto-de/synapse' + description = 'Support for Redis as a MessageStore.' + url = 'http://github.com/otto-de/synapse' scm { - url 'scm:git@github.com:otto-de/synapse.git' - connection 'scm:git@github.com:otto-de/synapse.git' - developerConnection 'scm:git@github.com:otto-de/synapse.git' + url = 'scm:git@github.com:otto-de/synapse.git' + connection = 'scm:git@github.com:otto-de/synapse.git' + developerConnection = 'scm:git@github.com:otto-de/synapse.git' } licenses { license { - name 'The Apache Software License, Version 2.0' - url 'http://www.apache.org/licenses/LICENSE-2.0.txt' - distribution 'repo' + name = "The Apache Software License, Version 2.0" + url = "http://www.apache.org/licenses/LICENSE-2.0.txt" + distribution = 'repo' } } - developers { developer { - id 'gsteinacker' - name 'Guido Steinacker' - } - developer { - id 'mbargmann' - name 'Matthias Bargmann' + id = 'gsteinacker' + name = 'Guido Steinacker' } developer { - id 'fbregulla' - name 'Frank Bregulla' + id = 'mbargmann' + name = 'Matthias Bargmann' } developer { - id 'ftorkler' - name 'Florian Torkler' + id = 'fbregulla' + name = 'Frank Bregulla' } developer { - id 'miregel' - name 'Micha Regel' + id = 'ftorkler' + name = 'Florian Torkler' } developer { - id 'hstruebe' - name 'Henning Strueber' + id = 'miregel' + name = 'Micha Regel' } developer { - id 'sweiler' - name 'Simon Weiler' + id = 'hstruebe' + name = 'Henning Strueber' } } } } } + + repositories { + maven { + name = "Sonatype" + url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/") + credentials { + username = findProperty("sonatypeUsername") + password = findProperty("sonatypePassword") + } + } + maven { + name = "Sonatype_Snapshots" + url = uri("https://oss.sonatype.org/content/repositories/snapshots/") + credentials { + username = findProperty("sonatypeUsername") + password = findProperty("sonatypePassword") + } + } + } } + signing { - required { gradle.taskGraph.hasTask("uploadArchives") } - sign jar - sign javadocJar - sign sourcesJar + sign publishing.publications.mavenJava } artifacts { diff --git a/synapse-redis/src/test/java/de/otto/synapse/testsupport/redis/EmbeddedRedis.java b/synapse-redis/src/test/java/de/otto/synapse/testsupport/redis/EmbeddedRedis.java index 051ebe6f4..8e4d00ae9 100644 --- a/synapse-redis/src/test/java/de/otto/synapse/testsupport/redis/EmbeddedRedis.java +++ b/synapse-redis/src/test/java/de/otto/synapse/testsupport/redis/EmbeddedRedis.java @@ -5,8 +5,8 @@ import org.springframework.stereotype.Component; import redis.embedded.RedisServer; -import javax.annotation.PostConstruct; -import javax.annotation.PreDestroy; +import jakarta.annotation.PostConstruct; +import jakarta.annotation.PreDestroy; import java.io.IOException; import static org.slf4j.LoggerFactory.getLogger; diff --git a/synapse-testsupport/build.gradle b/synapse-testsupport/build.gradle index 9a402be9a..f9ed009e4 100644 --- a/synapse-testsupport/build.gradle +++ b/synapse-testsupport/build.gradle @@ -5,31 +5,32 @@ dependencies { implementation project(':synapse-core:') // This dependency is used internally, and not exposed to consumers on their own compile classpath. - implementation "org.springframework:spring-context:${springVersion}" + implementation "org.springframework:spring-context" - implementation "org.springframework:spring-aop:${springVersion}" - implementation "org.aspectj:aspectjweaver:1.9.19" + implementation "org.springframework:spring-aop" + implementation "org.aspectj:aspectjweaver" - implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:${jacksonVersion}" - implementation "com.fasterxml.jackson.datatype:jackson-datatype-jdk8:${jacksonVersion}" + implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310" + implementation "com.fasterxml.jackson.datatype:jackson-datatype-jdk8" - implementation("net.openhft:chronicle-map:3.24ea2") { + implementation(platform("net.openhft:chronicle-bom:2.24ea58")) + implementation("net.openhft:chronicle-map") { exclude group: "com.intellij", module: "annotations" } // Use JUnit test framework - testImplementation 'junit:junit:4.13.2' + testImplementation 'junit:junit' testImplementation 'org.hamcrest:hamcrest-all:1.3' - testImplementation "org.springframework.boot:spring-boot-starter-test:${springBootVersion}" - testImplementation "com.jayway.jsonpath:json-path-assert:2.7.0" + testImplementation "org.springframework.boot:spring-boot-starter-test" + testImplementation "com.jayway.jsonpath:json-path-assert" testImplementation 'com.tngtech.java:junit-dataprovider:1.13.1' - testImplementation "org.awaitility:awaitility:4.2.0" - testImplementation "org.mockito:mockito-core:5.1.1" - testImplementation "ch.qos.logback:logback-core:${logbackVersion}" - testImplementation "ch.qos.logback:logback-classic:${logbackVersion}" + testImplementation "org.awaitility:awaitility" + testImplementation "org.mockito:mockito-core" + testImplementation "ch.qos.logback:logback-core" + testImplementation "ch.qos.logback:logback-classic" } -apply plugin: 'maven' +apply plugin: 'maven-publish' apply plugin: 'signing' jar { @@ -37,87 +38,99 @@ jar { } task javadocJar(type: Jar, dependsOn: javadoc) { - classifier = 'javadoc' + archiveClassifier = 'javadoc' from 'build/docs/javadoc' } task sourcesJar(type: Jar) { from sourceSets.main.allSource - classifier = 'sources' + archiveClassifier = 'sources' } -uploadArchives { - repositories { - mavenDeployer { - beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } - - repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { - authentication(userName: sonatypeUsername, password: sonatypePassword) - } - snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") { - authentication(userName: sonatypeUsername, password: sonatypePassword) +publishing { + publications { + mavenJava(MavenPublication) { + artifactId = 'synapse-testsupport' + from components.java + versionMapping { + usage('java-api') { + fromResolutionOf('runtimeClasspath') + } + usage('java-runtime') { + fromResolutionResult() + } } - - pom.project { - name 'synapse-testsupport' + pom { + name = 'synapse-testsupport' packaging 'jar' - description 'A library used at otto.de to implement Spring Boot based event-sourcing microservices.' - url 'http://github.com/otto-de/synapse' + description = 'A library used at otto.de to implement Spring Boot based event-sourcing microservices.' + url = 'http://github.com/otto-de/synapse' scm { - url 'scm:git@github.com:otto-de/synapse.git' - connection 'scm:git@github.com:otto-de/synapse.git' - developerConnection 'scm:git@github.com:otto-de/synapse.git' + url = 'scm:git@github.com:otto-de/synapse.git' + connection = 'scm:git@github.com:otto-de/synapse.git' + developerConnection = 'scm:git@github.com:otto-de/synapse.git' } licenses { license { - name 'The Apache Software License, Version 2.0' - url 'http://www.apache.org/licenses/LICENSE-2.0.txt' - distribution 'repo' + name = "The Apache Software License, Version 2.0" + url = "http://www.apache.org/licenses/LICENSE-2.0.txt" + distribution = 'repo' } } - developers { developer { - id 'gsteinacker' - name 'Guido Steinacker' - } - developer { - id 'mbargmann' - name 'Matthias Bargmann' + id = 'gsteinacker' + name = 'Guido Steinacker' } developer { - id 'fbregulla' - name 'Frank Bregulla' + id = 'mbargmann' + name = 'Matthias Bargmann' } developer { - id 'ftorkler' - name 'Florian Torkler' + id = 'fbregulla' + name = 'Frank Bregulla' } developer { - id 'miregel' - name 'Micha Regel' + id = 'ftorkler' + name = 'Florian Torkler' } developer { - id 'hstruebe' - name 'Henning Strueber' + id = 'miregel' + name = 'Micha Regel' } developer { - id 'sweiler' - name 'Simon Weiler' + id = 'hstruebe' + name = 'Henning Strueber' } } } } } + + repositories { + maven { + name = "Sonatype" + url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/") + credentials { + username = findProperty("sonatypeUsername") + password = findProperty("sonatypePassword") + } + } + maven { + name = "Sonatype_Snapshots" + url = uri("https://oss.sonatype.org/content/repositories/snapshots/") + credentials { + username = findProperty("sonatypeUsername") + password = findProperty("sonatypePassword") + } + } + } } signing { - required { gradle.taskGraph.hasTask("uploadArchives") } - sign jar - sign javadocJar - sign sourcesJar + sign publishing.publications.mavenJava } artifacts {