java - 部署到 Bintray 三天后,我笔记本电脑上的 Gradle 无法解析应该可用的 Artifact

标签 java maven bintray jcenter

项目: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然后点击:SET ME UP

它在页面的右上角。

或执行以下操作:

要使用 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/

相关文章:

java - 使用 Protege API 编译代码时出错

java - 检查用户是否输入了整数

java - 静态 Util 方法与实例 Util 方法——哪个更好?

java - 比较二进制数据和逐行字符串哪个更快?

java - Maven 构建所有子模块,甚至使用配置文件

maven - 项目结构应该如何使用带有 gradle 或 maven 的微服务?

maven - Bintray 依赖项不会在 IntelliJ 中下载

bintray - 如何将 Maven 工件从 jcenter 同步到 Maven Central?

java - maven故障安全:verify broken when using dependenciesToScan?

android - 在 jFrog/Bintray 中导入 github 存储库以上传库时,导入 Github 存储库按钮被禁用