Class GithubPackagesPlugin
java.lang.Object
io.github.duckasteroid.gradle.githubpackages.GithubPackagesPlugin
- All Implemented Interfaces:
org.gradle.api.Plugin<org.gradle.api.Project>
public class GithubPackagesPlugin
extends Object
implements org.gradle.api.Plugin<org.gradle.api.Project>
Gradle project plugin that configures an authenticated GitHub Packages Maven repository.
Apply it to a project and configure the extension:
plugins {
id 'io.github.duckasteroid.github-packages'
}
githubPackages {
owner = 'my-org'
repository = 'my-repo'
}
The plugin will:
- Add the GitHub Packages Maven URL to
repositories(for dependency resolution). - If the
maven-publishplugin is present, add the same URL topublishing.repositories.
Credential Resolution: Credentials are resolved using a three-tier fallback chain (first available wins):
- Gradle properties:
gpr.user/gpr.key(gradle.properties) - Environment variables:
GITHUB_ACTOR/GITHUB_TOKEN - Environment variables:
GH_PACKAGES_READ_USER/GH_PACKAGES_READ_TOKEN
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
GithubPackagesPlugin
public GithubPackagesPlugin()
-
-
Method Details
-
apply
public void apply(org.gradle.api.Project project) - Specified by:
applyin interfaceorg.gradle.api.Plugin<org.gradle.api.Project>
-