Skip to content

Commit 007d999

Browse files
Merge pull request #183 from bitxon/feature/gradle
Switch from Apache Maven to Gradle Build Tool
2 parents 15bef11 + c516ecf commit 007d999

File tree

8 files changed

+467
-0
lines changed

8 files changed

+467
-0
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,7 @@ jobs:
3131
java-version: ${{ matrix.jdk }}
3232
distribution: 'temurin'
3333
cache: maven
34+
- name: Build with Gradle
35+
run: ./gradlew build
3436
- name: Build with Maven
3537
run: mvn -B package --file pom.xml

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
### Gradle ###
2+
.gradle/
3+
build/
4+
15
### Maven ###
26
target/
37

build.gradle.kts

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
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+
}

gradle/wrapper/gradle-wrapper.jar

59.3 KB
Binary file not shown.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#Sat Apr 05 15:01:27 CEST 2025
2+
distributionBase=GRADLE_USER_HOME
3+
distributionPath=wrapper/dists
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
5+
zipStoreBase=GRADLE_USER_HOME
6+
zipStorePath=wrapper/dists

gradlew

Lines changed: 234 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)