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

Integration testing


In the classic software lifecycle, unit tests are naturally followed by the integration phase. Earlier, we studied the unit testing of a Maven plugin, and now we will deepen the integration phase.

The integration phase is covered by maven-invoker-plugin because this plugin can run a set of Maven projects (features that we didn't use at all for our plugin project) and can verify the output generated from the project launched. The ability to verify the output generated from the project that is executed is accomplished by a script that could be a bash script or a groovy script. This plugin is included in a specific build profile for the integration phase.

Tip

The integration build profile, by default, is named run-its. It is possible to rename it.

Whenever we want to perform integration tests, we have to run the following command:

$ mvn integration-test -Prun-its

When we run such a command, Maven executes the plugin related to the profile, and creates a local repository structure...