-
-
Notifications
You must be signed in to change notification settings - Fork 268
Using the BOM
Discord4J v3 uses a BOM or Bill of Materials as a way to coordinate dependencies that work well together, therefore providing faster and safer ways to migrate across versions.
To check available versions make sure you go to the BOM repo and then replace 3.0.x
below with the adequate version.
Maven supports BOM through the dependencyManagement
entry. You should first add this snippet to your pom.xml file:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.discord4j</groupId>
<artifactId>bom</artifactId>
<version>3.x.x</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
Then you are able to add dependencies just like normal ones, but without specifying the <version>
attribute.
<dependencies>
<dependency>
<groupId>com.discord4j</groupId>
<artifactId>discord4j-core</artifactId>
</dependency>
<dependency>
<groupId>com.discord4j</groupId>
<artifactId>stores-caffeine</artifactId>
</dependency>
</dependencies>
Add the following to your build.gradle file to import the BOM, making sure replacing the version with the one you wish to use:
dependencies {
implementation platform("com.discord4j:bom:3.x.x")
}
And finally, add the dependency as normal, without needing to specify the version:
dependencies {
compile "com.discord4j:discord4j-core"
compile "com.discord4j:stores-caffeine"
}
You can also use SNAPSHOT and development builds from Jitpack with this BOM. You just have to also make sure you include the proper repository to pull the right dependencies:
<repositories>
<repository>
<id>snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<snapshots><enabled>true</enabled></snapshots>
</repository>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
repositories {
// This repository is for SNAPSHOTs
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
// This repository is for pulling dependencies from Jitpack
maven { url 'https://jitpack.io' }
// This repository is for releases
mavenCentral()
}
- Getting Started
- Lambda Tutorial
- Reactor (Reactive) Tutorial
- Music Bot Tutorial (v3.0+)
- Frequently Asked Questions
- Migrating from v2.x to v3.1
- Migrating from v3.0 to v3.1