Plugin - Category class not found

15 views
Skip to first unread message

dgaviola

unread,
Dec 4, 2011, 4:41:26 PM12/4/11
to Gaelyk
Hi,

I'm trying to write a very simple plugin to add some convenience
methods to the request and response objects. I have something like
this in the plugin descriptor:

...
import testproject.UtilCategory
...
categories UtilCategory
...

Where the UtilCategory.groovy file is located in src/main/groovy/
testproject.

The problem is that when I try to run the application, I get the
following error:


WARNING: Failed startup of context
com.google.appengine.tools.development.DevAppEngineWebAppContext@975ded{/,/
home/dgaviola/gaelyk/testproject/war}
org.codehaus.groovy.control.MultipleCompilationErrorsException:
startup failed:
utilPlugin.groovy: 1: unable to resolve class testproject.UtilCategory
@ line 1, column 1.
import testproject.UtilCategory


So I guess that the groovy classes are not part of the classpath when
initializing the plugins. Is that correct? Am I doing something wrong?

Thanks!

Diego

Guillaume Laforge

unread,
Dec 4, 2011, 4:59:24 PM12/4/11
to gae...@googlegroups.com
Hi Diego,

You have to compile the sources from src, so that they are available in WEB-INF/classes.
If you use the gradle build, a simple gradle compileGroovy or something like that should be enough.

Guillaume


--
You've received this message because you've subscribed to the Gaelyk Google Group.
To send an email to the group, please write to: gae...@googlegroups.com
To unsuscribe from this group: gaelyk+un...@googlegroups.com
To show more options: http://groups.google.fr/group/gaelyk?hl=en



--
Guillaume Laforge
Groovy Project Manager
SpringSource, a division of VMware


dgaviola

unread,
Dec 4, 2011, 10:42:12 PM12/4/11
to Gaelyk
That worked perfectly! I was assuming that the code was being compiled
when running the command gaeRun.

Thanks Guillaume!

Diego

> Twitter: @glaforge <http://twitter.com/glaforge>
> Google+:http://gplus.to/glaforge

Guillaume Laforge

unread,
Dec 5, 2011, 6:45:10 AM12/5/11
to gae...@googlegroups.com
Perhaps gaeRun should indeed check that the code from src is compiled!
I'll let the gradle plugin authors decide :-)

Guillaume

Benjamin Muschko

unread,
Dec 5, 2011, 7:18:44 AM12/5/11
to Gaelyk
I don't necessarily want to make the plugin tasks dependent on Groovy
compilation because this plugin can be used for other GAE projects as
well (like plain Java projects). I will have to think about this a bit
and let you know.

You can always run ./gradlew build gaeRun to make sure or extend your
build script by this: gaeRun.dependsOn(compileGroovy).

Ben

dgaviola

unread,
Dec 5, 2011, 8:56:14 AM12/5/11
to Gaelyk
Sounds good, I will extend my build scrip to make sure compileGroovy
is always performed when running the application.

Thanks!

Diego

On Dec 5, 9:18 am, Benjamin Muschko <benjamin.musc...@gmail.com>
wrote:

Guillaume Laforge

unread,
Dec 5, 2011, 9:37:18 AM12/5/11
to gae...@googlegroups.com
Benjamin, perhaps this extension of the gaeRun task could be integrated in the Gaelyk template project build script?

Guillaume

Benjamin Muschko

unread,
Dec 5, 2011, 5:15:21 PM12/5/11
to Gaelyk
Yes, definitely. I'd have to go through the other tasks of the plugin
and see which ones should trigger compilation as well e.g. gaeUpload
should probably do this as well. I will send a pull request in the
next couple of days.

Ben

Guillaume Laforge

unread,
Dec 5, 2011, 5:27:23 PM12/5/11
to gae...@googlegroups.com
Awesome, looking forward to it!

Reply all
Reply to author
Forward
0 new messages