Grails脚本来部署一场战争

Grails脚本来部署一场战争,grails,scp,grails-2.0,Grails,Scp,Grails 2.0,我正试图编写一个Grails脚本来构建和部署(scp)我的应用程序: includeTargets << grailsScript("War") target('deploy': "Deploy war on server") { depends(war) ant.property ( file : 'application.properties' ) def user = ant.project.properties."${grailsEnv}_remote_user

我正试图编写一个Grails脚本来构建和部署(scp)我的应用程序:

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')
当然我下载了jsch.jar,但是我找不到如何修改类路径

我使用STS3.0和Grails2.1.0


有什么想法吗?

只需在BuildConfig.groovy中添加以下内容

    dependencies {
        build "com.jcraft:jsch:0.1.46"
        build "org.apache.ant:ant-jsch:1.8.2"
...

只需将以下内容添加到BuildConfig.groovy

    dependencies {
        build "com.jcraft:jsch:0.1.46"
        build "org.apache.ant:ant-jsch:1.8.2"
...

您是否尝试将其放在项目根目录下的lib文件夹中(如果不存在,请创建)?您是否尝试将其放在项目根目录下的lib文件夹中(如果不存在,请创建)?