eclipse为web项目启动配置 [英] eclipse launch configuration for web project

查看:136
本文介绍了eclipse为web项目启动配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我右键点击我的项目,选择运行在服务器上运行正常。但我似乎无法在我的项目中移动运行配置( .launch 文件) - 当我去运行配置>服务器选项卡我看到启动配置tomcat,如果我运行它将启动Tomcat,但不显示我的网络应用程序的索引 - 如果我点击项目并选择运行在服务器上,则显示。

So I right click on my project and choose "Run on server" and runs fine. But I cant seem to be able to move the run configuration (the .launch file) in my project - when I go to run configurations > Server tab I see the launch config for tomcat which if I run it launches Tomcat fine but does not display the index of my web app - which is displayed alright if I rclick on the project and choose "Run on server".

$ {workspace_loc} \.metadata\.plugins\org.eclipse.debug.core\.launches 我有两个:

Tomcat v7.0服务器在localhost.launch

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.jst.server.tomcat.core.launchConfigurationType">
<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry containerPath=&quot;org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.7.0_03&quot; path=&quot;2&quot; type=&quot;4&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry externalArchive=&quot;C:/_/apache-tomcat-7.0.32/bin/bootstrap.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry externalArchive=&quot;C:/_/apache-tomcat-7.0.32/bin/tomcat-juli.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry externalArchive=&quot;C:/Program Files/Java/jdk1.7.0_03/lib/tools.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
</listAttribute>
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.7.0_03"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="start"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dcatalina.base=&quot;C:\Dropbox\eclipse_workspaces\javaEE\.metadata\.plugins\org.eclipse.wst.server.core\tmp1&quot; -Dcatalina.home=&quot;C:\_\apache-tomcat-7.0.32&quot; -Dwtp.deploy=&quot;C:\Dropbox\eclipse_workspaces\javaEE\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps&quot; -Djava.endorsed.dirs=&quot;C:\_\apache-tomcat-7.0.32\endorsed&quot;"/>
<stringAttribute key="server-id" value="Tomcat v7.0 Server at localhost"/>
</launchConfiguration>

和我的网络应用的.launch( ted2012.launch ): p>

and my web app's .launch (ted2012.launch) :

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.wst.server.ui.launchConfigurationType">
<stringAttribute key="client-id" value="org.eclipse.wst.server.ui.web"/>
<stringAttribute key="launchable-adapter-id" value="org.eclipse.jst.server.tomcat.web"/>
<stringAttribute key="module-artifact" value="org.eclipse.jst.jee.server:ted2012//"/>
<stringAttribute key="module-artifact-class" value="org.eclipse.wst.server.core.util.WebResource"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/ted2012"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="4"/>
</listAttribute>
<stringAttribute key="server-id" value="Tomcat v7.0 Server at localhost"/>
</launchConfiguration>

然而,在我的发布中不会出现:

which however does not appear in my launches :

推荐答案

我在WTP论坛和得到


服务器启动是不同的。每次启动服务器时,根据您的服务器配置创建/重新生成

现有启动的某些部分将被保留,例如VM参数,
,但是否则每次服务器
启动时,启动都将被替换。因此,不支持将启动文件移动到备用位置
。它总是最终在
org.eclipse.debug.core.launches下面。

Server launches are "different". The launch is created/regenerated based on your server configuration each time you start the server. Some pieces of an existing launch are preserved, such as VM Arguments, but otherwise the launch gets replaced each time the server is started. As a result, moving the launch file to an alternate location isn't supported. It always ends up under "org.eclipse.debug.core.launches".

仍在寻找这块文档中的信息 - 所以如果有人知道这一点,我可能会接受它作为答案 - 我也会接受一个受过教育的错误报告 - 因为情况至少有资格进行改进。现在关闭

Still looking for this piece of info in the docs - so if anyone knows this I might accept it as an answer - I will accept also an educated bug report - as the situation qualifies at least for an enhancement. Closing for now

这篇关于eclipse为web项目启动配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