{{- $artifactId := .Get "artifactId"}} {{- $version := .Get "version" -}} {{- $dependencies := .Get "dependencies" -}} {{- $snapshot := in $version "SNAPSHOT" -}} {{- if $snapshot -}} {{- $ossUrl := "https://oss.sonatype.org/content/repositories/snapshots" -}}

<dependencies>
    <dependency>
        <groupId>org.mongodb</groupId>
        <artifactId>{{$artifactId}}</artifactId>
        <version>{{$version}}</version>
    </dependency>
</dependencies>
<repositories>
    <repository>
        <id>sonatype-snapshots</id>
        <name>Sontatype Snapshots</name>
        <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
    </repository>
</repositories>

Note: You can also download the jars directly from sonatype.

{{- with $dependencies -}}

{{$artifactId}} requires the following dependencies: bson and mongodb-driver-core

{{- end -}}
{{- else -}} {{- $ossUrl := "https://oss.sonatype.org/content/repositories/releases" -}}

<dependencies>
    <dependency>
        <groupId>org.mongodb</groupId>
        <artifactId>{{$artifactId}}</artifactId>
        <version>{{$version}}</version>
    </dependency>
</dependencies>

Note: You can also download the {{$artifactId}} jar directly from sonatype.

{{- with $dependencies -}}

If downloading {{$artifactId}} manually, you must also download its dependencies: bson and mongodb-driver-core

{{- end -}}
{{- end -}}