2017-09-20 64 views
0

我正在做一些eclipse插件開發,我已經生成了我的自定義類路徑,如<classpathentry kind="src" output="target/classes" path="src/main/webapp"/>,但是當我右鍵單擊 - > maven - > maven更新項目,它(M2E)將覆蓋我的類路徑爲M2Eclipse:如何避免M2E改變我的類路徑,而maven在工作區更新項目

<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/webapp"> 
     <attributes> 
      <attribute name="maven.pomderived" value="true"/> 
     </attributes> 
    </classpathentry> 

實際上,它會對我的業務造成很多問題。有沒有什麼方法可以配置或代碼注入以避免更改?任何幫助表示讚賞。

回答

0

pom(項目對象模型)的目的是有一箇中心位置來包含有關構建/類路徑的所有信息。更新maven項目時,pom.xml文件的信息將更新/覆蓋.classpath文件。

=>請勿手動修改.classpath文件,但應將信息包含在pom.xml文件中。

對於eclipse插件,您可能想要刪除項目的maven特性,因爲Eclipse插件有自己的方式來定義依賴關係,請參閱MANIFEST.MF