项目:cjwizard Artifact :cjwizard 和 cjwizard-demo,均为 1.0.9 版本
我刚刚从原来的所有者那里接管了这个项目,我对 Maven 部署过程和 Bintray 都是新手。
在(根据我的 Maven 日志)执行成功的 mvn:deploy
之后,我可以看到 cjwizard 和 cjwizard-demo 的 pom.xml,但我有一个小项目是使用 gradle 尝试拉下 cjwizard 和 cjwizard-demo,但失败了。
(编辑:我修改了我的 build.gradle 以一次只下载一个 Artifact 。这是一个简单的测试项目,除了 cjwizard 之外没有其他依赖项)
我的 build.gradle 看起来像这样
group 'test'
version '1.0-SNAPSHOT'
apply plugin: 'java'
sourceCompatibility = 1.8
repositories {
mavenCentral()
jcenter()
}
dependencies {
compile 'com.github.cjwizard:cjwizard:1.0.9'
}
(我通常在自己的项目中使用 gradle。我正在使用 maven 来构建 cjwizard,因为该项目已经设置为使用 maven)
我收到一条错误消息,指出无法解析 cjwizard Artifact 。 cjwizard-demo 也有同样的问题。
我做错了什么吗?
此外,开源项目不符合电子邮件支持的条件吗?谢谢
最佳答案
总而言之,正如 SteveSobol 在他的评论中提到的,推送到 Bintray 存储库不会推送到 JCenter。
JCenter 是一个众所周知的公共(public)存储库,但它是 Bintray 中管理的众多存储库之一。在 Bintray 中,每个人都可以打开一个开源存储库。
如果您有一个您想要使用的存储库,但它不是 Maven Central 或 JCenter,您可以轻松地将构建工具连接到它,请参阅文档:
转到 https://bintray.com/cjwizard/CJWizard然后点击:
它在页面的右上角。
或执行以下操作:
要使用 gradle 解决问题,请编辑您的 build.gradle:
repositories {
maven {
url "http://dl.bintray.com/cjwizard/CJWizard"
}
}
要使用 maven 解决,请编辑您的 settings.xml:
<?xml version="1.0" encoding="UTF-8" ?>
<settings xsi:schemaLocation='http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd'
xmlns='http://maven.apache.org/SETTINGS/1.0.0' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
<profiles>
<profile>
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>bintray-cjwizard-CJWizard</id>
<name>bintray</name>
<url>http://dl.bintray.com/cjwizard/CJWizard</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>bintray-cjwizard-CJWizard</id>
<name>bintray-plugins</name>
<url>http://dl.bintray.com/cjwizard/CJWizard</url>
</pluginRepository>
</pluginRepositories>
<id>bintray</id>
</profile>
</profiles>
<activeProfiles>
<activeProfile>bintray</activeProfile>
</activeProfiles>
</settings>
关于java - 部署到 Bintray 三天后,我笔记本电脑上的 Gradle 无法解析应该可用的 Artifact ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45624687/