Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mention testcontainers-bom in "Maven dependencies" section of… #2178

Merged
merged 5 commits into from Dec 27, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
33 changes: 33 additions & 0 deletions docs/index.md
Expand Up @@ -43,6 +43,39 @@ testCompile "org.testcontainers:testcontainers:{{latest_version}}"
<scope>test</scope>
</dependency>
```
To avoid specifying the version of each dependency, you can use `BOM` or `Bill Of Materials`.
eaxdev marked this conversation as resolved.
Show resolved Hide resolved

Using `Maven` you must add the following to `dependencyManagement` section in your `pom.xml`:
eaxdev marked this conversation as resolved.
Show resolved Hide resolved

```xml tab='Maven'
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers-bom</artifactId>
<version>{{latest_version}}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
```
and then use dependencies without specifying a version:

```xml tab='Maven'
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>mysql</artifactId>
<scope>test</scope>
</dependency>
```

Using `Gradle` you must add the following to `dependencies` section in your `build.gradle`:
eaxdev marked this conversation as resolved.
Show resolved Hide resolved

```groovy tab='Gradle'
implementation platform('org.testcontainers:testcontainers-bom:{{latest_version}}') //import bom
testImplementation('org.testcontainers:mysql') //no version specified
```

You can also [check the latest version available on Maven Central](https://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.testcontainers%22).
eaxdev marked this conversation as resolved.
Show resolved Hide resolved

Expand Down