【发布时间】:2014-08-01 12:59:48
【问题描述】:
我正在寻找一种以编程方式在 jetty 中设置 spring 配置文件的方法,以便服务器上的 war 文件使用给定配置文件的应用程序,这是我的代码:
final WebAppContext context = new WebAppContext();
context.setLogUrlOnStart(true);
context.setWar("target/deployables/myapp-rest/myapp-rest.war");
context.setContextPath("/" + TEST_APP_CONTEXT);
context.setParentLoaderPriority(true);
server.setHandler(context);
server.start();
我尝试了几件事,但似乎都不起作用...我需要通过 -Dspring.profiles.active=myProfile
【问题讨论】: