eclipse launch configuration for web project

2019-04-13 06:10发布

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".

In ${workspace_loc}\.metadata\.plugins\org.eclipse.debug.core\.launches I have both :

Tomcat v7.0 Server at 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>

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 :

eclipse launches

1条回答
做自己的国王
2楼-- · 2019-04-13 06:52

I asked in the WTP forums and got

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

查看更多
登录 后发表回答