2013-07-28 2 views
2

Я стараюсь следовать этому руководству, чтобы настроить Grails/Cargo: https://github.com/bmuschko/gradle-cargo-plugin Я хочу использовать этот плагин для развертывания войн в локальных экземплярах tomcat и запускать и останавливать их.Настройка Gradle Cargo

Вот мой build.gradle

apply plugin: 'java' 
apply plugin: 'eclipse' 
apply plugin: 'cargo' 

sourceCompatibility = 1.5 
version = '1.0' 
jar { 
    manifest { 
     attributes 'Implementation-Title': 'Gradle Quickstart', 'Implementation-Version': version 
    } 
} 

repositories { 
    mavenCentral() 
} 

dependencies { 
    compile group: 'commons-collections', name: 'commons-collections', version: '3.2' 
    testCompile group: 'junit', name: 'junit', version: '4.+' 
    classpath 'org.gradle.api.plugins:gradle-cargo-plugin:0.6.1' 
    def cargoVersion = '1.3.3' 
    cargo "org.codehaus.cargo:cargo-core-uberjar:$cargoVersion", 
      "org.codehaus.cargo:cargo-ant:$cargoVersion" 

} 

cargo { 
    containerId = 'tomcat6x' 
    port = 9090 

    deployable { 
     file = file('/Users/me/Documents/gradlemucks/grails_2/hello-world/target/hello-world-0.1.war') 
     context = 'helloworld' 
    } 

    local { 
     homeDir = file('/Users/me/developer/servers/apache-tomcat-6.0.37') 
     output = file('build/output.log') 

     tomcat { 
      ajpPort = 9091 
     } 
    } 
} 

test { 
    systemProperties 'property': 'value' 
} 

uploadArchives { 
    repositories { 
     flatDir { 
      dirs 'repos' 
     } 
    } 
} 

Когда я gradle tasks в терминале я получаю:

FAILURE: Build failed with an exception. 

* Where: 
Build file '/Users/me/Documents/workspaces/regress_test/httptests/build.gradle' line: 3 

* What went wrong: 
A problem occurred evaluating root project 'httptests'. 
> Plugin with id 'cargo' not found. 

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

Что мой делаю неправильно?

ответ

4

buildscript сам нужна зависимость грузовой так, добавив:

buildscript { 
    repositories { 
     mavenCentral() 
    } 

    dependencies { classpath "org.gradle.api.plugins:gradle-cargo-plugin:0.6" } 
} 

должен сделать это в состоянии найти плагин груза.

Смежные вопросы