In order to build the project, you need Gradle installed on your system workstation. You can download the latest distribution from the Gradle official website: http://www.gradle.org/downloads
In order to build the example, just execute the following command line:
gradle build
If you need a loadable project for Eclipse, execute the following command line:
gradle eclipse
If you need a loadable project for JetBrains' IDEA, execute the following command instead:
gradle idea
Any of the preceding Gradle commands will generate the project files that will import the files into your favorite Integrated Developer Environment (IDE). Once you have the project in the IDE, running the HelloWorld
program with the arguments Jane
, Peter
, Mary
, produces the output:
Initialization from CDI framework Complete. Hello Jane, Peter and Mary Process finished with exit code 0
You can also execute the example from the command line, with the Gradle custom command from the script.
Gradle run
To build a project with Gradle, one executes the following command:
gradle build
To reset the project to clean state, one executes the following command:
gradle clean
Of course Gradle is a fully featured build environment with scores of additional tasks and commands. I recommend you visit the Gradle website (http://gradle.org) to learn more about Gradle. Packt Publishing also has a recent book: Gradle Effective Implementation Guide by Hubert Klein Ikkink. You will also find out about the build environment and tools in the appendices at the end of this book.
3.139.80.209