我遵循了这里给出的解决方案: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'这里出了什么问题?有人能告诉我artifactory plugin版本2.1.0的DSL/API文档吗?我的gradle版本是1.11
发布于 2014-08-13 15:02:00
正如the user guide中所解释的,2.X版的artifactory插件旨在与maven插件一起使用,而不是maven-publish插件。要使用publications,请使用2.X版的artifactory-publish插件,或者最好使用3.0版的com.jfrog.artifactory插件。它旨在与maven-publish出版物一起使用,并与Gradle1和Gradle2兼容。
This answer包含一个完整的工作示例。
https://stackoverflow.com/questions/25279001
复制相似问题