独立build.gradle中的依赖项错误

时间:2017-02-14 13:07:47

标签: build.gradle

我正在尝试使用gradle通过ssh命中远程脚本...但我收到了一定的错误。

以下是构建文件:

    buildscript{
    repositories {      
        maven {
            println('Hello World')
            url "https://adlm.nielsen.com/artifactory/plugins-release/"
            credentials {
                username '********'
                password '********'
            }
        }
    }

    dependencies {
            classpath group: 'org.hidetake', name: 'gradle-ssh-plugin', version: '2.7.0'
        }
}       

remotes {
      web01 {
    role 'webServers'
    host = '********hetibd043.********'
    user = '********'
    password = '********'
  }
}

task reload << {
  ssh.run {
    session(remotes.role('webServers')) {
      execute 'pwd'
    }
  }
}

以下是错误:

* What went wrong:
A problem occurred evaluating root project 'bi'.
> Could not find method remotes() for arguments     [build_dors3zgr32fbn8jukg7pqp34n$_run_closure1@70606922] on root project 'bi' of type org.gradle.api.Project.

请帮忙解决这个问题......谢谢。

1 个答案:

答案 0 :(得分:0)

看起来该插件未被应用。因此无法找到该方法。

    apply plugin: "org.hidetake.ssh"