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

Checking out Maven projects from SCM repositories


If we have to check out a Maven project from an SCM repository such as SVN or CVS, we can check it out directly as a Maven project. Usually, the Eclipse configuration resources are not committed on the SCM; even better, they are added to the .svnignore or .cvsignore files. This is because the m2e plugin is able to recreate all the necessary Eclipse configuration starting from the POM.

If our SCM repository is Subversion, we could install the Subclipse plugin from the Eclipse Marketplace by navigating to Help | Eclipse Marketplace…; just type subclipse in the search textbox and then select the appropriate plugin. In addition, we have to install the Maven SCM handler for Subclipse if we want to check out the Maven project directly, as we are about to show. We can install this component by navigating to Help | Install New Software…, adding the update site http://subclipse.tigris.org/m2eclipse/latest/, and finally selecting the Maven integration for the Subclipse checkbox, as shown in the following screenshot:

Installation of the Maven SCM Handler for Subclipse

At this point, we are able to check out the project by opening the SVN Repository Exploring perspective (by navigating to Window | Open Perspective | Other...), then right-clicking on the project folder and selecting the Check out as Maven Project… menu item, as shown in the following screenshot:

Check out from the repository exploring perspective

Alternatively, we can check out our projects directly by navigating to File | Import | Maven | Check out Maven Projects from SCM and then filling the SCM URL dropdown, as shown in the following screenshot:

Check out from the main menu

If our SCM repository is CVS, we can install the Maven SCM Handler for CVS using the update URL http://repository.tesla.io:8081/nexus/content/sites/m2e.extras/m2eclipse-cvs/0.13.0/N/0.13.0.201304101743/ and then proceed in a similar manner.