Search code examples
grailsgrails-plugin

Grails 3: what is replacement for eventCreateWarStart in _Events.groovy


I am migrating a plugin from Grails 2.4 to Grails 3. I am facing to the following issue.

I tried to use eventCreateWarStart in _Events.groovy. Like we used to compile widgetset in our plugin's _Events.groovy file. But it seems this approach is not allowed in Grails 3.

I went through the specification and I have not found what is the replacement. Can anyone help?


Solution

  • In general you cannot use concepts from the old build 2.x build system and have to instead write a Gradle plugin.

    For example your requirements sound very similar to the asset pipeline plugin which modifiers Gradle's war task to include compiled static assets (see https://github.com/bertramdev/asset-pipeline-core/blob/master/asset-pipeline-gradle/src/main/groovy/asset/pipeline/gradle/AssetPipelinePlugin.groovy#L91)