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
Conferences
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

Remote debugging

For a developer, remote debugging is a must-have feature for any build system. Why do we need remote debugging for a build system? This is extremely useful when you run your tests through the build itself. If any of the tests fail during the build, you should be able to debug and pinpoint the problem. The following command will run Maven in the debugging mode:

$ mvn clean install -Dmaven.surefire.debug

When the build starts to execute tests, it will be paused to connect with an IDE. You can connect Eclipse, NetBeans, or your favorite IDE to port 5005 in order to start remote debugging. By default, Maven opens up port 5005 for remote debugging.

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Listening for transport dt_socket at address: 5005

The default listening port number can be changed by setting the value of address appropriately. When you set the value of the suspend variable to y, the Maven build will stop until an IDE gets connected to it. If you want the build to continue and connect the IDE later, then set the value to n. To get full control over the debugging options, you can use the following command:

$ mvn clean install -Dmaven.surefire.debug="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -Xnoagent -Djava.compiler=NONE"

Note

Refer to the corresponding IDE documentation to see how it can be remotely connected to an externally running process for remote debugging.

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