Idea debug maven plugin code

I have read many articles about modal maven plug-in code, do not speak all the principles, is the meal up operation. You know the result, according to the article do, 90% will fail.

why?

Because principle do not speak, do not speak why. So today I will speak at why, and then come back operations.

 

 First maven provides two basic commands for us

In the bin directory maven you can see a mvn one mvnDebug

Our common operations such as mvn clean

If you want to debug mvnDebug clean

So how to communicate debug in two projects, java provides a protocol called the Java Debug Wire Protocol (JDWP) of

 

Above, communication and debugging process and, of course, this communication protocol and this should be a lot of details.

 

Understand the operation above, the configuration again, it is very directional

1, start listening

In the code project that you want to process mvnDebug clean

Listening for transport dt_socket at address: 8000

2, remote connection

Switch to the plug-in project (clean plug-in to download the source code)

 

 3, break point and debug

In the code break point where you want to debug, click debug, the code will be requested to break.

 

Guess you like

Origin www.cnblogs.com/turn2i/p/11823884.html