[英]Jenkins job for deploying a war file out of a multi module maven project
我嘗試設置Jenkins作業以部署多模塊Maven項目的war文件。 我的項目結構與此類似:
--Platform
|-- Core
|-- ...
|-- Backend
|-- BackendWeb
|-- Frontend
|-- WebFrotnend1
|-- WebService
|-- ...
我設法創建了一個從SVN檢索根(平台)的作業,並使用Maven構建了所有內容。 當我手動部署它們時,由此作業構建的war文件可以正常工作。
現在,我想通過tomcat-maven-plugin創建僅用於構建和部署“ BackendWeb”模塊的作業。
為此,我嘗試創建另一個作業,該作業僅檢索單個模塊而不是整個項目,並執行tomcat重新部署目標。 乍一看,構建和部署似乎還不錯,但是在tomcat日志中,我看到了以下內容:
Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.myproject.core.service.config.ConfigurationService]
: Constructor threw exception; nested exception is java.lang.Error: Unresolved compilation problems:
The import com.myproject.core.config.ConfigEntry cannot be resolved
ConfigEntry cannot be resolved to a type
The method getByKey(String) from the type ConfigurationDAO refers to the missing type ConfigEntry
ConfigEntry cannot be resolved to a type
ConfigEntry cannot be resolved to a type
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:162)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:76)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:990)
... 69 more
Caused by: java.lang.Error: Unresolved compilation problems:
The import com.myproject.core.config.ConfigEntry cannot be resolved
ConfigEntry cannot be resolved to a type
The method getByKey(String) from the type ConfigurationDAO refers to the missing type ConfigEntry
ConfigEntry cannot be resolved to a type
ConfigEntry cannot be resolved to a type
我忘了什么嗎? 我不知道為什么這個版本不同於第一個工作的版本,依賴項應該來自同一個Maven存儲庫。
到目前為止,我尚未在網絡上找到此問題的解決方案。 詹金斯是否有最佳實踐來實現這一目標?
我只是忘了在tomcat:redeploy之前添加清潔任務。 不知道為什么要花很長時間才能找到解決方案;(
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.