BOM stands for Bill Of Materials. Maven lets us define the versions of the dependencies or transitive dependencies in a separate POM. A BOM package is a POM only jar file that is used to control the versions of a project’s dependencies and provide a central place to define and update those versions. See Maven document about how BOM works.
DJL's BOM package provides a flexibility way for developers to add DJL dependencies to their project without worrying about each modules' version that we should depend on.
- First you need add BOM into your pom.xml file in section (notice that you will need to mention the type as pom and the scope as import) as the following:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>ai.djl</groupId>
<artifactId>bom</artifactId>
<version>0.26.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
- Then you import the desired DJL modules into to you pom.xml file (no version is needed):
<dependencyManagement>
<dependencies>
<dependency>
<groupId>ai.djl</groupId>
<artifactId>bom</artifactId>
<version>0.26.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>ai.djl</groupId>
<artifactId>api</artifactId>
</dependency>
<dependency>
<groupId>ai.djl.mxnet</groupId>
<artifactId>mxnet-engine</artifactId>
</dependency>
<dependency>
<groupId>ai.djl.mxnet</groupId>
<artifactId>mxnet-engine</artifactId>
</dependency>
</dependencies>
- First you need add BOM into your build.gradle file as the following:
implementation platform("ai.djl:bom:0.26.0")
- Then you import the desired DJL modules into to you pom.xml file (no version is needed):
implementation "ai.djl.pytorch:pytorch-model-zoo" // No version required