3
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Github Packages に gradle shadow pluginを使って maven-publish する

Posted at

はじめに

この記事は Github Packagesgradle shadow plugin を使って maven-publish する方法を備忘録として残しています。

おことわり

この記事は既に Gradlegradle shadow pluginmaven-publishを使っている人を対象にしています。また Github Packages の説明もしません。あと、Gradle 難しくて全然理解できてないので他にいい方法あれば教えて下さい🙏

解決したい課題

どう解決したか

publishing {
    publications {
        shadow(MavenPublication) { publication ->
            project.shadow.component(publication)
        }
    }
    repositories {
        maven {
            if (System.getenv("GITHUB_TOKEN")) {
                name = "GitHubPackages"
                url = uri("https://maven.pkg.github.com/civitaspo/publish-sample")
                credentials {
                    username = "civitaspo"
                    password = System.getenv("GITHUB_TOKEN")
                }
            }
            else {
                url "$buildDir/repo"
            }
        }
    }
}

おわりに

解決する方法は「そうだね」というかんじですが、 Gradle は Plugin も影響範囲がよく分からずソースコード読めばすぐ分かる感じじゃないので難しいですね。

3
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?