Good news: Yes, it is possible.
The bad news is a little hairy.
There are at least two ways:
- As Dylan suggested, change the Grails build to host your existing application with some tweaking.
- Create another Ant target that combines the existing WAR file with the WAR file created by Grails.
The first option, modifying the Grails assembly. The risk is that when a version of Grails is updated, a custom and modified build of Grails may not work at all, and you will not end here or there. Correcting this will require in-depth knowledge of how a structure generates an assembly. Since this is your initial encounter with the new structure, the learning curve may be too steep.
I would prefer the second, since you do not need to spoil the Grails assembly. You need to know how web.xml setup works. I assume that you already have this knowledge, since you already have your own Ant build. This is probably the path of least resistance.
The disadvantage of the second approach will be difficult to have an exploded WAR during development. But if you can separate the old application and the new application without requiring them to be tested together during development, you will have a good time to develop in Grails using their lightweight development server.
The next step will cause the old application to work under Grails as a Java component called by Grails.
source share