Grails debug port not persisting
Answered
I'm attempting to debug two Grails 2.5.4 projects on my machine simultaneously using remote configurations. The first one is using 5005 (the default port) and is able to debug successfully. However, when I try to spin up the second one, using the VM arguments from the Remote configuration, it starts out using 5006 as I specified, but then after the Grails project is packaged, reverts to using 5005. Is there a setting I'm missing that is preventing the change to 5006 from persisting past the Grails packaging? Screenshots:
Remote config:

Grails config:

Message in console:

Please sign in to leave a comment.
Since you need to debug forked process, use
options to customize jvmArgs, see
https://youtrack.jetbrains.com/issue/IDEA-139709#comment=27-1011680 and https://stackoverflow.com/a/23502098/2000323
for examples.
Do not forget to synchronize IDE project structure after BuildConfigu.goory file changes.
Did that, now it's giving me a different error:
I added this to my BuildConfig.groovy as specified in the links you provided:
but now it's giving me the following error when I try to run it:
Try to configure forked debug only in BuildConfig, remove --debug-fork from Run/Debug Configuration.
Did that and it worked. Thanks!