0

I’m trying to upgrade some old code that used the Jetty plugin in Gradle. I would like to upgrade the Gradle version beyond Gradle v3.5, but Gradle v4.0 and above has the Jetty plugin removed. Unfortunately, we are now required to use Gretty.

I’m using IntelliJ. My problems with the newer Gretty plugin are:

  • JVM Args and System properties specified on the commandline have to be manually put into the Gretty configuration.
  • At least in IntelliJ, I could do out of the box debugging with the Jetty plugin, but need to run two executions including the app and the Remote, and use a different Gradle task for debugging (e.g. jettyRunDebug) with Gretty.

    What are the alternatives to Gretty? Anything that can substitute for the old Jetty plugin.

O.O.
  • 1,973
  • 6
  • 28
  • 40

1 Answers1

1

How about just skipping the Gretty plugin entirely and just using Unit testing?

See: https://stackoverflow.com/a/29759263/775715

Joakim Erdfelt
  • 46,896
  • 7
  • 86
  • 136
  • Thank you @Joakim-Erdfelt. Your suggestion certainly helps if one is using Jetty in the context of testing. Unfortunately, in my case I'm using it for development i.e. jettyRun, then once the server starts, I debug my code. While this may help others, it actually does not help me. – O.O. Feb 18 '20 at 04:19
  • Many projects use embedded-jetty (which is what Gretty plugin, jetty-maven-plugin, Official jetty-home, and jetty-distribution are all build on) to start a running Jetty instance with whatever configuration that they want. This includes webapps (war) files, and even complex multi-context war file groups. Using junit (or testng) to kick start this process for development and debugging is exactly how these projects get things done without a reliance on the build tool. – Joakim Erdfelt Feb 18 '20 at 10:01
  • Thank you @Joakim-Erdfelt. I guess that's a good suggestion to use embedded-jetty, but I have to do a bit more research on how to make it work in my particular project. – O.O. Feb 19 '20 at 18:34