DEV Community

Cover image for Debugging gradle plugins
Farix
Farix

Posted on

3 4

Debugging gradle plugins

I recently had issues using the axion-release-plugin and wanted to debug the gradle plugin. But all manuals which you can find via google here or here failed because the argument --no-deamon was unknown.

After some digging in the gradle documentation, if found that Dorg.gradle.daemon=false can be used instead.

So to debug your gradle task from a plugin:

  1. Clone the code of the gradle plugin in the specific version of use.
  2. Ensure the plugin code is recognized as source code by your IDE. Maybe you need to start gradle sync or import the project
  3. In your project run ./gradlew myTaskToDebug -Dorg.gradle.debug=true -Dorg.gradle.daemon=false --stacktrace the --stacktrace is optional
  4. Add a remote debug run configuration in your Intellij to the gradle plugin project configuration for the port 5005

4.Set your breakpoint in the plugin code
5.Run your new configuration as debug
6.Happy debugging

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay