今天我发现发布的工件没有包含我的着色库。我想把它们放在里面,所以我决定在我的build.gradle中编辑我的发布部分
publishing {
repositories {
maven {
name = "GitHubPackages"
url = "https://maven.pkg.github.com/oraxen/Oraxen"
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
publications {
shadow(MavenPublication) {
from components.java
artifact shadowJar
}
}
}
// entire file: https://github.com/oraxen/oraxen/blob/06ca465c8854c9e3df386a608845d86852e70560/build.gradle
不幸的是,我得到了这个错误:
Execution failed for task ':publishShadowPublicationToGitHubPackagesRepository'.
> Failed to publish publication 'shadow' to repository 'GitHubPackages'
> Invalid publication 'shadow': multiple artifacts with the identical extension and classifier ('jar', 'all').
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
如何指定要上载-all工件?
1条答案
按热度按时间ajsxfq5m1#
components.java
应该包含shadow jar和原始jar,因此只需删除artifact shadowJar
行即可。