Can Spring boot based application's embedded jetty/tomcat also run external war file - spring

We are trying to evaluate following scenario (to support couple of legacy apps and new apps).
Team has developed application based on spring boot and working OK (using embedded Jetty ie. typical spring boot JAR)
We have couple of legacy small applications (Spring MVC/Apache Camel based) which were packaged as WAR .
WARs can not be placed into " src/main/resources" (application is already packaged)
We know that in spring boot we can specify external lib directory from where JARs are scanned and initialised.
Is there any way where we can provide WAR file to this spring boot application as runtime argument and it gets exploded-initialised-served (along side of spring boot app)
(This is not duplicate of How to run external war file with embedded tomcat of spring boot with gradle? .. We are having different scenario)

Related

Deploy spring boot applications

I know spring boot applications can be deployed to production environments as war files. But what is the typical way of deploying spring boot applications? Does it only require a jvm, not a container?
The Spring Boot Project Page states that Spring Boot makes it easy to create stand-alone, production-grade Spring based Applications that you can "just run".
Means by default, the Spring Boot maven or gradle plugin builds self-contained executable jars, that contain all dependencies and an embedded webserver, e.g. tomcat or jetty. The Spring Boot Getting Started doc gives you an introduction to that. Using this approach you just need a JVM to run your application. But you can also configure it to create war files if this is a better fit to your production environment.
Does it only require a jvm, not a container?
It can run anywhere Java is setup.
Spring Boot's use of embedded containers and why Spring chose to go the container-less route. Many of their main driving forces were ease of use while testing and debugging, and being able to deploy Spring-based Java applications to the cloud, or any other environment.
Rest can be found out in attached image.
Spring boot applications if they are serving web requests do require a container. You can either deploy them as a war inside a container such as tomcat/jetty. Or you can deploy them with embedded container, tomcat.

Spring Boot with maven war dependancy

I have Spring Boot web project with dependency to maven overlay war file which is also Spring web project. War is included in pom.xml.
How can I deploy that war along with Spring Boot application so I can use rest endpoints that belong to war file. I'm trying to start application from STS simply by running it as Java application. While application is starting, I can see only URLs that belong to Spring Boot project, but URLs that belong to war file are missing.
I believe Spring boot does not support that. See issue here
Try building a war and deploying it into a container.

How to set up Spring multi maven module using spring boot

I would like to evolve my Spring application with a better architecture. The technologies I'm using are : spring portfolio ( spring mvc, spring test, spring Web, spring core, spring rest...)
Today I'm using packaging to structure the different layers of my application: models, services, api and of course web where I have my controllers.
I would like to know how can I use the power of spring boot to make a multi module maven architecture with an xml spring configuration for a Web application. I read that spring boot have an embedded tomcat and since I'm using eclipse with a separate tomcat server I would like to deploy my application on it and I think that this can create a problem.
I already found some links on github with this type of projects most of them are not elaboring an architecture of a Web application and use a class for spring configuration with the embedded tomcat that spring boot offers.
Thank you
Ps: sorry for my bad English
What you mean by multi module. If you want to build your jar for multiple environment you can use maven profile for it. Spring boot is nothing but a spring project which ease the configurations for you.
Regarding deployment to your own server, you have to convert the jar to war. Read "What about the Java EE Application Server" section of below link.
https://spring.io/blog/2014/03/07/deploying-spring-boot-applications

Sprint Boot App (Fat JAR) Load external jars

I have spring boot application (fat jar). But i need to load some external jar's(which are not part of the fat jar). The external jar's contains some camel & spring components.
Currently when I try to specify the classpath(directory where the external jars are available), the spring boot #Componentscan isn't picking up those files.(java -cp xx)
How to tell the spring boot application to include the external directory where the jar's are available during #ComponentScan.
Appreciate you support

How to configure wily with spring boot application

I have created an application as spring boot application,Now i want to integrate this application with wily,where i ll passed wily parameter in application to configure application.
The fact that it's a Spring Boot application shouldn't make any difference. If you're using an executable jar file, you'll need to configure the agent when you launch the jar, for example:
java -jar my-app.jar -javaagent:<Agent_Home>/Agent.jar -Dcom.wily.introscope.agentProfile=<Path_To_Agent_Profile>
If you're deploying your Spring Boot application as a war file to a servlet container or application server, you'll need to be make the equivalent configuration changes. The documentation describes how to configure Tomcat.

Resources