views:

274

answers:

2

We are developing an backoffice application using Spring and Maven as configuration manager. The project is moreless divided in two parts, and one of this parts is just for manage the data in the DB tables.

Now someone has discovered Grails, and with Grails this job is very easy, but we can't drop all the job and start a new project (the other part is fine as is).

With this, we are trying to merge both. We've configured maven grails plugin, and now we can get dependencies and run grails tasks, not perfect yet, but almost. The big problem we have is that the first part of the project (the Spring part) has a directory structure a bit different of the one wich uses Grails. We want to change de structure of the Grails part, but we really don't know how to do it. We suspect we must use some of (G)ant to change the directory structure with a script, but we've no idea of first, how to make the script, second, how to use it from Maven, and finally merging the two parts. The libraries of both parts are compatible, so it is posible that putting everything together the thing works.

I'm not waiting the answer but something related with the gant script and maven would be great.

As second question, has anyone tried to do something like this? (merge or expand a normal spring project with one grails project?)

Thanks all.

A: 

You want the grails-app/conf/Config.groovy file.

In it, add or set grails.config.locations { } to the locations you want to merge the spring app with the main gails app.

sal
With grails.config.locations you only can change the location of the properties files (which is not bad), but you can't change the name of the web-app dir to webapp for example. I think that to achieve this I've to change or create some of the grails scripts.
HED
you might want to check if there is a constant that points to the webapp directory and overide that in Config.groovy. If you're on unix, a symlink might be a workaround.
sal
+1  A: 

I found Mastering Grails a very good presentation of applications a little bit more complex than Hello World!.

"Slapping" a Grails application on top of existing Java classes is described in Grails and legacy databases.

HTH

Vladimir