【发布时间】:2015-02-24 11:36:32
【问题描述】:
我正在开发一个非常基本的 Gradle 插件(主要是为了获得经验),并且我已经将一个版本发布到我的 Bintray 存储库中,应该可以查看 here。
我已将我的存储库链接到 JCenter(并且可以找到我的插件 here),现在,为了测试它是否正常工作,我正在尝试从 Gradle 构建脚本下载这些工件并将我的插件应用到模拟项目:
apply plugin: 'semver'
apply plugin: 'java'
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.github.tagc:semver-plugin:0.1.0'
}
}
semver {
versionFilePath = 'version.properties'
}
但是,Gradle 无法解决该依赖关系并引发此异常:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'TestSemver'.
> Could not resolve all dependencies for configuration ':classpath'.
> Could not find com.github.tagc:semver-plugin:0.1.0.
Searched in the following locations:
https://jcenter.bintray.com/com/github/tagc/semver-plugin/0.1.0/semver-plugin-0.1.0.pom
https://jcenter.bintray.com/com/github/tagc/semver-plugin/0.1.0/semver-plugin-0.1.0.jar
Required by:
:TestSemver:unspecified
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 3.703 secs
这是因为JCenter 似乎没有托管我的文件(在com/github/tagc 下)。我不确定为什么会这样。在确认我的存储库与 JCenter 链接后,是否需要采取任何其他步骤来使其托管我上传的文件,以便我可以按照构建脚本中显示的方式访问它们?或者只是文件需要一些时间才能出现在 JCenter 上?自从我的存储库链接到 JCenter 已经过去了大约 5 个小时。
任何帮助或建议将不胜感激。
【问题讨论】:
-
您必须登录 bintray 并在工件公开之前批准它们。你这样做了吗?
-
@MarkVieira 我很确定他们已经出版了。我可以在注销时看到我的文件,并且我的提要显示“tagc 已发布 gradle-semver-plugin 的 0.1.0 版”。
-
在您的存储库设置页面上,JCenter 列在“链接到”部分下?
-
@MarkVieira 是的。这就是我看到页面的方式。 puu.sh/dLruN/93316a1233.png
标签: maven gradle bintray jcenter