0
votes

I am at the point now that I am really thinking about using Maven for now one but my current development word is this.. I do alot of Java/Spring programming using Eclipse as my IDE and use tomcat for real time debugging and running the code. I been looking at a lot of examples on how to use Maven, Spring and Eclipse but none of them will let me debug my projects in tomcat right from Eclipse. setting breakpoints etc etc.

If I use Maven to start my project can I still used Eclipse and Tomcat and debug real time?

2

2 Answers

1
votes

You should install m2e plugin (maven plugin for Eclipse) and add 'WTP adapter for Maven'. After that if you create new maven project (File->New->Other->Maven Project) and choose 'maven-archetype-webapp' from the Wizard. Once project created you should be able just deploy it into Tomcat instance configured in Eclipse, run and debug it. This is what I do all the time.

0
votes

If you're using the Maven Tomcat Plugin (i.e. bootstrapping Tomcat via Maven), you can set MAVEN_OPTS to pass any flags, including debug flags, on to Tomcat since it's running in the same process.

MAVEN_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,address=56066,suspend=n,server=y" mvn tomcat:run

This will allow you to debug the process by connecting to port 56066.

For more information regarding the Maven Tomcat Plugin, check out http://tomcat.apache.org/maven-plugin.html