I am trying to consume the locally published expor...
# questions
u
I am trying to consume the locally published export-Plugin snapshot for grails 7. On startup of my demo consumer application I get the following startup error:
Caused by: grails.plugins.exceptions.PluginException: Failed to initialize class [grails.plugins.export.TestController] from plugin [export] : grails.plugins.export.TestController
...
Caused by: java.lang.ClassNotFoundException: grails.plugins.export.TestController
The controller in the plugin is for demonstration purposes only, so I tried to exclude it from the plugin:
Copy code
def pluginExcludes = [
      "grails-app/views/error.gsp",
"grails-app/grails/plugins/export/*"
  ]
and in build.gradle (presumably leading to the ClassNotFoundException above):
Copy code
jar {
    List excludes = ['UrlMappings', 'TestController']
    excludes.each {
        exclude "**/${it}*.class"
    }
}
What do I need to change so that my grails application does not try to instantiate the controller of the plugin (because it should not be there anyway)?
m
This looks suspicious, is the controller not in
grails-app/controllers/grails/plugins/export/*
? (note the missing
controllers
in your example)
Copy code
def pluginExcludes = [
    "grails-app/views/error.gsp",
    "grails-app/grails/plugins/export/*"
]
u
ah, yes, fixed that, but still does not work. the grails-plugin.xml looks like this:
Copy code
<plugin name='export' version='7.0.0-SNAPSHOT' grailsVersion='7.0.0 > *'>
  <type>grails.plugins.export.ExportGrailsPlugin</type>
  <authorEmail>grails.plugin.collective@gmail.com</authorEmail>
  <dependsOn />
  <author>Grails Plugin Collective</author>
  <documentation><https://gpc.github.io/export/></documentation>
  <description>This plugin offers export functionality supporting different formats e.g. CSV, Excel, Open Document Spreadsheet, PDF and XML 
and can be extended to add additional formats. 
</description>
  <title>Grails Export Plugin</title>
  <version />
  <grailsVersion>7.0.0 > *</grailsVersion>
  <license>APACHE</license>
  <pluginExcludes>[grails-app/views/error.gsp, grails-app/controllers/grails/plugins/export/*]</pluginExcludes>
  <issueManagement system='Github' url='<https://github.com/gpc/export/issues>' />
  <organization name='Grails Plugin Collective' url='<https://github.com/gpc>' />
  <name>export</name>
  <scm url='<https://github.com/gpc/export>' />
  <resources>
    <resource>grails.plugins.export.TestController</resource>
    <resource>grails.plugins.export.UrlMappings</resource>
    <resource>grails.export.Application</resource>
    <resource>grails.plugins.export.ExportService</resource>
    <resource>grails.plugins.export.ExportTagLib</resource>
  </resources>
</plugin>
m
This is an example from `grails-core`:
Copy code
def pluginExcludes = [
            '**/com/demo/**',
            'grails-app/views/**',
            '**/*.gsp'
    ]
u
Thanks for the pointers, this worked for me now:
Copy code
def pluginExcludes = [
        "grails-app/views/error.gsp",
		"**/grails/plugins/export/*Controller*",
		"**/grails/plugins/export/UrlMappings*",
    ]
👍 2