or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

Files

docs

index.md

index.mddocs/

0

# Testcontainers BOM

1

2

Testcontainers BOM (Bill of Materials) provides centralized dependency management for the entire Testcontainers ecosystem in Java projects. It ensures consistent versions across all Testcontainers modules, eliminating version conflicts and simplifying dependency management in complex testing scenarios.

3

4

## Package Information

5

6

- **Package Name**: org.testcontainers:testcontainers-bom

7

- **Package Type**: maven

8

- **Language**: Java (Build Management)

9

- **Installation**: Import as BOM in Maven or Gradle

10

- **Version**: 1.21.3

11

12

## Core Imports

13

14

### Maven

15

16

```xml

17

<dependencyManagement>

18

<dependencies>

19

<dependency>

20

<groupId>org.testcontainers</groupId>

21

<artifactId>testcontainers-bom</artifactId>

22

<version>1.21.3</version>

23

<type>pom</type>

24

<scope>import</scope>

25

</dependency>

26

</dependencies>

27

</dependencyManagement>

28

```

29

30

### Gradle

31

32

```gradle

33

dependencies {

34

implementation platform('org.testcontainers:testcontainers-bom:1.21.3')

35

}

36

```

37

38

## Basic Usage

39

40

```xml

41

<!-- After importing BOM in dependencyManagement -->

42

<dependencies>

43

<!-- No version needed - managed by BOM -->

44

<dependency>

45

<groupId>org.testcontainers</groupId>

46

<artifactId>junit-jupiter</artifactId>

47

<scope>test</scope>

48

</dependency>

49

<dependency>

50

<groupId>org.testcontainers</groupId>

51

<artifactId>postgresql</artifactId>

52

<scope>test</scope>

53

</dependency>

54

<dependency>

55

<groupId>org.testcontainers</groupId>

56

<artifactId>kafka</artifactId>

57

<scope>test</scope>

58

</dependency>

59

</dependencies>

60

```

61

62

```gradle

63

// After importing platform

64

dependencies {

65

testImplementation 'org.testcontainers:junit-jupiter'

66

testImplementation 'org.testcontainers:postgresql'

67

testImplementation 'org.testcontainers:kafka'

68

}

69

```

70

71

## Architecture

72

73

The Testcontainers BOM operates as a Maven/Gradle dependency management artifact that:

74

75

- **Version Centralization**: Maintains consistent versions for 66 Testcontainers modules

76

- **Conflict Resolution**: Prevents version mismatches between different Testcontainers components

77

- **Dynamic Generation**: Build process automatically includes all published Testcontainers modules

78

- **Zero-Code Artifact**: Contains no executable code, only dependency metadata

79

80

## Capabilities

81

82

### Maven Dependency Management

83

84

Provides Maven `<dependencyManagement>` integration for centralized version control.

85

86

```xml { .api }

87

<!-- BOM Import Pattern -->

88

<dependencyManagement>

89

<dependencies>

90

<dependency>

91

<groupId>org.testcontainers</groupId>

92

<artifactId>testcontainers-bom</artifactId>

93

<version>1.21.3</version>

94

<type>pom</type>

95

<scope>import</scope>

96

</dependency>

97

</dependencies>

98

</dependencyManagement>

99

100

<!-- Usage Pattern (version managed by BOM) -->

101

<dependency>

102

<groupId>org.testcontainers</groupId>

103

<artifactId>MODULE_NAME</artifactId>

104

<scope>test</scope>

105

</dependency>

106

```

107

108

### Gradle Platform Integration

109

110

Supports Gradle's platform mechanism for dependency management.

111

112

```gradle { .api }

113

// Platform Import Pattern

114

dependencies {

115

implementation platform('org.testcontainers:testcontainers-bom:1.21.3')

116

}

117

118

// Usage Pattern (version managed by platform)

119

dependencies {

120

testImplementation 'org.testcontainers:MODULE_NAME'

121

}

122

```

123

124

### Version Management

125

126

