Skip to content
This repository was archived by the owner on Jul 12, 2023. It is now read-only.

Dependency Linkage

Chanyoung Park edited this page Apr 5, 2020 · 2 revisions

Link to your project

This page is for those developers who want to extend CraftGames with their project.
Follow these steps to hook CraftGames to your plugin, depending on what build tool you use: Maven or Gradle

1. Maven

Add repository and dependency to pom.xml in your project:

<repositories>
    <repository>
        <id>github</id>
        <name>CraftGames Package</name>
        <url>https://maven.pkg.github.com/LazoYoung/CraftGames</url>
        <releases><enabled>true</enabled></releases>
        <snapshots><enabled>true</enabled></snapshots>
    </repository>
</repositories>

<dependency>
    <groupId>com.github.lazoyoung</groupId>
    <artifactId>CraftGames</artifactId>
    <version>1.0-SNAPSHOT</version>
</dependency>

Now you need to make your Github personal access token. Learn how to make one.

Next, append the following in global Maven settings: USER_HOME\.m2\settings.xml

GITHUB_USERNAME and YOUR_ACCESS_TOKEN is your credential info.

<servers>
    <server>
        <id>github</id>
        <username>GITHUB_USERNAME</username>
        <password>YOUR_ACCESS_TOKEN</password>
    </server>
</servers>

That's basically it! Run maven install to install the package.

2. Gradle

Add repository and dependency to build.gradle in your project:

repositories {
    mavenLocal()
    maven {
        name "CraftGames Package"
        url "https://maven.pkg.github.com/LazoYoung/CraftGames"
        credentials {
            username = getProperty("github.username")
            password = getProperty("github.token")
        }
    }
}
dependencies {
    compileOnly "com.github.CraftGames:1.0-SNAPSHOT"
}

Now you need to make your Github personal access token. Learn how to make one.

Next, append the following in global Gradle settings: USER_HOME\.gradle\gradle.properties

GITHUB_USERNAME and YOUR_ACCESS_TOKEN is your credential info.

github.username=GITHUB_USERNAME
github.token=YOUR_ACCESS_TOKEN

That's basically it! Re-import your Gradle project to install the package.

Clone this wiki locally