【问题标题】:nothing published to artifactory using gradle artifactory plugin没有使用 gradle artifactory 插件发布到 artifactory
【发布时间】:2014-08-13 05:57:30
【问题描述】:

我遵循了这里给出的解决方案:upload artifact to artifactory using gradle,但它对我不起作用。

这是我的代码:

apply plugin: 'artifactory'
apply plugin: 'maven-publish'

/* Specify the repositories to be used for downloading artifacts */
repositories {
    maven {
        url = "${artifactory_contextUrl}/repo"
    }
}
/* Define the repository (in artifactory) where artifactoryPublish task should publish */
artifactory {
    contextUrl = "${artifactory_contextUrl}"
    publish {
        repository {
            repoKey = "${artifactory_repoKey}" 
            username = "${artifactory_user}"
            password = "${artifactory_password}"
        }
    }

    defaults {
        publications ('integTestPublish')
    }

}
publishing {
    publications {
        integTestPublish(MavenPublication) {
            setArtifactId(project.name + '-' + integTestJar.appendix)
            artifact integTestJar.archivePath
        }
    }
}

错误是:

> Could not find method defaults() for arguments [build_3a14r6bjhcvi883gaucf1jd8f0$_run_closure1_closure5_closure9@71bc1581] on root project 'samples'.

用于artifactory插件的GAV是:

classpath group: 'org.jfrog.buildinfo', name: 'build-info-extractor-gradle', version: '2.1.0'

这里有什么问题?有人可以指点我 DSL/API 文档的 artifactory 插件版本 2.1.0 我的 gradle 版本是 1.11

【问题讨论】:

    标签: gradle artifactory


    【解决方案1】:

    正如the user guide 中所述,2.X 版的artifactory 插件旨在与maven 插件一起使用,而不是maven-publish 插件。要使用 publications,请使用 2.X 版的 artifactory-publish 插件,或者最好使用 com.jfrog.artifactory 插件的 3.0 版。它旨在与 maven-publish 出版物一起使用,并与 Gradle 1 和 Gradle 2 兼容。

    This answer 包含一个完整的工作示例。

    【讨论】:

    • 感谢 JBaruch。由于开发过程的限制,我不确定是否可以使用 artifactory 3.x。我的要求是将自定义 sourceSet(例如 integTest)创建的 jar 发布到 artifactory。使用 artifactor 2.X 如何做到这一点?
    • 我提到的 3.0 是指 gradle 插件版本,而不是 Artifactory 版本。您可以在任何 Artifactory 版本中使用 artifactory gradle plugin v3.0。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-02-27
    • 2014-03-04
    • 1970-01-01
    • 1970-01-01
    • 2016-09-23
    • 2015-10-14
    相关资源
    最近更新 更多