Manages versions for the complete Testcontainers module ecosystem.

127

128

#### Core Modules

129

```xml { .api }

130

<!-- Core Testcontainers functionality -->

131

<artifactId>testcontainers</artifactId>

132

<artifactId>junit-jupiter</artifactId>

133

```

134

135

#### Database Modules

136

```xml { .api }

137

<!-- Relational Databases -->

138

<artifactId>postgresql</artifactId>

139

<artifactId>mysql</artifactId>

140

<artifactId>mariadb</artifactId>

141

<artifactId>mssqlserver</artifactId>

142

<artifactId>oracle-xe</artifactId>

143

<artifactId>oracle-free</artifactId>

144

<artifactId>db2</artifactId>

145

146

<!-- NoSQL Databases -->

147

<artifactId>mongodb</artifactId>

148

<artifactId>cassandra</artifactId>

149

<artifactId>neo4j</artifactId>

150

<artifactId>couchbase</artifactId>

151

<artifactId>orientdb</artifactId>

152

153

<!-- Time Series and Analytics -->

154

<artifactId>influxdb</artifactId>

155

<artifactId>clickhouse</artifactId>

156

<artifactId>questdb</artifactId>

157

<artifactId>timeplus</artifactId>

158

159

<!-- Distributed Databases -->

160

<artifactId>cockroachdb</artifactId>

161

<artifactId>cratedb</artifactId>

162

<artifactId>scylladb</artifactId>

163

<artifactId>tidb</artifactId>

164

<artifactId>yugabytedb</artifactId>

165

<artifactId>oceanbase</artifactId>

166

<artifactId>databend</artifactId>

167

```

168

169

#### Message Queue Modules

170

```xml { .api }

171

<!-- Message Brokers -->

172

<artifactId>kafka</artifactId>

173

<artifactId>rabbitmq</artifactId>

174

<artifactId>pulsar</artifactId>

175

<artifactId>redpanda</artifactId>

176

<artifactId>activemq</artifactId>

177

<artifactId>hivemq</artifactId>

178

<artifactId>solace</artifactId>

179

```

180

181

#### Search and Analytics Modules

182

```xml { .api }

183

<!-- Search Engines -->

184

<artifactId>elasticsearch</artifactId>

185

<artifactId>solr</artifactId>

186

<artifactId>typesense</artifactId>

187

```

188

189

#### Cloud and Infrastructure Modules

190

```xml { .api }

191

<!-- Cloud Services -->

192

<artifactId>localstack</artifactId>

193

<artifactId>azure</artifactId>

194

<artifactId>gcloud</artifactId>

195

196

<!-- Infrastructure Services -->

197

<artifactId>vault</artifactId>

198

<artifactId>consul</artifactId>

199

<artifactId>nginx</artifactId>

200

<artifactId>grafana</artifactId>

201

```

202

203

#### Vector Databases and AI Modules

204

```xml { .api }

205

<!-- Vector Databases -->

206

<artifactId>chromadb</artifactId>

207

<artifactId>milvus</artifactId>

208

<artifactId>pinecone</artifactId>

209

<artifactId>qdrant</artifactId>

210

<artifactId>weaviate</artifactId>

211

212

<!-- AI Services -->

213

<artifactId>ollama</artifactId>

214

<artifactId>openfga</artifactId>

215

```

216

217

#### Testing and Development Modules

218

```xml { .api }

219

<!-- Browser Testing -->

220

<artifactId>selenium</artifactId>

221

222

<!-- Testing Utilities -->

223

<artifactId>mockserver</artifactId>

224

<artifactId>toxiproxy</artifactId>

225

<artifactId>k6</artifactId>

226

227

<!-- Framework Integrations -->

228

<artifactId>spock</artifactId>

229

<artifactId>jdbc</artifactId>

230

<artifactId>r2dbc</artifactId>

231

<artifactId>database-commons</artifactId>

232

```

233

234

#### Container Orchestration Modules

235

```xml { .api }

236

<!-- Kubernetes -->

237

<artifactId>k3s</artifactId>

238

```

