合并 Spring 和 Grails 项目
我们正在开发一个后台应用程序,使用 Spring 和 Maven 作为配置管理器。 该项目或多或少分为两部分,其中之一仅用于管理数据库表中的数据。
现在有人发现了Grails,有了Grails,这项工作就很容易了,但我们不能放弃所有的工作并开始一个新的项目(其他部分照样就好)。
为此,我们正在尝试将两者合并。 我们已经配置了maven grails插件,现在我们可以获取依赖项并运行grails任务,虽然还不完美,但也差不多了。 我们遇到的大问题是项目的第一部分(Spring 部分)的目录结构与使用 Grails 的目录结构有点不同。 我们想要改变 Grails 部分的结构,但我们真的不知道该怎么做。 我们怀疑我们必须使用一些 (G)ant 来通过脚本更改目录结构,但我们不知道第一个,如何制作脚本,第二个 ,如何从 Maven 中使用它,最后将两部分合并。 两个部分的库是兼容的,因此将所有东西放在一起是可能的。
我不等待答案,但与 gant 脚本和 Maven 相关的东西会很棒。
作为第二个问题,有人尝试过做这样的事情吗? (将一个普通的 spring 项目与一个 grails 项目合并或扩展?)
谢谢大家。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我发现掌握 Grails 是一个非常好的演示比 Hello World! 稍微复杂一点的应用程序。
Grails 和遗留数据库。
华泰
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
您需要
grails-app/conf/Config.groovy
文件。在其中,添加或设置
grails.config.locations { }
到要将 spring 应用程序与主 gails 应用程序合并的位置。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.