Book Image

Maven Build Customization

By : Lorenzo Anardu, Roberto Baldi, Umberto Antonio Cicero, Riccardo Giomi, Giacomo Veneri
Book Image

Maven Build Customization

By: Lorenzo Anardu, Roberto Baldi, Umberto Antonio Cicero, Riccardo Giomi, Giacomo Veneri

Overview of this book

<p>Maven is one of the most popular tools used to control the dependencies and to administer a Java project. Maven can be used by newbies without the need to learn complex mechanisms, but it is also a powerful tool for big projects developed by different teams and organized over different modules and repositories.</p> <p>This book will provide you with all the information you need, right from managing dependencies to improving the build process of your organization. Starting with a simple project, you will create your development environment step-by-step, automatically build your code from resources (XML, DB), and package your JAR, WAR, and EAR files for different environments. Furthermore, you will learn about the complex hereditary features of Maven.</p> <p>Finally, this book will benefit you by teaching Maven-Gradle and Maven-Eclipse integration using the m2e plugin, managing the Maven repository from Gradle, and building a working Maven environment from Gradle.</p>
Table of Contents (17 chapters)
Maven Build Customization
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Creating a simple project with Gradle


Gradle can be used to create a Java project; in our case, we can create a common JAR project to explain a simple configuration to use Maven repositories within Gradle.

First, we must download the current version of Gradle; we can download the latest version 2.0. Once we get a ZIP file, we unzip it and put it into a folder as follows:

C:\gadle-2.0

Add GRADLE_HOME/bin to your PATH environmental variable to launch the Gradle command from every location. Obviously, you must have an installation of Java on your machine if you want to build a Java project.

All Gradle projects contain a file called build.gradle that contains the instructions to build and assemble projects through the command line.