本文共 1171 字,大约阅读时间需要 3 分钟。
repositories { maven { url "http://repo.mycompany.com/maven2" }}
dependencies { compile group: 'commons-io', name: 'commons-io', version: '2.+' compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.+' testCompile group: 'junit', name: 'junit', version: '4.+'}
D:\workspace\Gradle-Demo>gradle build cleanEclipse eclipse
package org.gradle;import org.apache.commons.lang3.StringUtils;public class HelloGradle { private final String name; public HelloGradle(String name) { super(); this.name = name; } public String getName() { return this.name; } public static void main(String[] args) { String ping = "Hello, Gradle"; String pong = "I am Zhou Shengshuai."; ping = StringUtils.wrap(ping, '"'); System.out.println(ping + "\n" + pong); }}