在Jitpack中构建android库:错误:找不到构建工件



我已经分叉了一个Android库,并合并了一些我需要的更改https://github.com/ceessay/kdgaugeView

为了在我的Android项目中使用这个库,我尝试在Jitpack上发布它。

问题是在Github上推送更改后,Jitpack上的构建似乎通过了,但有以下消息

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.5.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD SUCCESSFUL in 543ms
4 actionable tasks: 1 executed, 3 up-to-date
Build tool exit code: 0
Looking for artifacts...
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Dhttps.protocols=TLSv1.2
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Dhttps.protocols=TLSv1.2
Looking for pom.xml in build directory and ~/.m2
2020-07-13T12:27:13.425592193Z
Exit code: 0
ERROR: No build artifacts found

此处为完整日志:https://jitpack.io/com/github/ceessay/kdgaugeView/1.0.5/build.log

在我的项目中添加库也失败了,并显示以下消息:

找不到com.github.cessarticle:kdgaugeView:1.0.4。

我遵循了Jitpack文档的指导方针,在库上升级了gradle,但我不会工作。

我刚开始为Android发布库,所以我可能会错过一些东西。有什么线索吗?

您可以使用maven-publishgradle插件。maven-publish的文档为https://developer.android.com/studio/build/maven-publish-plugin.

我相信也可以使用com.github.dcendents.android-maven,它已经在那个项目中了,但对我来说并不那么明显

你也可以查看优秀的插件https://vanniktech.github.io/gradle-maven-publish-plugin/.

花了半天时间解决同样的问题。我忘记在build.gradle.kts:中为我的工件定义发布

publishing {
publications {
create<MavenPublication>("maven") {
groupId = "com.github.username"
artifactId = "library-name"
version = "1.0.0"
from(components["kotlin"])
}
}
}

希望,这有帮助。

最新更新