【发布时间】:2019-12-15 10:42:16
【问题描述】:
我正在尝试将由 Gradle 6.0.1 ProGuard 插件创建的模糊 JAR 发布到 Maven 存储库。在过去的几天里,我学到了很多关于 Gradle 配置、变体和工件的知识,但我似乎无法完成这项工作。我相信相关文档是here。
我创建了一个minimal example showing my intended setup on Github。
如果我在这个项目上运行./gradlew publish,我会收到以下错误。
Execution failed for task ':publishMyLibraryPublicationToMyRepoRepository'.
> Failed to publish publication 'myLibrary' to repository 'myRepo'
> Invalid publication 'myLibrary': multiple artifacts with the identical extension and classifier ('jar', 'null').
我还尝试了已弃用的 maven 插件。不幸的是,这个插件忽略了自定义的 ProGuard jar。
有人可以就如何用 proguard 任务中的混淆 Jar 替换 JAR 任务中的原始 JAR 给我任何建议吗?
编辑: 我能够从this thread 获得解决方案。 Github 上的最小示例包含修补版本。随意看看。我将把工作的 build.gradle 放到下面的答案中。
【问题讨论】:
标签: java maven gradle proguard