Gradle Error:没有为参数找到方法add()

时间:2014-07-22 17:03:11

标签: gradle build.gradle gradle-eclipse

所以我在Gradle中添加了一个自定义插件,特别是jmeter。 https://github.com/kulya/jmeter-gradle-plugin

我认为一切正常,但现在出现了这个错误:

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\Users\rstraubel\Documents\DataCentral\build.gradle' line: 21

* What went wrong:
A problem occurred evaluating root project 'DataCentral'.
> Could not find method add() for arguments [jmeterEditor, class com.github.kulya.gradle.plugins.jmeter.JmeterRunGuiTask] on task set.

第21行是我称之为插件的地方:' jmeter' github中指定的所有其他内容都已完成。有任何想法吗?感谢

编辑:完整Build.gradle

buildscript {
ext {
    springBootVersion = '1.0.2.RELEASE'
}
repositories {
    mavenCentral()
    maven { url "http://repo.spring.io/libs-milestone"}
    mavenLocal()
}
dependencies {
    classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
    classpath("com.github.kulya:jmeter-gradle-plugin:1.3.1-2.6")
}
}

apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'spring-boot'
apply plugin: 'idea'
apply plugin: 'sonar-runner'
apply plugin: 'jmeter'

jar {
baseName = 'datacentral'
version =  '0.0.1-SNAPSHOT'
}

repositories {
mavenCentral()
maven { url "http://repo.spring.io/libs-milestone" }
maven { url "http://m2.neo4j.org" }
}

dependencies {
compile "org.springframework.boot:spring-boot-starter-web:${springBootVersion}"
compile "org.springframework.boot:spring-boot-starter-data-    mongodb:${springBootVersion}"
compile "com.fasterxml.jackson.core:jackson-databind"
compile "org.springframework.boot:spring-boot-starter-web"
compile "org.springframework.data:spring-data-mongodb"
compile "org.mongodb:mongo-java-driver:2.12.0-rc0"
compile "org.springframework.data:spring-data-rest-webmvc"
testCompile "org.springframework.boot:spring-boot-starter-test:${springBootVersion}"
 }


jmeterRun.configure {
jmeterTestFiles = [file("src/test/jmeter/TestCases.jmx")]
}

 sonarRunner {
sonarProperties {
    property "sonar.host.url", "http://hawkeye.control-tec.com:9000"
    property "sonar.jdbc.url", "jdbc:mysql://bluestreak.qualifier.control-tec.com:3306/sonar?useUnicode=true&characterEncoding=utf8"
    property "sonar.jdbc.driverClassName", "com.mysql.jdbc.Driver"
    property "sonar.jdbc.username", "sonar"
    property "sonar.jdbc.password", "sonar-pass"

    property "sonar.projectKey", "com.controltec.incontrol.qualifier:Data-Central"
}
}

task wrapper(type: Wrapper) {
gradleVersion = '2.0'
}

1 个答案:

答案 0 :(得分:2)

最有可能的是,jmeter插件尚未更新以支持Gradle 2.0。您可以尝试使用1.12进行验证。