Не удалось найти метод cargo() для аргументов

Я пытаюсь развернуть войну на коте с грузом градации, я получаю сообщение об ошибке, не удалось найти метод груза ()

C:\Users\naresh.vatsal\workspace_spring_jan14\SpringMvcUsingGradle>сборка градиента

ОШИБКА: сборка не удалась с исключением.

Где: файл сборки «C:\Users\naresh.vatsal\workspace_spring_jan14\SpringMvcUsingGradle\build.gradle», строка: 45

Что пошло не так: возникла проблема при оценке корневого проекта SpringMvcUsingGradle.

Не удалось найти метод cargo() для аргументов [build_3gitu3al50b7kv8zi1ebj3qsr$runclosure3@302aa00f] в корневом проекте SpringMvcUsingGradle.

apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'war'
apply plugin: 'com.bmuschko.tomcat-base'
apply plugin: 'com.bmuschko.cargo-base'
ext.tomcatVersion = '7.0.67'

sourceCompatibility = 1.7

buildscript {

    repositories {
        maven {
            url "https://plugins.grdev.net/m2/"
        }
    }

    dependencies {
        classpath "com.bmuschko:gradle-tomcat-plugin:2.2.4"
        classpath 'com.bmuschko:gradle-cargo-plugin:2.2'
    }
}

repositories {
    mavenCentral()
}

dependencies {

    def cargoVersion = '1.4.5'
    cargo "org.codehaus.cargo:cargo-core-uberjar:$cargoVersion",
          "org.codehaus.cargo:cargo-ant:$cargoVersion"
    compile 'org.springframework:spring-context:4.0.0.RELEASE'
    compile 'org.springframework:spring-webmvc:4.0.0.RELEASE'
    compile 'org.aspectj:aspectjrt:1.7.4'
    compile 'javax.inject:javax.inject:1'
    compile 'javax.servlet:jstl:1.2'
    compile 'org.slf4j:slf4j-api:1.7.5'
    compile 'org.slf4j:jcl-over-slf4j:1.7.5'
    compile 'org.slf4j:slf4j-log4j12:1.7.5'
    compile 'log4j:log4j:1.2.15'
    testCompile 'junit:junit:4.7'
}

cargo {
    containerId = 'tomcat7x'
    port = 8080

    local {
        homeDir = file('C:/mdi/soft/apache-tomcat-7.0.67')
        output = file('C:/mdi/soft/apache-tomcat-7.0.67/output.log')
    }
}

war { 
    version = '' 
}

person Anand    schedule 20.01.2016    source источник


Ответы (1)


Похоже, вы применили неправильный плагин в данный момент. Просто измените:

apply plugin: 'com.bmuschko.cargo-base'

to

apply plugin: 'com.bmuschko.cargo'

Потому что при применении плагина com.bmuschko.cargo-base вам придется настраивать каждую задачу отдельно, в соответствии с описанием плагина< /а>.

И еще одно, нет свойства output, которое можно было бы определить в замыкании local, но есть свойство outputFile, поэтому ваше замыкание local должно выглядеть так:

local {
    homeDir = file('C:/mdi/soft/apache-tomcat-7.0.67')
    outputFile = file('C:/mdi/soft/apache-tomcat-7.0.67/output.log')
}
person Stanislav    schedule 20.01.2016