Gradle is a project automation tool that builds upon the concepts of Apache Ant and Apache Maven and introduces a Groovy-based DSL instead of the more traditional XML form of declaring the project configuration. -- http://en.wikipedia.org/wiki/Gradle
Build tools recognized by Search.Maven.org
and there are many more still... For example WAF
package demo;
/* ... */
public class Hello {
public static void main(String[] args) {
System.out.format("Hello world\n");
}
}
apply plugin: 'java'
mkdir -p src/main/java/demo
cat > src/main/java/demo/Hello.java
cat > gradle.build
tree
gradle build
gradle build
gradle --daemon build
gradle build
java -cp build/libs/first.jar demo.Hello
mpayne-mbp:first mpayne$ cat build.gradle
apply plugin: 'java'
mpayne-mbp:first mpayne$
package demo;
import org.apache.commons.beanutils.BeanUtils;
/* ... */
public class MainBeanUtilsDemo {
private String jdbcDriverClass, dbUrl, dbUser, dbPassword;
public MainBeanUtilsDemo(String[] args) throws FileNotFoundException,
IOException, IllegalAccessException, InvocationTargetException {
this.strPropertyFileName = args.length > 0 ? args[0] : "jdbc.properties";
Properties properties = new Properties();
properties.load(new FileReader(strPropertyFileName));
BeanUtils.populate(this, properties); // remember the accessors
System.out.format("user=%s password=%s\n", dbUser, dbPassword);
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
repositories { mavenCentral() }
dependencies {
compile 'commons-beanutils:commons-beanutils:1.8.3'
}
mkdir -p src/main/java/demo # redundant
cat > src/main/java/demo/MainBeanUtilsDemo.java
cat > gradle.build
echo 'org.gradle.daemon=true' > gradle.properties
gradle eclipse # So we can import this into eclipse and fix it up a bit.
gradle build # Don't need the --daemon now
defaultTasks 'BeanDemo'
apply plugin: 'java'
apply plugin: 'eclipse'
repositories { mavenCentral() }
dependencies {
compile 'commons-beanutils:commons-beanutils:1.8.3'
}
task BeanDemo(type: JavaExec) {
main='demo.MainBeanUtilsDemo'
classpath=runtimeClasspath
}
task zip << {
ant.zip(destfile: 'archive.zip') {
fileset(dir: 'src') {
include(name: '**.xml')
exclude(name: '**.java')
}
}
}
Many ant examples in the user guideExample from StackOverflow