Grails – Plugin file not found for plugin project
If you have just renamed your Grails plugin project and getting this error “Plugin file not found for plugin project” and wondering – “What’s going on?”
Consider this. Grails is based on DRY principle. Convention over configuration. By convention, the plugin descripor file should end in the word “GrailsPlugin”
Most likely it would have happened that you wanted to rename AbcDef grails plugin to say Abc plugin
In the process, instead of renaming AbcDefGrailsPlugin.groovy file in your plugin root directoy to AbcGrailsPlugin.grooy, you might have mistakenly renamed it to just AbcPlugin.groovy. Since the word GrailsPlugin was not in the name, it was considered as the normal project instead of Plugin project.
If you look inside $GRAILS_HOME/scripts/_GrailsPluginDev.groovy file, you can see the following code snippet
metadataFile.name, "*GrailsPlugin.groovy",
In short, the solution is to rename the file and the class defined inside it to AbcGrailsPlugin.groovy
Grails Maven Integration
Note: Information provided in this post may get outdated soon, because Grails, it’s plugin and dependencies gets updated very frequently.
Today I was trying to integrate my existing grails application with Maven. I had hard time with it. I referred to the following information
- http://grails.org/Maven+Integration
- http://forge.octo.com/maven/sites/mtg/grails-maven-plugin/examples/mavenize-a-grails-app.html
The pom generated by the plugin was of Grails 1.1 and I was using grails 1.1.1 therefore I had to make the following changes in my pom.xml
<dependency> <groupId>org.grails</groupId> <artifactId>grails-crud</artifactId> <version>1.1.1</version> </dependency> <dependency> <groupId>org.grails</groupId> <artifactId>grails-gorm</artifactId> <version>1.1.1</version> </dependency>
Since I was using MySql I had to add this too
<dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>3.1.14</version> </dependency>
Also you need to add this
<dependency> <groupId>org.tmatesoft.svnkit</groupId> <artifactId>svnkit</artifactId> <version>1.2.3.5521</version> <scope>runtime</scope> </dependency>
If you are not using Acegi then this is all you need to do for Maven integration. If you are using Acegi then you might have to make some more changes. In my case, I was getting ClassNotFoundException for net.sf.ehcache.CacheException. I had to manually copy ehcache-1.3.0.jar from $MAVEN_REPOSITORY_HOME/repository/net/sf/ehcache/1.3.0 to $GRAILS_PROJECT_HOME/plugins/acegi/lib. It solved my issue and I was successfully able to run my grails app using mvn grails:run-app
As I said before, information in this post may get outdated very soon. But it solved my problem and it might solve your too.