Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

It is important for a developer to Remote debug the instance with maven goal without deploying to the App server.This tutorial shows how to debug the test run.

Importing Source code to Intellij IDEA.

check out the source code from SVN repository.
Code Block
   svn co https://svn.apache.org/repos/asf/roller/trunk roller_trunk 
Creat IDE related project files.
Code Block
   mvn idea:idea
Click file -->open project

To add Remote Debug configuration (after you import the project).

Click on Run --. Edit Configuration.You will get a window titled run/debug configuration.Click on the + mark which appears on left top corner.Select Remote from the list

...

You have to give 2 parameters host & a port to use for debug . eg: Host : localhost , port: 5005 and then click ok.

Run maven command using command line.

Set MAVEN_OPTS environment variables with following command.
Code Block
 export MAVEN_OPTS='-Xdebug -Xrunjdwp:transport=dt_socket,address=5005,server=y,suspend=y'

Remember here you have to give the address which you gave as the debug port in IDE.

Run in command line

You need to navigate to weblogger-webapp folder first

...

You will observe in the command line that it listen for port 5005. (assuming address =5005)

Go to IDE and then click run--.debug and select the configuration we set. (roller-debug in our example).

If it is success you will get a message as, "Connected to the target VM, address: 'localhost:5005', transport: 'socket'." and you can observe that test run is being started in the command line.

...