参考:http://zilongsky-gmail-com.iteye.com/blog/2032001
http://stackoverflow.com/questions/16280858/maven-profiles-and-tomcat-in-eclipse
maven profile 与 spring 的整合 参照 链接 1 没什么问题。链接1的最后一步可以参考链接2
我的环境是 maven 3 eclipse4.4.1
因为 web.xml中用到了 ${profiles.activation} 所以用 eclipse + tomcat(servers) 的方式 启动服务是有问题的。 需要在 项目的属性 maven 属性中指定 当前使用的 profile
至于为什么要用 eclipse servers中的tomcat 是因为 如果 用 maven tomcat 或者 jetty 的方式启服务的话 更改任何一个java类 或者别的 啥的 tomcat都会自动重启。当然可能有设置 我没找着。另一方面 eclipse servers tomcat用习惯了。
扫描二维码关注公众号,回复:
517239 查看本文章
当然你也可以不用以上这种方式。你可以全部依赖target 目录中的内容。编译打包好的内容web.xml肯定被替换了。只要根据需要调整 工程的 Deployment Assembly 属性即可