问题
I'm developing a very basic Gradle plugin (mainly to get experience) and I've published a version to my Bintray repository which should be viewable here.
I've linked my repository to JCenter (and can find my plugin here) and now, to test it all works, I'm trying to download those artifacts from a Gradle build script and apply my plugin to a mock project:
apply plugin: 'semver'
apply plugin: 'java'
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.github.tagc:semver-plugin:0.1.0'
}
}
semver {
versionFilePath = 'version.properties'
}
However, Gradle can't resolve that dependency and throws this exception:
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
This is because JCenter doesn't seem to be hosting my files (under com/github/tagc
). I'm not sure why this is the case. After getting a confirmation that my repository is linked with JCenter, are there any additional steps I need to take to make it host my uploaded files so that I can access them in the way shown in the build script? Or is just that it takes some time for the files to appear on JCenter? It's been about 5 hours since my repository was linked to JCenter.
Any help or advice would be appreciated.
回答1:
It turns out that I just needed to be patient and let JCenter update. It's on there now, and my build script runs fine.
Considering that it takes a fair amount of time to update (~12 hours for me), I think that the user experience might be improved by letting first-time users know that there's a lengthy update process and that they haven't simply missed a step. This would remove some of the anxiety of wondering "Have I missed a step, and if so will I be waiting forever?"
Other than that, the Bintray UX is absolutely wonderful.
来源:https://stackoverflow.com/questions/27669291/trouble-downloading-my-published-files-on-bintray-from-jcenter