没有使用gradle artifactory插件发布到artifactory [英] nothing published to artifactory using gradle artifactory plugin

查看:555
本文介绍了没有使用gradle artifactory插件发布到artifactory的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遵循这里给出的解决方案:使用gradle将artifact上传到artifactory ,但它不适合我。



以下是我的代码:

  apply plugin:'maven-publish'

/ *指定用于下载工件的存储库* /
存储库{
$ maven {
url =$ {artifactory_contextUrl} / repo
}
}
/ *定义artifactoryPublish任务应该发布的库(在artifactory中)* /
artifactory {
contextUrl =$ {artifactory_contextUrl}
发布{
repository {
repoKey =$ {artifactory_repoKey}
username =$ {artifactory_user }
password =$ {artifactory_password}
}
}

默认值{
出版物('integTestPublish ')
}

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

错误是:

 >在根项目'samples'上找不到参数[build_3a14r6bjhcvi883gaucf1jd8f0 $ _run_closure1_closure5_closure9 @ 71bc1581]的方法默认值()。 

用于artifactory插件的GAV为:

  classpath组:'org.jfrog.buildinfo',名称:'build-info-extractor-gradle',版本:'2.1.0'

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

解决方案

用户指南中所述, artifactory 版本2.X的插件用于处理 maven 插件,而不是 maven-publish 插件。为了处理刊物,请使用版本2.X的插件,或者最好使用3.0版本的 artifactory-publish 插件。 com.jfrog.artifactory 插件。它打算使用 maven-publish 出版物,并且与Gradle 1和Gradle 2兼容。

href =https://stackoverflow.com/questions/25258174/how-to-build-groovy-jar-w-gradle-and-publish-it-to-in-house-repo/25260461#25260461>这个答案包含一个完整的工作示例。


I followed the solution given here: upload artifact to artifactory using gradle, but it is not working for me.

Here is my code:

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
        }
    }
}

The error is:

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

GAV used for artifactory plugin is:

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

What is wrong here ? can someone point me to DSL/API doc of artifactory plugin version 2.1.0 My gradle version is 1.11

解决方案

As explained in the user guide, artifactory plugin of version 2.X is intended to work with maven plugin, not maven-publish plugin. For working with publications please use artifactory-publish plugin of version 2.X, or, preferably, use version 3.0 of com.jfrog.artifactory plugin. It is intended to work with maven-publish publications and compatible both with Gradle 1 and Gradle 2.

This answer contains a fully working example.

这篇关于没有使用gradle artifactory插件发布到artifactory的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