2017-02-14 34 views
0

我想通過使用gradle的ssh打遠程腳本......但我得到了一定的錯誤。獨立build.gradle中的依賴關係錯誤

下面是構建文件:

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  [[email protected]] on root project 'bi' of type org.gradle.api.Project. 

請幫助解決這個...謝謝。

回答

0

看起來這個插件沒有被應用。因此該方法無法找到。

apply plugin: "org.hidetake.ssh"