In Eclipse (Spring Source) Grails always build in production mode

淺唱寂寞╮ 提交于 2019-12-10 10:27:31

问题


When using Eclipse for your Grails projects the building of the war seems to be stuck in production mode.

If you want to deploy to an attached tcServer you simply right click on your project then choose “run as” ->“run on server”.

If you have your grails project set to “dev” (right click on your project then choose “properties”->”grails”->”run on server”) then you would expect the project to build a development war. You’d be wrong. You get a production build.

How do you get a eclipse to build a development war?


回答1:


Each Grails command has a default environment, e.g.

  • grails run-app => dev
  • grails test-app => test
  • grails war => production

You can override this default by supplying an argument -Dgrails.env=<environment>. So to build a war for the dev environment, run grails -Dgrails.env=dev war




回答2:


Don, What you say is correct for the command line. I'm referring to Eclipse.

I have solved the problem.

It seems there is a bug in Eclipse. If you want your app built (through Eclipse) as development then set the “dev” to “test”.

As it stands with you cannot get Eclipse to build a dev war. The version of eclipse I am using is Version: Indigo Service Release 1 Build id: 20110916-0149.



来源:https://stackoverflow.com/questions/8910418/in-eclipse-spring-source-grails-always-build-in-production-mode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!