Skip to content

Configure project dependencies

Use this guide to add ClockTime as a project dependency to build plugins that integrate with ClockTime.

Preconditions

  • A Java/Kotlin development project using Gradle (Kotlin or Groovy DSL) or Maven.
  • The project configured to compile against Minecraft/Paper APIs.

Build Configuration

ClockTime releases are hosted on JitPack and Modrinth Maven. Add the repository and dependency coordinate to your project configuration.

repositories {
    mavenCentral()
    maven("https://jitpack.io")
}

dependencies {
    compileOnly("com.github.beduality:clock-time:v0.1.0") // Replace with latest version
}
repositories {
    mavenCentral()
    maven("https://api.modrinth.com/maven")
}

dependencies {
    compileOnly("maven.modrinth:clock-time:0.1.0") // Replace with latest version
}
repositories {
    mavenCentral()
    maven { url 'https://jitpack.io' }
}

dependencies {
    compileOnly 'com.github.beduality:clock-time:v0.1.0' // Replace with latest version
}
repositories {
    mavenCentral()
    maven { url 'https://api.modrinth.com/maven' }
}

dependencies {
    compileOnly 'maven.modrinth:clock-time:0.1.0' // Replace with latest version
}
<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>com.github.beduality</groupId>
        <artifactId>clock-time</artifactId>
        <version>v0.1.0</version> <!-- Replace with latest version -->
        <scope>provided</scope>
    </dependency>
</dependencies>
<repositories>
    <repository>
        <id>modrinth-repo</id>
        <url>https://api.modrinth.com/maven</url>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>maven.modrinth</groupId>
        <artifactId>clock-time</artifactId>
        <version>0.1.0</version> <!-- Replace with latest version -->
        <scope>provided</scope>
    </dependency>
</dependencies>

Plugin Dependency Configuration

To declare ClockTime as a dependency in your plugin description file (plugin.yml or paper-plugin.yml), add it under the depend or softdepend properties:

plugin.yml
name: MyPlugin
version: 1.0.0
main: com.example.MyPlugin
# Ensure ClockTime loads before your plugin
depend: [ClockTime]

Automate description files with Gradle

Instead of writing and maintaining plugin.yml manually, you can automate this using the net.minecrell.plugin-yml Gradle plugin:

build.gradle.kts
plugins {
    id("net.minecrell.plugin-yml.bukkit") version "0.6.0"
}

bukkit {
    main = "com.example.MyPlugin"
    // Declares dependencies dynamically
    depend = listOf("ClockTime")
}

Verification

To verify that ClockTime is correctly configured as a project dependency:

  1. Run your build tool compile task (e.g., ./gradlew build or mvn clean compile).
  2. Verify that the build succeeds without dependency resolution errors or compiler class-not-found errors.