Grails Inline Plugins: Cannot Upgrade a plugin that is configured via BuildConfig.groovy
Asked Answered
A

1

6

Our app is split into a main application and a few plugins. We're using inline plugins via the BuildConfig.groovy file. When it is time to WAR the whole thing up for production I'm getting the following message:

You cannot upgrade a plugin that is configured via BuildConfig.groovy, remove the configuration to continue.

And then Grails wants to uninstall the plugin because it can't find it in application.properties. But during development, having it in application.properties causes issues. So when we're ready to create a production WAR, how do we work around this without commenting the plugins in BuildConfig.groovy every time?

Abstractionism answered 23/6, 2011 at 18:15 Comment(0)
F
2

BuildConfig.groovy is read rather early in the run process, so not all of environment data is yet available. However, it is interpreted as a regular groovy script, so you could try taking advantage of the fact that the war task is run in production environment:

// BuildConfig.groovy
if (System.getProperty("grails.env") == "development") {
     // specify the inplace plugin normally here
}
Fromma answered 30/8, 2011 at 13:26 Comment(1)
I used this to work around a problem creating wars with inline plugins. However, I wish I didn't have the problem in the first place.Yorker

© 2022 - 2024 — McMap. All rights reserved.