Skip to content

Installation Instructions

Mtabe edited this page Jul 16, 2024 · 1 revision

For Gradle

You need to generate a github token, read more here, after getting your github token, create a github.properties file in the root of your project (don't forget to .gitignore this file), the file content should look like this

gpr.usr=useaname
gpr.key=ghp_pTheRestofyourtoken

Then add the following to your gradle.build file

def githubProperties = new Properties()
if (rootProject.file("github.properties").exists()) {
    githubProperties.load(new FileInputStream(rootProject.file("github.properties")))
}

repositories {
    mavenCentral()
    maven {
     url = uri("https://maven.pkg.github.com/zechtz/gepg-java")
     credentials {
        username = githubProperties['gpr.usr'] ?: System.getenv("GITHUB_ACTOR")
        password = githubProperties['gpr.key'] ?: System.getenv("GITHUB_TOKEN")
    }
  }
}

dependencies {
    implementation 'com.watabelabs:gepg:1.0-SNAPSHOT'
}

For maven

Step 1: Configure settings.xml

Edit the settings.xml file (usually located in ~/.m2/settings.xml) create one it it doesn't exist

Step 2: Add this in your settings.xml

<settings>
    <servers>
        <server>
            <id>github</id>
            <username>username</username>
            <password>ghp_pTheRestofyourtoken</password>
        </server>
    </servers>
</settings>

Step 3: Add this to your pom.xml

<repositories>
    <repository>
        <id>github</id>
        <url>https://maven.pkg.github.com/zechtz/gepg-java</url>
    </repository>
</repositories>

<dependency>
    <groupId>com.watabelabs</groupId>
    <artifactId>gepg</artifactId>
    <version>1.0-SNAPSHOT</version>
</dependency>

Clone this wiki locally