新答案:
GitHub 发布了官方指南:配置 Gradle 以与 GitHub Packages 一起使用。
旧答案:
好像插件还不是很稳定。查看我创建的存储库,该存储库已设置好所有内容。我设法在这里发布了一些带有该插件的软件包。
即使包已发布,Gradle 也会显示任务失败,原因是以下问题maven-metadata.xml
:
> Task :publishMainPublicationToGitHub madhead Maven PackagesRepository FAILED
Could not transfer metadata so57323260:test/maven-metadata.xml from/to remote (https://maven.pkg.github.com/madhead): Could not get resource 'so57323260/test/maven-metadata.xml'
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':publishMainPublicationToGitHub madhead Maven PackagesRepository'.
> Failed to publish publication 'main' to repository 'GitHub madhead Maven Packages'
> Could not GET 'https://maven.pkg.github.com/madhead/so57323260/test/maven-metadata.xml'. Received status code 422 from server: Unprocessable Entity
不过没关系,说不定哪天就修好了。
我注意到,由于Maven 发布不正确,这些包可能不会发布(请参阅链接的问题) 。groupId
现在看来它应该等于 Github 的项目名称。因此,就我而言,我必须将其用作so57323260
项目。这不是包在 Maven 中的工作方式,所以这可能是你的问题。groupId
madhead/so57323260