Ninja Framework : Debugging via Eclipse and m2eclipse plugin - jetty:run does not start the server, builds instead

92 Views Asked by At

We are instructed to do the following (while using Eclipse)

And if you make a left click on your project you get the option “Debug as…”. Hit that and generate a profile that debugs the goal jetty:run.

https://www.ninjaframework.org/documentation/debugging.html

However, when we do the jetty:run, we simply build the project, and the project does not start. Furthermore, when we run with ninja:run, the debug does not stop at breakpoints.

What I need is a debug-mode that stops at breakpoints.

How do we fix this ?

1

There are 1 best solutions below

0
3xCh1_23 On BEST ANSWER

The answer is in the Ninja Framework source code, and the new versions of a Jetty... and therefore, there is (probably) no answer without recompiling the whole framework to fix the issue. I have tried diff-ing the projects, but could not see anything that would fix the higher versions. Up until the version 6.4.0 (inclusive) running the command mvn jetty:run starts the server. Any other version that is higher than 6.4.0 just builds the project and then stops.

So, one of the solutions is to simply start a new project using the old-version code executing:

mvn archetype:generate -DarchetypeGroupId=org.ninjaframework -DarchetypeArtifactId=ninja-servlet-archetype-simple -DarchetypeVersion=6.4.0

Another solution is to deploy (Jetty or Tomcat server) and try to debug the deployed jar/war file.

The first solution is simpler, however, the second one is more proper.

At the time of writing, the latest version is

<ninja.version>6.6.1</ninja.version>
<jetty.version>9.4.18.v20190429</jetty.version>