[英]Eclipse deletes files/folders from deploy path during build
我在eclipse webapp
和serviceImpl
有兩個maven項目。 webapp
引用serviceImpl
。
當在Eclipse中關閉serviceImpl
項目並在Tomcat上構建並運行webapp
時,應用程序運行正常。 但是當我在serviceImpl
打開時運行webapp
時,我收到錯誤,即HTTP Status 500 - Configuration problem: Failed to import bean definitions from URL location [classpath:META-INF/serviceimpl-context.xml]
。 如果我查看機器上的META-INF
文件夾,我看到eclipse已經刪除了xml文件。
當我在命令行或IntelliJ中構建並運行應用程序時,問題也不會出現。
在eclipse中, webapp
的Deployment Assembly
設置包含open serviceImpl
項目和對某些serviceImpl-2.0.0-SNAPSHOT.jar
source
引用。
此外, Java Build Path
- > Libraries
- > Maven Dependencies
具有serviceImpl
節點:
我們也在使用Spring Application Context。
編輯:
當我在命令行上執行時:
mvn clean install -P build-modules-test -Dmaven.test.skip=true
然后創建xml文件,應用程序正常工作。 但在eclipse中“右鍵單擊項目 - > Maven - >更新項目”會刪除這些文件,但不會再次創建它們......所以發生錯誤
正如我評論的那樣,“更新項目”與mvn install
:文件是在包更新期間未調用的包階段創建的。
請參閱“ 使用Eclipse和Maven進行開發/運行Maven構建 ”
您可以使用所需的所有參數定義“啟動執行”設置:
然后,您確定執行與通過mvn install
在命令行中完成的階段相同的階段。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.