1+ plugins {
2+ `java- library`
3+ `maven- publish`
4+ signing
5+ }
6+
7+ description = " This Testcontainers module allows provisioning the WireMock server as a standalone container within your unit tests, based on WireMock Docker"
8+ group = " org.wiremock.integrations.testcontainers"
9+ version = " 1.0-alpha-12-SNAPSHOT"
10+
11+ java {
12+ sourceCompatibility = JavaVersion .VERSION_1_8
13+ targetCompatibility = JavaVersion .VERSION_1_8
14+ withSourcesJar()
15+ withJavadocJar()
16+ }
17+
18+ val testcontainersVersion = " 1.20.6"
19+ val junitVersion = " 5.12.1"
20+ val assertjVersion = " 3.26.3"
21+ val awaitilityVersion = " 4.2.2"
22+ var logbackClassicVersion = " 1.4.12"
23+
24+ repositories {
25+ mavenCentral()
26+ maven {
27+ name = " 9c-releases"
28+ url = uri(" https://raw.github.com/9cookies/mvn-repo/master/releases/" )
29+ }
30+ }
31+
32+ val testWiremockExtension by configurations.creating
33+
34+ dependencies {
35+ api(platform(" org.testcontainers:testcontainers-bom:$testcontainersVersion " ))
36+ api(" org.testcontainers:testcontainers" )
37+ compileOnly(" ch.qos.logback:logback-classic:${logbackClassicVersion} " )
38+
39+ testImplementation(platform(" org.junit:junit-bom:$junitVersion " ))
40+ testImplementation(" org.testcontainers:junit-jupiter" )
41+ testImplementation(" org.junit.jupiter:junit-jupiter-params" )
42+ testImplementation(" org.junit.jupiter:junit-jupiter-engine" )
43+ testImplementation(" org.junit.vintage:junit-vintage-engine" )
44+ testImplementation(" org.junit.platform:junit-platform-launcher" )
45+ testImplementation(" org.assertj:assertj-core:$assertjVersion " )
46+ testImplementation(" org.awaitility:awaitility:$awaitilityVersion " )
47+
48+ testWiremockExtension(" com.ninecookies.wiremock.extensions:wiremock-extensions:0.4.1:jar-with-dependencies@jar" )
49+ testWiremockExtension(" org.wiremock:wiremock-webhooks-extension:2.35.0" )
50+ }
51+
52+ tasks.test {
53+ useJUnitPlatform()
54+ }
55+
56+ tasks.register<Copy >(" copyTestWiremockExtensions" ) {
57+ from(testWiremockExtension.resolve())
58+ into(layout.projectDirectory.dir(" target" ).dir(" test-wiremock-extension" ))
59+ // into(layout.buildDirectory.dir("test-wiremock-extension")) // TODO use this after complete migration to Gradle
60+ }
61+
62+ tasks.named(" compileTestJava" ) {
63+ dependsOn(" copyTestWiremockExtensions" )
64+ }
65+
66+ publishing {
67+ publications {
68+ create<MavenPublication >(" mavenJava" ) {
69+ from(components[" java" ])
70+
71+ pom {
72+ name = " WireMock module for Testcontainers Java"
73+ description = project.description
74+ url = " https://github.com/wiremock/wiremock-testcontainers-java"
75+
76+ licenses {
77+ license {
78+ name = " Apache License Version 2.0"
79+ url = " https://www.apache.org/licenses/LICENSE-2.0"
80+ }
81+ }
82+
83+ developers {
84+ developer {
85+ id = " oleg-nenashev"
86+ name = " Oleg Nenashev"
87+ url = " https://github.com/oleg-nenashev/"
88+ organization = " WireMock Inc."
89+ organizationUrl = " https://www.wiremock.io/"
90+ }
91+ }
92+
93+ scm {
94+ connection = " scm:git:git://github.com/wiremock/wiremock-testcontainers-java.git"
95+ developerConnection = " scm:git:https://github.com/wiremock/wiremock-testcontainers-java.git"
96+ url = " https://github.com/wiremock/wiremock-testcontainers-java"
97+ }
98+ }
99+ }
100+ }
101+
102+ repositories {
103+ maven {
104+ name = " MavenCentral"
105+ url = uri(" https://oss.sonatype.org/service/local/staging/deploy/maven2/" )
106+
107+ credentials {
108+ username = project.findProperty(" ossrhUsername" ) as String? ? : System .getenv(" OSSRH_USERNAME" )
109+ password = project.findProperty(" ossrhPassword" ) as String? ? : System .getenv(" OSSRH_PASSWORD" )
110+ }
111+
112+ }
113+ maven {
114+ name = " GitHubPackages"
115+ url = uri(" https://maven.pkg.github.com/wiremock/wiremock-testcontainers-java" )
116+ credentials {
117+ username = project.findProperty(" githubUsername" ) as String? ? : System .getenv(" GITHUB_USERNAME" )
118+ password = project.findProperty(" githubToken" ) as String? ? : System .getenv(" GITHUB_TOKEN" )
119+ }
120+ }
121+ }
122+ }
123+
124+ signing {
125+ useInMemoryPgpKeys(
126+ project.findProperty(" signing.key" ) as String? ? : System .getenv(" OSSRH_GPG_SECRET_KEY" ),
127+ project.findProperty(" signing.password" ) as String? ? : System .getenv(" OSSRH_GPG_SECRET_KEY_PASSWORD" )
128+ )
129+ sign(publishing.publications[" mavenJava" ])
130+ }
0 commit comments