Thursday, September 29, 2011

grails (un)install-plugin not cleaning up properly

It could be just me, but some plugins for grails don't work so well. For one of my grails projects, I had maven-publisher installed. When I saw that the release plugin is to replace maven-publisher plugin in the future, I thought I'd try it out. For the record, I had maven-publisher 0.8.1 installed. So, I did:
grails uninstall-plugin maven-publisher
grails install-plugin release
All seemed ok. It installed release plugin 1.0.0.RC3. There I tried this:
grails maven-install
It gave me this NPE bug:
java.lang.NullPointerException: Cannot get property 'file' on null object
Thankfully this bug was already logged and a patch attached too. See for more details. Anyway, I decided to go back to the old maven-publisher for now. So I did:
grails uninstall-plugin release
grails install-plugin maven-publisher
Now, I was trying to maven-install again, and I get this error:
Dependencies resolved in 2207ms.
Running script /home/tlee/.grails/1.3.7/projects/myhumbleproject/plugins/maven-publisher-0.8.1/scripts/MavenInstall.groovy
Error executing script MavenInstall: No such property: releasePluginDir for class: MavenInstall
groovy.lang.MissingPropertyException: No such property: releasePluginDir for class: MavenInstall
	at MavenInstall$ Source)
	at gant.Gant.prepareTargets(Gant.groovy:606)
Error executing script MavenInstall: No such property: releasePluginDir for class: MavenInstall
I tried this:
grails clean
grails war
It asked if I wanted to uninstall svn-1.0.0.M1 which was installed by release plugin before. I said yes, and grails war script continues and builds the war file. I run:
grails maven-install
and I again get the same error as before. I tried removing entire $HOME/.ivy2/cache folder, and I still got the same error. And then, I tried removing entire $HOME/.grails/1.3.7/projects/myhumbleproject/ folder. Then:
grails maven-install
resulted in grails asking me back for clarification.
Running pre-compiled script
Script 'MavenInstall' not found, did you mean:
1) UninstallPlugin
2) InstallPlugin
3) InstallDependency
4) InstallTemplates
5) Init
Please make a selection or enter Q to quit: Q
Ha! Ok. I ran:
grails war
grails maven-install
Finally, it worked! It seems a compiled script remains even after uninstalling the release plugin.