Show configurations in your Gradle project

A Configuration represents a group of artifacts and their dependencies. The Project class has a member configurations contains all configuration of the project.

In Maven, its called scope, like 'compile', 'run', 'test' etc.

What is Gradle convention object

The philosophy of Gradle and Maven is convention over configuration. In Gradle the "convention" object contains these conventions. You can reconfigure these conventions at any time.

The Project interface has a method getConvention which return a Convention object. See Convention

Gradle plugin example in Eclipse

Most features provided by Gradle are implemented by plugins, its fairy easy to create our own Gradle plugins. This post will create a simple plugin in Eclipse.

Our plugin will be built with Gradle, so choose File -> Others, and type gradle

Gradle JUnit HelloWorld example

Gradle supports both Java and Groovy projects. When build Groovy project , the best test framework is Spock, when work with Java project, the test framework is JUnit. Even the Spock is actually compatible with JUnit, like Gradle compatible with Maven.

For a typical Java project, the directory layout would be like this

Build Groovy project with gradle

Gradle is a build automation tool for Java and Groovy, its compatible with Maven. Spock is a unit test framework that support Java and Groovy and compatible with JUnit.

In this example we illustrate how to build Groovy project with Gradle and Spock.

Set Gradle home and cache directory in Eclipse

<tt>C:\Users\Administrator\.gradle</tt> as the cache directory. You may already installed ... a release of Gradle and build some projects in command line mode with it. And you may set the cache ... directory in your custom directory. It's better to use the same cache wherever you use Gradle. For some ... -> Preferences and type "Gradle" in filter box. And set Gradle distribution and Gradle user home

Using Gradle daemon to speed up your building

If you are using Gradle , you will find yourself in the situation that run gradle build repeatedly.

It takes a few seconds to finish the process, even there is only one file need to recompile. Because before gradle do any real building job, it has to do some initial work like loading JVM, prepare execution environment, loading Groovy classes etc.

It takes a few seconds to finish the process, even there is only one file need to recompile. Because before gradle do any real building job, it has to do some initial work like loading JVM, prepare execution environment, loading Groovy classes etc. .

The upcoming Gradle book: Gradle in Action

Gradle is a new face in the world of Java build tool. There aren't much book resources available now. But the official document is awful, I am keep looking for in depth books about the subject.

The very first book is "Building and Testing with Gradle". But its a little book and only scratches the surface of the subject.

Gradle example to build Spring MVC application

In this example, we will create a simple Spring MVC ... application and build it with Gradle. The gradle script will use Tomcat as container and deploy ... the Spring MVC project with cargo plugin. All the files and directories are listed here F:\tmp ... of web.xml configuration, it equivalent to <servlet> <servlet-name>Spring MVC Dispatcher

Plugin with id 'tomcat' not found

When I run command "gradle tasks" to see what tasks available , I get this error.

plugin id tomcat not found

Previous Page 1 ... 3 4 5 Next Page