Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pluginExcludes not honoured #9416

Closed
pledbrook opened this issue Nov 17, 2015 · 6 comments
Closed

pluginExcludes not honoured #9416

pledbrook opened this issue Nov 17, 2015 · 6 comments

Comments

@pledbrook
Copy link
Contributor

It seems that Grails 3 doesn't honour the packageExcludes property when packaging plugins. To demonstrate, try building the Hibernate Filters plugin. It excludes the domain classes, but these are still packaged in the plugin JAR.

There's no mention of pluginExcludes in the migration chapter of the user guide, so I assume it's still supposed to work. To be honest I'd prefer an approach that fits better with the Grails or Gradle model. It feels hacky. These classes should really be in the test source set.

@graemerocher
Copy link
Member

They have to be defined in build.gradle too. Since the build system no longer loads the plugin definition this is the only way. See for example:

https://github.com/grails-plugins/grails-cache/blob/master/build.gradle#L80

https://github.com/grails-plugins/grails-cache/blob/master/src/main/groovy/grails/plugin/cache/CacheGrailsPlugin.groovy#L73

@pledbrook
Copy link
Contributor Author

That doesn't entirely work because the domain classes are still added to the META-INF/grails-plugin.xml file. The application then complains about those missing domain classes if it has the plugin installed.

This should probably be documented in the migration guide too 😄

@graemerocher
Copy link
Member

As I said you need to define both in build.gradle and in pluginExcludes

@pledbrook
Copy link
Contributor Author

So the form of the pluginExcludes has changed? Because it's in there, but currently set to grails-app/domain/**. OK, so I've checked that the value needs to be changed to test/** and then it works. Thanks.

I think this should be left open as a documentation issue.

@pledbrook
Copy link
Contributor Author

I created a pull request for this.

@graemerocher
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants