Use the buildscript block and define dependencies of your build script there.

e.g.
buildscript {
      repositories { mavenCentral() }
      dependencies { classpath group: "sshtools", name: "j2ssh-core", version: 
"0.2.9" }
}

See Gradle’s DSL reference docs
http://gradle.org/docs/current/dsl/org.gradle.api.Project.html#org.gradle.api.Project:buildscript(groovy.lang.Closure)

Also, unrelated to Gradle, have you looked into tools like 
Puppet<http://puppetlabs.com/puppet/what-is-puppet/> or 
Chef<http://www.opscode.com/chef/> for maintaining services on a remote server? 
 Is that overkill for your use-case?

From: Luis Muniz [mailto:neur0ma...@gmail.com]
Sent: Sunday, November 11, 2012 6:44 PM
To: user@gradle.codehaus.org
Subject: [gradle-user] Noob needing help to define dependencies for build-time

Hi,

My build script does not compile anything,it is just meant to start and stop 
tomcat on a remote server.

I have been looking at out-of-the-box solutions for this, and found none. My 
server has a sudoer list, so I can't ssh as root. Combined with the 
impossibility to change sudoer policy to create password-less sodoers, 
disqualifies sshexec.

Anyway, I have developed a class that does the job, by opening an interactive 
SSH session, with a pseudo terminal.

I use the sshtools j2ssh library to do this.

Now, I don't know how I can develop a plugin for this, but I thought I'd just 
drop my class in build.gradle for now, and see how that would work. The problem 
is that my script would not compile, because my classes depend on j2ssh.

How can I fix this?

Thanks for helping an newbie



Andrew Goode      | Technical Architect/Team Lead

andrew.go...@nextraq.com<mailto:andrew.go...@nextraq.com>

tel 678-762-6861                | fax 678-338-5957

1200 Lake Hearn Drive, Suite 500, Atlanta, GA  30319

www.nextraq.com<http://www.nextraq.com>


[cid:4e48a0.png@4c54a1fd.46aeb8c7]






This communication, along with any attachment(s), is intended only for the use 
of the addressee(s) and may contain proprietary, confidential or privileged 
information. If you are not the intended recipient, you are hereby notified 
that any dissemination, distribution or copying of any information contained in 
or attached to this communication is strictly prohibited. If you have received 
this message in error, please notify the sender immediately and destroy the 
original communication and its attachments without reading, printing or saving 
in any manner. Thank you.


<<inline: 4e48a0.png>>

Reply via email to