Gradle Artifactory插件错误 [英] Gradle Artifactory plugin error

查看:140
本文介绍了Gradle Artifactory插件错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的毕业版是2.2.1。

My gradle version is 2.2.1.

我正在尝试在gradle中使用artifactory插件( apply plugin:'artifactory' / code>)

I am trying to use the artifactory plugin in gradle (apply plugin: 'artifactory')

这是我的代码:

buildscript {
    repositories {
        maven {
            url 'http://172.14.3.93/artifactory/plugins-release'

        }

    }
    dependencies {
        classpath(group: 'org.jfrog.buildinfo', name: 'build-info-extractor-gradle', version: '2.0.9')
    }
}

allprojects {
    apply plugin: 'artifactory'
}

artifactory {
    contextUrl = "${artifactory_contextUrl}"   //The base Artifactory URL if not overridden by the publisher/resolver
    publish {
        repository {
            repoKey = 'libs-release-local'
            maven = true

        }
    }
    resolve {
        repository {
            repoKey = 'libs-release'
            maven = true

        }
    }
}

当我运行gradle构建,这是我得到的:

When i run gradle build, this is what i get:

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\Workspace\GradleConfiguration\build.gradle' line: 100

* What went wrong:
A problem occurred evaluating root project 'GradleConfiguration'.
> Failed to apply plugin [id 'artifactory']
   > Could not find method add() for arguments [artifactoryPublish, class org.jfrog.gradle.plugin.artifactory.extractor.BuildInfoTask] on task set.

* Try:
Run with --info or --debug option to get more log output.

此外,当我删除与该工件相关的所有代码,只留下应用插件:'artifactory',我收到这个错误:

Also, when i delete all the code that is related to the artifactory and leave only apply plugin: 'artifactory', i get this error:

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\OnRights_Workspace\GradleConfiguration\build.gradle' line: 86

* What went wrong:
A problem occurred evaluating root project 'GradleConfiguration'.
> Failed to apply plugin [id 'artifactory']
   > Plugin with id 'artifactory' not found.

* Try:
Run with --info or --debug option to get more log output.


推荐答案

您的插件版本太旧了。尝试使用最新的( 3.1.1 )。

Your plugin version is too old. Try to use the latest (3.1.1).

这篇关于Gradle Artifactory插件错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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