-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #44 from SolaceDev/stage-2.2.0
* Add `sol.use_transactions_for_topics` config option * Support transactions when `sol.dynamic_destination = true` * Support publishing to queues when `sol.dynamic_destination = true` * Add tasks to release the connector to Maven Central * Upgrade log4j to 2.16.0 in tests to fix CVE-2021-45046 risks
- Loading branch information
Showing
24 changed files
with
1,781 additions
and
257 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,23 @@ | ||
import com.github.spotbugs.snom.SpotBugsTask | ||
import io.github.gradlenexus.publishplugin.InitializeNexusStagingRepository | ||
|
||
plugins { | ||
id 'java' | ||
id 'distribution' | ||
id 'jacoco' | ||
id 'maven-publish' | ||
id 'pmd' | ||
id 'signing' | ||
id 'com.github.spotbugs' version '4.7.6' | ||
id 'io.github.gradle-nexus.publish-plugin' version '1.1.0' | ||
id 'org.gradle.test-retry' version '1.3.1' | ||
id 'org.unbroken-dome.test-sets' version '2.2.1' | ||
} | ||
|
||
ext { | ||
kafkaVersion = '2.8.1' | ||
solaceJavaAPIVersion = '10.12.0' | ||
solaceJavaAPIVersion = '10.12.1' | ||
isSnapshot = project.version.endsWith('-SNAPSHOT') | ||
} | ||
|
||
repositories { | ||
|
@@ -33,14 +39,15 @@ testSets { | |
|
||
dependencies { | ||
integrationTestImplementation 'org.junit.jupiter:junit-jupiter:5.8.1' | ||
integrationTestImplementation 'org.junit-pioneer:junit-pioneer:1.4.2' | ||
integrationTestImplementation 'org.junit-pioneer:junit-pioneer:1.5.0' | ||
integrationTestImplementation 'org.mockito:mockito-junit-jupiter:3.12.4' | ||
integrationTestImplementation 'org.testcontainers:testcontainers:1.16.0' | ||
integrationTestImplementation 'org.testcontainers:junit-jupiter:1.16.0' | ||
integrationTestImplementation 'org.testcontainers:kafka:1.16.0' | ||
integrationTestImplementation 'com.solace.test.integration:pubsubplus-junit-jupiter:0.5.0' | ||
integrationTestImplementation 'org.testcontainers:toxiproxy:1.16.0' | ||
integrationTestImplementation 'com.solace.test.integration:pubsubplus-junit-jupiter:0.7.1' | ||
integrationTestImplementation 'org.slf4j:slf4j-api:1.7.32' | ||
integrationTestImplementation 'org.apache.logging.log4j:log4j-slf4j-impl:2.14.1' | ||
integrationTestImplementation 'org.apache.logging.log4j:log4j-slf4j-impl:2.16.0' | ||
integrationTestImplementation 'org.apache.commons:commons-configuration2:2.6' | ||
integrationTestImplementation 'commons-beanutils:commons-beanutils:1.9.4' | ||
integrationTestImplementation 'com.google.code.gson:gson:2.3.1' | ||
|
@@ -50,7 +57,7 @@ dependencies { | |
testImplementation 'org.junit.jupiter:junit-jupiter:5.8.1' | ||
testImplementation 'org.mockito:mockito-junit-jupiter:3.12.4' | ||
testImplementation 'org.hamcrest:hamcrest-all:1.3' | ||
testImplementation 'org.apache.logging.log4j:log4j-slf4j-impl:2.14.1' | ||
testImplementation 'org.apache.logging.log4j:log4j-slf4j-impl:2.16.0' | ||
compile "org.apache.kafka:connect-api:$kafkaVersion" | ||
compile "com.solacesystems:sol-jcsmp:$solaceJavaAPIVersion" | ||
} | ||
|
@@ -96,6 +103,10 @@ project.integrationTest { | |
useJUnitPlatform() | ||
outputs.upToDateWhen { false } | ||
dependsOn prepDistForIntegrationTesting | ||
shouldRunAfter test | ||
retry { | ||
maxRetries = 3 | ||
} | ||
afterSuite { desc, result -> | ||
if (!desc.parent) | ||
println("${result.resultType} " + | ||
|
@@ -181,6 +192,11 @@ project.compileJava { | |
dependsOn generateJava | ||
} | ||
|
||
java { | ||
withJavadocJar() | ||
withSourcesJar() | ||
} | ||
|
||
distributions { | ||
main { | ||
contents { | ||
|
@@ -197,3 +213,89 @@ distributions { | |
} | ||
} | ||
} | ||
|
||
publishing { | ||
publications { | ||
maven(MavenPublication) { | ||
from components.java | ||
pom { | ||
name = "Solace PubSub+ Connector for Kafka: Sink" | ||
description = "The Solace/Kafka adapter consumes Kafka topic records and streams them to the PubSub+ Event Mesh as topic and/or queue data events." | ||
url = "https://github.com/SolaceProducts/pubsubplus-connector-kafka-sink" | ||
packaging = "jar" | ||
licenses { | ||
license { | ||
name = "Apache License, Version 2.0" | ||
url = "https://github.com/SolaceProducts/pubsubplus-connector-kafka-sink/blob/master/LICENSE" | ||
distribution = "repo" | ||
} | ||
} | ||
organization { | ||
name = "Solace" | ||
url = "https://www.solace.com" | ||
} | ||
developers { | ||
developer { | ||
name = "Support for Solace" | ||
email = "[email protected]" | ||
organization = "Solace" | ||
organizationUrl = "http://solace.community" | ||
} | ||
} | ||
scm { | ||
connection = "scm:git:git://github.com/SolaceProducts/pubsubplus-connector-kafka-sink.git" | ||
developerConnection = "scm:git:[email protected]:SolaceProducts/pubsubplus-connector-kafka-sink.git" | ||
url = "https://github.com/SolaceProducts/pubsubplus-connector-kafka-sink.git" | ||
} | ||
} | ||
} | ||
} | ||
repositories { | ||
maven { | ||
def releasesUrl = uri('http://apps-jenkins:9090/nexus/content/repositories/releases') | ||
def snapshotRepositoryUrl = uri('http://apps-jenkins:9090/nexus/content/repositories/snapshots') | ||
url = isSnapshot ? snapshotRepositoryUrl : releasesUrl | ||
name = 'internal' | ||
credentials { | ||
username = project.properties[name + "Username"] | ||
password = project.properties[name + "Password"] | ||
} | ||
} | ||
} | ||
} | ||
|
||
nexusPublishing { | ||
repositories { | ||
sonatype { | ||
nexusUrl = uri('https://oss.sonatype.org/service/local/') | ||
snapshotRepositoryUrl = uri('https://oss.sonatype.org/content/repositories/snapshots') | ||
// gets credentials from project.properties["sonatypeUsername"] project.properties["sonatypePassword"] | ||
} | ||
} | ||
} | ||
|
||
signing { | ||
required { | ||
!isSnapshot | ||
} | ||
useGpgCmd() | ||
sign publishing.publications.maven | ||
} | ||
|
||
tasks.withType(Sign) { | ||
onlyIf { | ||
gradle.taskGraph.allTasks.any {task -> | ||
task.name.startsWith("publish") && task.name.contains('Sonatype') | ||
} | ||
} | ||
shouldRunAfter test, integrationTest | ||
} | ||
|
||
tasks.withType(InitializeNexusStagingRepository).configureEach { | ||
dependsOn test, integrationTest | ||
shouldRunAfter tasks.withType(Sign) | ||
} | ||
|
||
tasks.withType(PublishToMavenRepository).configureEach { | ||
dependsOn test, integrationTest | ||
} |
Oops, something went wrong.