diff --git a/emacs/.emacs.d/config/init-ide.el b/emacs/.emacs.d/config/init-ide.el index a94d099..f7b0572 100644 --- a/emacs/.emacs.d/config/init-ide.el +++ b/emacs/.emacs.d/config/init-ide.el @@ -214,7 +214,21 @@ ;; Debugger interface (use-package realgud - :defer t + :defer t) + +(use-package realgud-jdb + :commands realgud:jdb-maven :config + (defun realgud:jdb-maven () + "Runs realgud:jdb, setting the classpath from Maven." + (interactive) + (let ((default-directory (project-root (project-current)))) + (when (not (locate-dominating-file default-directory "pom.xml")) + (user-error "Not a Maven project.")) + (with-env `(("CLASSPATH" . + ,(s-trim + (shell-command-to-string + "mvn -q exec:exec -Dexec.executable=echo -Dexec.args=\"%classpath\"")))) + (call-interactively #'realgud--jdb))))) (provide 'init-ide)