Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering Apache Maven 3

You're reading from   Mastering Apache Maven 3 Enhance developer productivity and address exact enterprise build requirements by extending Maven

Arrow left icon
Product type Paperback
Published in Dec 2014
Publisher
ISBN-13 9781783983865
Length 298 pages
Edition 1st Edition
Tools
Arrow right icon
Toc

Table of Contents (11) Chapters Close

Preface 1. Apache Maven Quick Start FREE CHAPTER 2. Demystifying Project Object Model 3. Maven Configuration 4. Build Lifecycles 5. Maven Plugins 6. Maven Assemblies 7. Maven Archetypes 8. Maven Repository Management 9. Best Practices Index

Monitoring the build

The most popular way of starting a Maven build is by using the mvn clean install command. This will build all the Maven modules under your project and install the artifacts to your local repository. For a simple project, the entire build process will take less than a minute. However, for a large project, to create an online build with a clean repository could even take more than 3 hours: this is not an exaggeration. If you look at the WSO2 Carbon complete code base, the complete build process takes more than four hours to run with all the test cases. During a long-running build process, it is extremely important that we monitor the build properly.

Note

WSO2 Carbon is a framework that is written on top of OSGi to build servers. All WSO2 products, which are 100 percent open source and released under Apache 2.0 license, are built on top of WSO2 Carbon. WSO2 Carbon code base is available at https://svn.wso2.org/repos/wso2/carbon/.

The following screenshot shows an overview of the JVisualVM tool running a Maven build:

Monitoring the build

Note

JVisualVM is a Java virtual machine monitoring, troubleshooting, and profiling tool. To learn more about it, refer http://docs.oracle.com/javase/6/docs/technotes/tools/share/jvisualvm.html.

The JVisualVM tool that comes with the JDK distribution can be used to monitor a running Maven build. First, we need to start the Maven build and then start JVisualVM using the following command:

$ jvisualvm

This command will start the JVisualVM tool. Once the tool gets started, select org.codehaus.plexus.classworlds.launcher.Launcher from the Applications tab to monitor the running Maven build. You can gather many important statistics using JVisualVM, and based on that you can optimize your system resources for an optimal Maven build.

The following screenshot shows JVisualVM statistics of a running Maven build:

Monitoring the build
You have been reading a chapter from
Mastering Apache Maven 3
Published in: Dec 2014
Publisher:
ISBN-13: 9781783983865
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image