The public maven repository that contains libraries that's made under fan87.
⚠️ Only people has "write package" accecss to this repository and wants to deploy have to do this
- Add this into your
~/.m2/settings.xml
:
<server>
<id>github</id>
<username>GITHUB_USERNAME</username>
<password>GITHUB_ACCESS_TOKEN</password>
</server>
Don't forget to replace GITHUB_USERNAME
to your user name, and GITHUB_ACCESS_TOKEN
to an access token that has permission to read/write packages.
- Add this to your pom.xml
<repositories>
<repository>
<id>github</id>
<name>fan87's Public Maven Repository</name>
<url>https://maven.pkg.github.com/fan87/Public-Maven-Repository</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
<releases>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</releases>
</repository>
</repositories>
- Now you can start adding dependencies!
⚠️ Only people has "write package" accecss to this repository can do it
- Add this to your pom.xml
<distributionManagement>
<repository>
<id>github</id>
<name>fan87's Public Maven Repository</name>
<url>https://maven.pkg.github.com/fan87/Public-Maven-Repository</url>
</repository>
</distributionManagement>
- Now run
deploy
task. (For example:mvn clean package install deploy
)
⚠️ Only people has "write package" accecss to this repository and wants to deploy have to do this
- Add
GITHUB_USERNAME
andGITHUB_PASSWORD
to your environment variable. The value will be your username and access token, not your GitHub password!
- Add this to your build.gradle.kts
repositories {
mavenCentral() // Optional
fan87PUblic()
}
fun RepositoryHandler.fan87Public() {
maven {
name = "fan87-private"
url = URI("https://maven.pkg.github.com/fan87/Public-Maven-Repository")
credentials {
username = System.getenv("GITHUB_USERNAME")
password = System.getenv("GITHUB_PASSWORD")
}
}
}
If you are using any plugin, add this to settings.gradle.kts
pluginManagement {
repositories {
mavenLocal()
gradlePluginPortal()
maven {
name = "fan87-public"
url = URI("https://maven.pkg.github.com/fan87/Public-Maven-Repository")
credentials {
username = System.getenv("GITHUB_USERNAME")
password = System.getenv("GITHUB_PASSWORD")
}
}
}
}
⚠️ Only people has "write package" accecss to this repository can do it
- Add this to your build.gradle.kts:
plugins {
`maven-publish`
}
publishing {
repositories {
fan87Public()
mavenLocal()
}
}
fun RepositoryHandler.fan87Public() { // If you already have this, then you don't have to add it again
maven {
name = "fan87-public"
url = URI("https://maven.pkg.github.com/fan87/Pubic-Maven-Repository")
credentials {
username = System.getenv("GITHUB_USERNAME")
password = System.getenv("GITHUB_PASSWORD")
}
}
}