我正在使用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>