Showing posts with label grails. Show all posts
Showing posts with label grails. Show all posts

Tuesday, October 19, 2010

Spring security core build path problem

First time trying Grails 1.3.5, creating a new test project. Installing spring-security-core plugin (following the tutorial) and then importing the project to STS 2.5M1 and letting STS know that it's a Grail project (Configure->Convert to a Grails project... something like this). I was hoping for an easy ride here, expecting no errors since I haven't add anything, all are auto generated.

But as usual, with programming world, there ain't no such things as a bug/error free codes. I got compile errors like this in my LoginController.groovy.



I know that I'm missing org.springframework.security.core-3.0.3.RELEASE.jar release in this case and the shortcut to solve this is just to add the jar to the project build path. But, is this going to happen for each plugin jar that I'm going to use? and anyway I don't like the solution to put the jar manually on the build path, it does look an ugly solution.

Fortunately I find a menu to refresh Grails' dependencies and the good news is it works for me, no more compile errors. Here's the context menu that pops up when I right click on my project:



I think this is caused by me adding the plugin from command prompt and then importing the project in STS. Imho, if the plugin is added thru STS' grails command prompt it should works without refreshing.

Hmm... just remember that this is similar to when I add a new file to my project using my file manager. Eclipse can't see the file, until I refresh the project.

Tuesday, February 17, 2009

Running grails app in eclipse

Running grails app in eclipse actually is quite simple if... you know how.

Here's how :
- Import your grails app as existing project in eclipse
- Find {app-name}.launch in the project root and right click select Run As and the .launch configuration name
running-grails-app
- There's all to it :)

If you want to know how to debug grails app, see my previous post.

Debugging Grails

Debugging grails almost got me crazy. I followed as said, trying it many times. At last google led me to this link which shed some light.

Let's get to the point, here's how to enable debugging grails (groovy) :
- Add JDK's tools.jar to your project build path.

Yep, that's all.
Or I'll be more specific here :
- Open your project properties, go to Java Build Path
- On tab Libraries, Add External JARs.
- Pick tools.jar from your {JDK_HOME}/lib

Fyi, I'm using grails 1.0.4 and groovy eclipse 1.5.7.20081120_2330.