apache / apache/grails-core

Grails 5.0.2 - Cannot exclude views from Plugins - causes PluginException "Failed to initialize view [viewName] from plugin [pluginName]" in client application

Open
#12,213 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
Groovy
Stars
2.9k
Forks
975
Avg merge
1d 22h
Merged PRs (30d)
92

Description

I have a plugin that uses some GSP views for testing, and I do not want the views to appear in the plugin jar file.

I have constructed the build.gradle to exclude the compiled gsp classes, and added them to the pluginExcludes as documented in https://docs.grails.org/latest/guide/plugins.html.

The result is compiled classes are not in the jar as expected, BUT the views are still represented in the views.properties files in the gsp folder of the plugin jar.

That file seems to be getting used by BinaryGrailsPlugin.initializeViewMap in the grails-core plugin to initialise the plugin, and that throws the PluginException error because the class files do not exist for the views specified.

I think the problem is either view.properties should not contain the excluded gsp, or BinaryGrailsPlugin.initializeViewMap should be using the specified pluginExcludes to filter out the excluded gsp when it initialises the binary plugin

Contributor guide

Open the contributing guide

Research direction

Reproduce the plugin build using build.gradle and pluginExcludes, then inspect the generated views.properties in the plugin JAR. Trace BinaryGrailsPlugin.initializeViewMap to determine how excluded GSP views are retained. Done means excluded views no longer cause PluginException during plugin initialization.

Written by the indexing model from the issue text.

Assessment

Tech stack
groovy
Domain
backend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.