Correct me if I’m wrong, but this is how I figured to mavenize a grails project:

1. Create the grails project.

2. Create the pom (optional, only if you want to have a more well defined pom at root. Else a very bare pom will be created in target. )

grails> create-pom com.example

3 Install plugin.

grails> install-plugin maven-publisher 0.8.1

4. Update BuildConfig.java

(optional, if you want to keep using the grails command prompt)

in BuildConfig.java:

grails.project.dependency.resolution = {

pom true

}

4. Call maven-install

grails> maven-install
————

*Just had to write it down step by step because currently, I’m mixing it all up. Hope this works.

Advertisements

OS: Windows 7

Problem:

Whenever I tried to install maven or grails, using the following environment variables:

M2_HOME = C:\Users\user\firstword secondword\maven-installation

Path=%GRAILS_HOME%\bin
for some odd reason, the command prompt couldn’t find the executable.

Associated error messages:

“mvn is not recognized as an internal or external command, operable program, or batch file.

Solution:

Remove the spaces in the path.

I renamed the folder where my grails download was found.
It worked.

Problem solved.

1. Where do you put your CSS files?

First to be able to use GWT Designer without the “There are no CSS files referenced from modules or HTML” error, you have to do this:

Second, to be able to use the css file during runtime, you have to reference it in your gsp page as well. Like this.

2. How come my create-gwt-page index.gsp does not work?

For some odd reason, index.gsp cannot be found, but if I renamed that to anything else, main.gsp or hello.gsp, it works.

This is what worked for me:

1. Download GWT SDK.

2. Go to Window -> Preferences -> Java -> Build Path -> Classpath Variables and click “New…”

3. Add GWT_HOME and point it in the path of the downloaded and extracted GWT SDK.

The answer can be found here:

https://groups.google.com/forum/?fromgroups=#!topic/grails-gwt/8hl245I69tM

It’s a bit amusing that the person who started the thread is a friend of mine. Thanks so much Ian! 😉

Long story short:

either downgrade to 1.3.7 version of Grails OR

“comment out the resources plugin from the plugins section of the BuildConfig if you want to omit it from your application. 

 

I was also able to keep the new resources plugin and make it work by adding this to my Config.groovy file:

 
grails.resources.adhoc.excludes = [‘**/gwt/**’] ” – 

 

To permanently add environment variables to Linux Mint 13:

1. Go to /home/[username] folder. (Click on Menu –> Home Folder)

2. Click on View menu item on the menu bar

3. Click on Show Hidden Files (You’ll see the shortcut key is Ctrl+H)

4. Right-click on .profile file, select “Open as administrator” sub-menu item.

5. add the export command at the very end of the document.

example:

export GWT_HOME=”/home/user/gwt-2.5.0.rc2″

export PATH=”$PATH”:$GWT_HOME

6. To see the effect of changes, you must first logout and then login again.

Developing on a Mac is hard. But I learned the value of environment variables and the PATH because of it. Thanks, Mac.

The answers can be found here (how to set environment variables): http://stackoverflow.com/questions/135688/setting-environment-variables-in-os-x

and here (how to set the path): http://serverfault.com/questions/16355/how-to-set-global-path-on-os-x

there’s a link in there which explains the “real answer” more. But it more or less says the same.