Question

I try to setup Jenkins jobs for deploying war files of my multi module maven project. My Project structure is comparable to this:

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

I've managed to create a job which retrieves the root (Platform) from SVN and build everything with Maven. The war files built by this job are working fine when I deploy them by hand.

Now I want to create a job for building and deploying for example only the "BackendWeb" module by means of the tomcat-maven-plugin.

To achieve this I've tried to create another job, which simply retrieves the single module and not the whole project and execute the tomcat redeploy goal. At first sight the build and deployment seems fine, but in the tomcat logs I see the following:

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

Did I forgot something ? I don't know why this build is different from the build of the first job, the dependencies should be taken from the same maven repository.

So far I did not find a solution for this issue on the web. Is there a best practice in Jenkins to achieve this?

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top