繁体   English   中英

Jenkins的工作是从多模块Maven项目中部署War文件

[英]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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM