Versions Compared

Key

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

...

1)Test Run using maven goal (mvn jetty:run).
2) Deploy the war file in a webapp , configure and then run.

(empty line)
It is important for a developer to Remote debug the instance with maven goal without deploying to the App server.In this tutorial Maven This tutorial shows how to debug the test run.

(empty line)

Importing Source code to Intellij IDEA.

...

Code Block
   svn co https://svn.apache.org/repos/asf/roller/trunk roller_trunk 

(empty line)

Creat IDE related project files.
Code Block
   mvn idea:idea

(empty line)

Click file -->open project

(empty line)

(empty line)

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

(empty line)

Click on Run --. Edit Configuration.You will get a window titled run/debug configuration.Click on the + mark which appears on right 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.

(empty line)

(empty line)

Run maven command using command line.

(empty line)

Set MAVEN_OPTS environment variables with following command.

...

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

(empty line)

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)

(empty line)

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.

(empty line)

(empty line)

Now it is time to add some debug points and continue debugging.

...