First of all I have to admit that I am fairly new to Grails & Groovy. I have an existing project that was created from command line using the grails create-app command.
I've also added a few dependencies into the BuildConfig.groovy file. It looks like this:
// specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes e.g.
// runtime 'mysql:mysql-connector-java:5.1.20'
I also have a few classes (lets say FundFetcher, FundParameter) inside the <ROOT>/src/groovy directory, which reference classes in the jars above. In addition to that, I have a groovy script which instantiate class A, and invoke some methods on it. This script lives inside <ROOT>/src/groovy
def fetcher = new FundFetcher()
The first problem is that I'm not quite sure on how I should import this grails project properly in Intellij. I'm coming from Maven, where to import a Maven project into Intellij, I just need to open the root pom file. So what I did to import this Grails project was:
1. Create new project.
2. Point my project to the existing Grails directory, and set the type as 'Grails' module.
Now I want to run my groovy script. But I got the following error:
Exception in thread "main" java.lang.ClassNotFoundException: org.codehaus.groovy.tools.GroovyStarter
at java.security.AccessController.doPrivileged(Native Method)
Looking at my module dependency, I have :
1. 1.6 (java)
2. Module source
4. Grails User Library
5. <project name>-grailsPlugin
When I look at grails-2.2.0, it clearly has groovy jar inside it:
Classes - /Users/foo/.gvm/grails/current/lib/org.codehaus.groovy/groovy-all/jars/groovy-all-2.0.5.jar
The other thing is.. shouldnt the list above include the extra dependencies that I have stated in my BuildConfig.groovy file, i.e.:
(and hopefully all the transient dependencies that are required by them)
Oh .. I am running Intellij 12.0.1, build 123.94
Thanks in advance for the help..