我正在尝试为本地开发部署一个 war 文件,我想修改 tomcat 的 context.xml 以通过 jndi 提供数据源。这在使用 tomcat7-maven-plugin
时有效:
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<contextFile>../../tomcat-test-context.xml</contextFile>
</configuration>
</plugin>
问题是,tomcat7-maven-plugin 不适用于我在项目中使用的叠加层,所以我必须使用另一种方法。我可以在 intellij idea 中部署 war 工件,但我没有看到任何选项可以像在 tomcat7-maven-plugin 中那样指定 contextFile。在intellij idea tomcat配置中是否有一些选项可以做类似的事情?
当然我可以修改
context.xml
在 catalina home 下,但我希望每个项目都配置它并且不想有很多 tomcat。该应用程序部署在生产中的 weblogic 上,我仅在本地使用 tomcat 进行测试。
最佳答案
不确定这是否会有所帮助,但我是如何做到的:
关于intellij-idea - 如何在Idea中的tomcat运行配置中设置context.xml,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46000440/