djl

DJL - Bill of Materials (BOM)

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 Naven 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.

How to use DJL’s BOM

Use BOM in Maven

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>ai.djl</groupId>
            <artifactId>bom</artifactId>
            <version>0.9.0</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>
<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>ai.djl</groupId>
            <artifactId>bom</artifactId>
            <version>0.9.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>
    <dependency>
        <groupId>ai.djl.mxnet</groupId>
        <artifactId>mxnet-native-auto</artifactId>
        <scope>runtime</scope>
    </dependency>
</dependencies>

Use BOM in Gradle

    implementation platform("ai.djl:bom:0.9.0")
    implementation "ai.djl.pytorch:pytorch-model-zoo" // No version required
    implementation "ai.djl.pytorch:pytorch-native-auto"  // No version required