【发布时间】:2013-03-12 07:47:19
【问题描述】:
我正在使用 Maven 和 Eclipse 开发一个 Web 应用程序。我还使用 m2e 插件 及其 wtp 连接器即时将更改发布到服务器中。这些插件在 Maven 的目标文件夹中创建一个文件夹,名为 target/m2e-wtp/web-resources。
我的问题是当我从我的项目中编辑一个 xhtml 文件并链接到另一个文件时,当我通过它时,ctrl+click 将我带到这个目标文件夹,当我显然想要转到 webapp 目录中的文件。如果我尝试编辑该文件,Eclipse 会警告我这是一个派生文件。
有没有办法避免这个问题?
已编辑
这是我项目的类路径内容:
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources/bundles"/>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources/classes/interna"/>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources/hibernate-mappings"/>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources/styles/headers/premium"/>
<classpathentry excluding="**" including="**/*.java" kind="src" output="target/classes" path="src/main/resources/styles/css/premium"/>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
【问题讨论】:
-
你能发布你的 .classpath 文件的内容吗?
-
@Samuel EUSTACHI 完成。
-
这是一个非常复杂的 .classpath,但我在这里看不到问题。
-
我可以建议在 NAVIGATOR 视图中搜索字符串“web-resources”以找到罪魁祸首(我假设您的项目性质之一的配置文件在这里搞砸了)
-
我能找到的只是这行
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>到不同的配置文件中。我猜这只是意味着资源将在那里部署。
标签: eclipse maven m2e eclipse-wtp