1

我尝试设置 Jenkins 作业以部署我的多模块 maven 项目的战争文件。我的项目结构与此相当:

--Platform
 |-- Core
   |-- ...
 |-- Backend
   |-- BackendWeb
 |-- Frontend
   |-- WebFrotnend1
   |-- WebService
   |-- ...

我设法创建了一个从 SVN 检索根(平台)并使用 Maven 构建所有内容的作业。当我手动部署由这项工作构建的战争文件时,它们运行良好。

现在我想通过 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 存储库。

到目前为止,我还没有在网上找到解决此问题的方法。詹金斯是否有最佳实践来实现这一目标?

4

1 回答 1

0

I simply forgot to add the clean task before tomcat:redeploy. Don't know why it took ages to find the solution ;(

于 2013-06-06T12:01:59.130 回答