No make options for groovy / grails projects = broken project

I have a grails project that imports a local plugin in buildconfig.groovy using a system variable. When I do a run configuration for something like "run-app", I have to add a VM option similar to -Dpluginpath=c:\path\to\plugin. This poses a problem for IntelliJ Idea's automatic make process. Since there is no way for me to pass in -Dpluginpath, it breaks when it finds a broken path in the buildconfig.groovy. The same problem happens when I use IntelliJ Idea to add a new domain or controller class.

Is there any way to add my variable to the automatic make command (idea-print-project-settings)?

Thanks!

0
2 comments

You have to create "grails-synch-jvm-options.txt" file with text "-Dpluginpath=c:\path\to\plugin" in the root of project. IDEA will use JVM options from this file when starts Grails process to synchronization grails settings.

1

Thank you for the great answer, Sergey. I got it to work for me by placing the file in the grails project root folder. It also requires the file to be in every plugin that also has the same variables in buildconfig. Is there a way to make the JVM options universal for an IDEA project?

Also, it doesn't seem to help for creating controllers or other things (right click on grails project and select new > grails controller).

Thanks!

0

Please sign in to leave a comment.