4

Can anyone please tell how to debug the code in eclipse with Cargo(Tomcat) plugin?

We are using Java 8, Tomcat 8, eclipse Juno in Windows 7 OS.

One other thing I want to mention is, we don't have control to modify Tomcat scripts as the tomcat is freshly getting installed from Nexus repository(or from local repo cache) for every execution of mvn -P dev clean package cargo:run.

whoami
  • 1,517
  • 1
  • 21
  • 29

1 Answers1

3

For debug Cargo, you can configure you container like by this:

<container>
  <containerId>tomcat4x</containerId>
  <home>c:/apps/jakarta-tomcat-4.1.30</home>
  <log>target/cargo.log</log>
  <logLevel>debug</logLevel>
</container>

If you want to debug container, then set JVM with this:

-Xdebug
-Xrunjdwp:transport=dt_socket,server=y,suspend=<suspend>,address=<port>
-Xnoagent
-Djava.compiler=NONE

More information about Cargo debugging is here.

I wrote a blog post about maven cargo plugin for using integration test. Maybe it will help you. http://hrabosch.com/2016/06/12/how-to-run-integration-tests-with-cargo-maven-plugin-in-a-separate-container/ There is Jetty, but you can change it to tomcat.

Hrabosch
  • 1,541
  • 8
  • 12