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 packages to EJB module and injecting it with WAR module?
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 packages to EJB module and injecting it with WAR module?
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 thespring-boot-starter-parent
. Then it's would be possible to include theWAR
project into theEAR
one in the same way like any other.... now you can use all the Spring Boot starter dependencies in the usual way:
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
You need a parent project that includes a war project, which will be your spring boot project, and an ear project just for making your ear.
Parent will need to have the spring boot as its parent :
Your ear project is:
I have created a multi module gradle project including a spring RESTFul web services - EAR application name is - bluestone bluestone/settings.gradle -
bluestone-rest project structure is -
bluestone-rest/build.gradle
all the dependencies are imported from common libraries.gradle. common libraries.gradle is user ear bluestone/libraries.gradle
Within bluestone-rest, i have created three basic file to test a sample rest message -
finally build this EAR application using -
and deploy on WildFly application and then calling this service using postman -
Please let me know if any more details required. I shall push this code on git and will share the git link here.