From 83895f0f7a784225333c99a194009e7f9b7c7406 Mon Sep 17 00:00:00 2001 From: Chris Vest Date: Tue, 9 Feb 2021 11:47:32 +0100 Subject: [PATCH] Add a profile for debugging tests that run from Maven (#11011) Motivation: In some cases, Intellij struggles to recreate the build and test environment/configuration that Maven produces, and this can lead to tests behaving differently when run from Intellij compared to when they run from Maven. This in turn can make debugging those tests harder. Modification: Add a profile to the Maven build, that will add the necessary command line arguments for attaching the Intellij debugger to tests that are executed from Maven. Result: It is now possible to debug the tests that Maven is running, from Intellij, by enabling the -PijDebug Maven profile. --- pom.xml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pom.xml b/pom.xml index 3c83fd8615..bb2ec25ec9 100644 --- a/pom.xml +++ b/pom.xml @@ -297,6 +297,12 @@ -Dio.netty.noUnsafe=true + + ijDebug + + -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=*:5005 + + coverage @@ -362,10 +368,12 @@ 1.4.11.Final 2.0.10 "${settings.localRepository}"/org/mortbay/jetty/alpn/jetty-alpn-agent/${jetty.alpnAgent.version}/jetty-alpn-agent-${jetty.alpnAgent.version}.jar + -server -dsa -da -ea:io.netty... -XX:+HeapDumpOnOutOfMemoryError + ${argLine.ijDebug} -javaagent:${jetty.alpnAgent.path}=${jetty.alpnAgent.option}