Eclipse 与 tomcat - eclipse 修改 server.xml
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5485760/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Eclipse with tomcat - eclipse modifies server.xml
提问by Anvar
I use tomcat with eclipse in 'Use tomcat installation' mode. My problem is, that eclipse overwrites tomcats server.xml every time, and deletes my crossContext="true" elements.
我在“使用 tomcat 安装”模式下将 tomcat 与 eclipse 一起使用。我的问题是,eclipse 每次都会覆盖 tomcats server.xml,并删除我的 crossContext="true" 元素。
Should I use custom location? Or the eclipse setup is wrong?
我应该使用自定义位置吗?还是eclipse设置错误?
Thanks!
谢谢!
回答by JPS
You can edit the equivalent configuration files inside your "Server" project/folder in the eclipse workspace. Those are the configuration files with which eclipse is overwriting the ones found under your Tomcat installation.
您可以在 eclipse 工作区中的“服务器”项目/文件夹中编辑等效的配置文件。这些是 Eclipse 用来覆盖在 Tomcat 安装下找到的配置文件。
回答by schmmd
I have experienced a lot of pain getting Eclipse to interact nicely with Tomcat. I recently switched over to Jettyand I will never go back! It's especially easy to use if you use Maven as your build manager. If you use Jetty for development, you can still use Tomcat for deployment.
让 Eclipse 与 Tomcat 进行良好交互,我经历了很多痛苦。我最近切换到Jetty,我永远不会回去!如果您使用 Maven 作为您的构建管理器,它会特别容易使用。如果使用Jetty进行开发,仍然可以使用Tomcat进行部署。
回答by Vineet
If you want to preserve Tomcat artifacts then you can choose "Use Workspace Metadata" option. This option will copy all configuration files to "{workspace}/.metadata/.plugins/org.eclipse.wst.server.core" directory but still use the installed Tomcat Binaries for starting and stopping server. This is a neat way to have multiple server configs using a single tomcat.
如果要保留 Tomcat 工件,则可以选择“使用工作区元数据”选项。此选项会将所有配置文件复制到“{workspace}/.metadata/.plugins/org.eclipse.wst.server.core”目录,但仍使用已安装的 Tomcat 二进制文件来启动和停止服务器。这是使用单个 tomcat 拥有多个服务器配置的巧妙方法。