I’m trying to write a Grails script to build and deploy (scp) my application :
includeTargets << grailsScript("War")
target('deploy': "Deploy war on server") {
depends(war)
ant.property ( file : 'application.properties' )
def user = ant.project.properties."${grailsEnv}_remote_user"
def host = ant.project.properties."${grailsEnv}_remote_host"
def dir = ant.project.properties."${grailsEnv}_remote_dir"
ant.scp(file: warName, todir: "${user}@${host}:${dir}", passphrase:"", trust:"true")
}
setDefaultTarget('deploy')
When I run this script I get the following error :
C:\Java\IDE\workspaces\Projets\Test 1.5\build.xml:20: Problem: failed to create task or type scp
Cause: Could not load a dependent class com/jcraft/jsch/Logger
It is not enough to have Ant's optional JARs
you need the JAR files that the optional tasks depend upon.
Ant's optional task dependencies are listed in the manual.
Of course I downloaded jsch.jar but I can’t find how to modify the classpath.
I use STS 3.0 and Grails 2.1.0
Any idea ?
just add following to your BuildConfig.groovy