I didn't see anything that directly addressed my issue, I am sure it is simple since I am new at this and am having a hard time trying to get my head around what might be going wrong.
I created a simple plugin that has one, enum class in it. It is actually a working class copied from my existing application to the appropriate path in the plugin. The class is removed from the application. I build the plugin, install it and can see it doing grails list-plugins.
In my application I reference it (compile ":myplugin:1.0").
When I compile/run-app the application throws a compile error "unable to resolve class MyEnum".
All the plugin examples seem to indicate this should be easy. :/
So to summarize:
- grails create-plugin myplugin
- Move simple enum from another application path src/xxx/MyEnum.groovy to the plugin path src/xxx/MyEnum.groovy
- grails maven-install
- Alter BuildConfig of application to include compile ":myplugin:0.1"
- run-app... get compile error that the enum cannot be found (by a controller in the app that uses it).
Am I missing something major? I must be.
I am doing this in an attempt to see if I can separate out part of our domain objects into a plugin, along with some of their dependent classes.
---- UPDATE ----
Seems like a dependency issue. I am making incremental changes (to test as I go) with the plugin. I package and install it, but it seems like the grails app is not picking it up fresh even when I use refresh-dependencies. It seems like I am forced to increment the version number of the plugin with each change in order to get the application project to pick it up fresh?
find) if there is something around. if in doubt change the version of the plugin and try again -- or delete previous version in your m2 local repo AND the ivy cache. also it issrc/groovy/<package>/MyEnum.groovy, right? - cfrick