IntelliJ How to define Run/Debug Configuration Templates per module?

3 days ago 8
ARTICLE AD BOX

Is it achievable in any way, shape or form, to be able to create a JUnit Run/Debug Configuration template that has VM argument -javaagent and it being applied to only one of many modules?

Basically, I have multiple modules and one is called acceptance-tests, and only in this module I am using an AspectJ weaver, thus needing an aspectjweaver -javaagent. In another module there are unit tests, but when running them from the IDE I don't want the VM argument with aspectjweaver -javaagent to propagate to these unit tests, because it only throws errors and nothing else.

I am using the IntelliJ's "green arrow" runner to run test in various places in various amounts, thus the need for the template, but it is completely unnecessary in other modules.

If need be, I can implement any other strategy that allows for restricting this VM argument to only one module. I tried attaching it to the currently running JVM, which works, but it is being attached after all classes are loaded so it doesn't weave anything...

Thanks in advance for any advice.

Read Entire Article