GORM fails to realize Domain classes from a plugin are GORM classes
<p>I am trying to use a Grails Project as a Plugin to basically have my domain classes in the Plugin and then use them in multiple Grails projects.</p>

<p>I've done this:</p>

<p>grails create-app web</p>

<p>grails create-app plugin</p>

<p>create a settings.gradle in the root directory of both projects with
include 'plugin', 'web'</p>

<p>then I added spring security to the plugin and used s2-quickstart to create a user and a role domain class and added some default users to the Bootstrap.groovy.</p>

<p>Starting the plugin project alone doesn't show any issues.</p>

<p>Now I added the plugin as a dependency to the web project:
compile (':plugin')
This way I can access the domain classes from the plugin inside the web project, it compiles fine. I added the spring config to the application.groovy and am now trying to use the domain classes from the plugin inside the web project.</p>

<p>Trying this however my project does not correctly start and it tells me this:</p>

<pre><code>java.lang.IllegalStateException: Either class [htcommon.HtRole] is not a domain class or GORM has not been initialized correctly or has already been shutdown. If you are unit testing your entities using the mocking APIs
</code></pre>

<p>as soon as my code tries to do new HtRole(...).save()</p>

<p>It seems the domain classes from the plugin are not recognized as GORM classes somehow. </p>