I have defined the following properties in my build.gradle
apply plugin: MyPlugin
deploy {
type = "ssh"
ip = "10.1.1.1"
login = "me"
password = "password"
path = "/var/www/html"
}
My extension
public class DeployExtension {
String type
String ip
String login
String password
String path
}
MyPlugin
class MyPlugin implements Plugin<Project> {
public void apply(Project project) {
def extension = new DeployExtension()
project.extensions.deploy = extension
project.configurations {
webserver
}
project.uploadWebserver {
repositories.mavenDeployer {
name = 'sshDeployer' // optional
repository(url: project.customProp.serverIP) {
authentication(userName: "me", password: "myPassword")
}
}
}
}
}
How do I read the properties ip, login, password etc under uploadWebserver? extension.propertyName gives me null.