239

240

#### Storage Modules

241

```xml { .api }

242

<!-- Object Storage -->

243

<artifactId>minio</artifactId>

244

245

<!-- Other Storage -->

246

<artifactId>dynalite</artifactId>

247

```

248

249

#### Directory and Authentication Modules

250

```xml { .api }

251

<!-- Authentication -->

252

<artifactId>ldap</artifactId>

253

```

254

255

#### SQL Engine Modules

256

```xml { .api }

257

<!-- SQL Engines -->

258

<artifactId>presto</artifactId>

259

<artifactId>trino</artifactId>

260

```

261

262

### Conflict Resolution

263

264

Ensures version consistency across multiple Testcontainers dependencies.

265

266

```xml { .api }

267

<!-- Example: Multiple modules use consistent versions -->

268

<dependencies>

269

<!-- All will use version 1.21.3 managed by BOM -->

270

<dependency>

271

<groupId>org.testcontainers</groupId>

272

<artifactId>testcontainers</artifactId>

273

<scope>test</scope>

274

</dependency>

275

<dependency>

276

<groupId>org.testcontainers</groupId>

277

<artifactId>postgresql</artifactId>

278

<scope>test</scope>

279

</dependency>

280

<dependency>

281

<groupId>org.testcontainers</groupId>

282

<artifactId>kafka</artifactId>

283

<scope>test</scope>

284

</dependency>

285

<dependency>

286

<groupId>org.testcontainers</groupId>

287

<artifactId>selenium</artifactId>

288

<scope>test</scope>

289

</dependency>

290

</dependencies>

291

```

292

293

## Usage Patterns

294

295

### Integration Test Setup

296

297

```xml

298

<!-- pom.xml -->

299

<dependencyManagement>

300

<dependencies>

301

<dependency>

302

<groupId>org.testcontainers</groupId>

303

<artifactId>testcontainers-bom</artifactId>

304

<version>1.21.3</version>

305

<type>pom</type>

306

<scope>import</scope>

307

</dependency>

308

</dependencies>

309

</dependencyManagement>

310

311

<dependencies>

312

<dependency>

313

<groupId>org.testcontainers</groupId>

314

<artifactId>junit-jupiter</artifactId>

315

<scope>test</scope>

316

</dependency>

317

<dependency>

318

<groupId>org.testcontainers</groupId>

319

<artifactId>postgresql</artifactId>

320

<scope>test</scope>

321

</dependency>

322

</dependencies>

323

```

324

325

### Multi-Module Project

326

327

```xml

328

<!-- Parent pom.xml -->

329

<dependencyManagement>

330

<dependencies>

331

<dependency>

332

<groupId>org.testcontainers</groupId>

333

<artifactId>testcontainers-bom</artifactId>

334

<version>1.21.3</version>

335

<type>pom</type>

336

<scope>import</scope>

337

</dependency>

338

</dependencies>

339

</dependencyManagement>

340

341

<!-- Module A pom.xml -->

342

<dependencies>

343

<dependency>

344

<groupId>org.testcontainers</groupId>

345

<artifactId>mysql</artifactId>

346

<scope>test</scope>

347

</dependency>

348

</dependencies>

349

350

<!-- Module B pom.xml -->

351

<dependencies>

352

<dependency>

353

<groupId>org.testcontainers</groupId>

354

<artifactId>kafka</artifactId>

355

<scope>test</scope>

356

</dependency>

357

</dependencies>

358

```

359

360

### Gradle Multi-Project

361

362

```gradle

363

// build.gradle (root)

364

subprojects {

365

dependencies {

366

implementation platform('org.testcontainers:testcontainers-bom:1.21.3')

367

}

368

}

369

370

// Module specific build.gradle files

371

dependencies {

372

testImplementation 'org.testcontainers:junit-jupiter'

373

testImplementation 'org.testcontainers:postgresql'

374

testImplementation 'org.testcontainers:kafka'

375

}

376

```