Integrate Spring Boot in an EAR project

前端 未结 3 1279
傲寒
傲寒 2021-01-02 19:55

I have an existing war project created using spring boot. How to package it within an EAR which has an EJB module?

Is there any way to move the model and dao package

3条回答
  •  走了就别回头了
    2021-01-02 20:21

    You have to use the dependency management system.

    It allows you to set the parent of Spring Boot WAR module project to the different from the spring-boot-starter-parent. Then it's would be possible to include the WAR project into the EAR one in the same way like any other.

    
         
            
                
                org.springframework.boot
                spring-boot-dependencies
                1.5.2.RELEASE
                pom
                import
            
        
    
    

    ... now you can use all the Spring Boot starter dependencies in the usual way:

    
        
            org.springframework.boot
            spring-boot-starter-web
        
        
            org.springframework.boot
            spring-boot-starter-data-jpa
        
    
    

    The starter dependencies you've to specify at the module projects level, while the dependency management configuration may be specified at the both ones - around the whole EAR projects or individually on each of them, depending on the app requirements.

    Using Spring Boot without the parent POM

提交回复
热议问题