Skip to main content

Adding Atomicoffe as a Dependency

If you are building a Fabric mod and want to depend on Atomicoffe (e.g. to interact with its Lua runtime or APIs at compile time), add it from the GitLab Maven registry.

Coordinates

PropertyValue
Group IDde.nexusrealms
Artifact IDatomicoffe
Version1.0-SNAPSHOT

Gradle (Groovy DSL)

Add the repository and dependency to your build.gradle:

repositories {
maven {
name = "NexusRealms GitLab"
url = uri("https://gitlab.nexusrealms.de/api/v4/projects/39/packages/maven")
// Only needed if the package is private:
// credentials(HttpHeaderCredentials) {
// name = "Private-Token"
// value = System.getenv("GITLAB_TOKEN")
// }
// authentication { header(HttpHeaderAuthentication) }
}
}

dependencies {
modImplementation "de.nexusrealms:atomicoffe:1.0-SNAPSHOT"
}

Gradle (Kotlin DSL)

repositories {
maven {
name = "NexusRealms GitLab"
url = uri("https://gitlab.nexusrealms.de/api/v4/projects/39/packages/maven")
}
}

dependencies {
modImplementation("de.nexusrealms:atomicoffe:1.0-SNAPSHOT")
}

Maven (pom.xml)

<repositories>
<repository>
<id>nexusrealms-gitlab</id>
<url>https://gitlab.nexusrealms.de/api/v4/projects/39/packages/maven</url>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>de.nexusrealms</groupId>
<artifactId>atomicoffe</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>

Private Registry Authentication

If the GitLab project is private, you need a Personal Access Token with read_api scope.

Gradle (Groovy DSL)

maven {
name = "NexusRealms GitLab"
url = uri("https://gitlab.nexusrealms.de/api/v4/projects/39/packages/maven")
credentials(HttpHeaderCredentials) {
name = "Private-Token"
value = System.getenv("GITLAB_TOKEN") // set in your environment or CI
}
authentication {
create("header", HttpHeaderAuthentication)
}
}

Maven (~/.m2/settings.xml)

<settings>
<servers>
<server>
<id>nexusrealms-gitlab</id>
<configuration>
<httpHeaders>
<property>
<name>Private-Token</name>
<value>${env.GITLAB_TOKEN}</value>
</property>
</httpHeaders>
</configuration>
</server>
</servers>
</settings>

GitLab CI

In a CI pipeline, use the built-in CI_JOB_TOKEN instead of a personal access token:

// build.gradle
maven {
name = "NexusRealms GitLab"
url = uri("https://gitlab.nexusrealms.de/api/v4/projects/39/packages/maven")
credentials(HttpHeaderCredentials) {
name = "Job-Token"
value = System.getenv("CI_JOB_TOKEN")
}
authentication {
create("header", HttpHeaderAuthentication)
}
}

Snapshot Versions

Atomicoffe currently publishes 1.0-SNAPSHOT. To always resolve the latest snapshot in Gradle, enable snapshot resolution:

configurations.all {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}

dependencies {
modImplementation("de.nexusrealms:atomicoffe:1.0-SNAPSHOT") {
changing = true
}
}