Possibly undocumented but very cool behavior of Run/Debug compounds discovered.

Answered

I recently discovered that it is in fact possible to combine certain Run/Debug configs in any Compound configuration.

Until then the order in which those configs where executed seemed immutable.

An example use case: For a multimodule java project I wanted to separate the applications config itself (Application/Run config where simply a Main class is called, also a debugger parameter is attached to the JVM) from the build using maven (Maven/Run config).

Now I have two options. Rather first  I would make the Compound config shared and in an editor leave because it is already there inside the configuration element first the toRun element which is for the Application run config and next add to the former empty method element my desired maven call.

That is all needed for Option 1.

Option 2 would be more stable as documented elsewhere probably: adding both Run configs with the help of the GUI and then tricking around a bit as I'll show.

(First a picture of the compounds chaining, the GUI doesn't allow to change the order)

Important to say here is that I have added the following debugger parameter to the Applications Run config under "Environment Variables":

JAVA_TOOL_OPTIONS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=50005

It won't work otherwise.

Now when I run this Compound first the Application will be started suspended until I attach the debugger you see prepared in the screenshot above (debug-port 50005).

As soon as "FT skip Test" (like in the screenshot above) is completed I'll retrigger "internal: ..." in the left tab and then attach the debugger I configured as seen in the compounds screenshot above.

0

Please sign in to leave a comment.