2013-03-12 16 views
3

我正在開發一個使用的網絡應用程序MavenEclipse。我還使用m2e插件及其wtp連接器來即時發佈更改到服務器。這些插件正在Maven的目標文件夾中創建一個文件夾,名爲target/m2e-wtp/web-resources阻止Eclipse針對/鏈接來自Maven目標文件夾的文件

我的問題是,當我編輯從我的項目的XHTML文件,並有一個鏈接到另一個文件,當我通過它做CTRL +單擊是把我送到這個目標文件夾,當我obviusly想去到的文件是webapp目錄。如果我嘗試編輯文件,Eclipse會警告我這是一個派生文件。

有沒有辦法避免這個問題?

EDITED

這是我的項目的classpath內容:

<?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> 
+0

你可以發佈.classpath文件的內容嗎? – 2013-03-12 09:47:17

+0

@Samuel EUSTACHI完成。 – 2013-03-12 10:41:40

+0

這是一個非常複雜的.classpath,但我在這裏看不到問題。 – 2013-03-12 12:54:19

回答

1

我使用工作集從Eclipse視圖排除選定的文件/文件夾。

您可以通過多種方式創建/修改/選擇工作集,例如:在工程資源管理器的工具欄上,單擊「查看菜單」按鈕打開顯示選項的下拉菜單;您可以從列表中選擇一個現有的工作集,或者通過選擇「新建...」來創建一個新的工作集。

+0

這可能是,但是我喜歡讓我的*目標*文件夾在項目中可見,以便保持m2e-wtp插件正在部署到我的服務器的控件... – 2013-03-13 08:58:43

+0

@Xtreme Biker:以前,我沒有仔細閱讀過您的題。你說你正在使用ctrl + click,而不是ctrl-shift-T或ctrl-shift-R(即「Open Type」和「Open Resource」對話框,可以使用工作集進行過濾而不影響Project Explorer)。不過,我添加了一個不同的答案,我希望它有幫助。 – Pino 2013-03-14 09:18:01

1

target/m2e-wtp/web-resources文件夾中包含「自動生成的資源」,例如過濾 web.xml中,所以在web應用程序目錄中的文件(如果有的話)可能不張玉峯到由Eclipse中打開一個。 但是請檢查"What is this web resources folder?",特別是"That web resources folder is causing me some trouble, can i get rid of it?"

+0

閱讀完第二個鏈接後,我只想嘗試一下,但無法在我的項目的Maven屬性下找到* WTP *部分。這發生在我的兩個Eclipse安裝中,* Juno *和* Indigo *。但是,如果我嘗試按Ctrl +在Eclipse Indigo中單擊,它會讓我在好文件和目標文件之間進行選擇。所以這個問題只發生在我的Juno安裝中,可能與我安裝的* JBoss工具*插件有關,它也有Maven的工具。不管怎樣,謝謝你。 – 2013-03-14 10:11:09

相關問題