Grails Set Up Environment Variables - grails

I have followed the documentation with regards to setting Grails up on Windows, but for some reason it is not working. Any help would be much appreciated

Check out this solution:
shortly: just run once grails create-app myApp

Related

Grails ClassPath Error, when update to 3.2.1

After upgrading from 3.1.12 to 3.2.1 I get the following error:
Error:
ClassPathScanner - The application defines a Groovy source using the default package. Please move all Groovy sources into a package.
Caused by: java.lang.ClassNotFoundException: org.grails.datastore.gorm.plugin.support.ConfigSupport
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
The message seems clear, but I cannot find any source which don't have a package.
Can any body help me either with a solution or an idea how to debug it.
Thanks
It's probably BootStrap.groovy (under grails-app/init) or UrlMappings.groovy (under grails-app/controllers)
I had same error as OP #Torsten.
Per #Burt Beckwith's suggestion, ran grails console and ctx.grailApplication..... . It showed Bootstrap. So I moved Bootstrap.groovy from grails-app/init folder to grails-app/init/my/package/name folder where Application.groovy was.
When re-ran grails run-app the ClassPathScanner.... error is gone !
Thanks OP and Burt Beckwith to post question and answer. It helped me.
PS: I wanted to add comment to Burt BeckWith's answer, but I don't have enough reputation yet.

Groovy and Grails application development configuration

I have to create new application based on Groovy and Grails, versions are-
grails-2.3.6
groovy-2.1.9
For this what configuration is most suitable please help me...
GGTS, STS or Eclipse
java6, java7 or java8
I tried everything but no one combination is smooth and flawless for me. I got lots of error in each combination which I tried like
I tried these sets-
GGTS 3.5.1 and java7,java6
STS and java7,java6
Eclipse juno and java7,java6
I am new to this platform please help me out. thanks.. :)

How to get run-time arguments programatically in grails

I'm developing a sample grails application which runs in different environment. I will pass the environment name as runtime argument like below,
grail run-app –Denv=dev1
grail run-app –Denv=dev2
I need to get the environment name dev1 or dev2 programatically. I'll be using the values in GSPs. Kindly help. Thanks.
You can use grails.util.Environment :
println Environment.currentEnvironment.name

Grails hangs on command line

I just downloaded Grails 2.0.1.
Created a new project and then tried adding the mysql connector as per the documentation but Grails hangs at command prompt without any message. I tried to execute in verbose and stacktrace mode but it prints nothing.
I tried cleaning and re-executing but all the grails commands are getting stuck.
They don't print anything beyond "configuring classpath" message .
Please help.
Thanks
Cleaning .ivy cache helps
$HOME/.grails/ivy-cache
Had the same problem on grails 2.0.4.
The cause was one of the repos not responding and grails waits for it to timeout.
Setting log "verbose" in BuildConfig.groovy helped me find which repository caused the problem.
Try to add --offline to te command
$ grails clean --offline
worked for me, as I was stuck on configuring classpath due to unresolved dependencies.

How to pass arguments to Grails in command line?

I'm trying (Grails 1.3.7):
grails tomcat deploy -Dtomcat.deploy.username=abc
With no effect. Is it a correct syntax? I can't find it in documentation...
Have you tried moving the -Dtomcat.deploy.username=abc to be right after grails in the command? i.e.:
grails -Dtomcat.deploy.username=abc tomcat deploy
Two reasons why I suggest this:
In the past, I know I've had trouble declaring -D properties at the end of the command (like you're observing).
I know that grails -Dserver.port=xxxx run-app does work, since I use it often, and that's using the -D before any other arguments to grails.

Resources