Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring boot Multiple Starter's

Tags:

spring-boot

I am starting development on a new spring boot app. Although I have had prior experience in working with boot, but this time we have been instructed to build the app by just using boot starters.

The technical stack is as follows:

  1. Spring MVC
  2. Spring Security
  3. Log4j2
  4. Eclipse Link
  5. Maven

App running on weblogic. ...... Etc

So I was wondering if it's ok to use multiple boot starters in a single app?

If yes then from the looks of it I might have to use around 4 starters to get where I want to be.

Any idea?

like image 657
dmohapa Avatar asked May 12 '17 01:05

dmohapa


People also ask

Can we have multiple @SpringBootApplication?

So yes, this is expected behavior given your project setup. Put each @SpringBootApplication class in a separate subpackage if you don't want this to happen for local testing.

What are the advantages of starter POMs?

The advantages of using Starters are as follows: Increase productivity by decreasing the Configuration time for developers. Managing the POM is easier since the number of dependencies to be added is decreased. Tested, Production-ready, and supported dependency configurations.

Can spring boot create non web application?

The application can also be called as Spring Boot Standalone application. To develop a non web application, your Application needs to implement CommandLineRunner interface along with its run method. This run method acts like a main of your application.


1 Answers

You can build your app with any number of starters, with some restrictions i guess... you probably don't want to use tomcat and undertow starter in the same project for example :)

A starter includes dependencies for the given starter type along with auto-configuration to get you up and running in no time. You can read more here on starters.

Edit: some useful info on weblogic deployment, configuring log4j2 and eclipselink in spring-boot

This project should get you started with sufficient dependencies. (from start.spring.io)

like image 163
Pär Nilsson Avatar answered Nov 08 '22 22:11

Pär Nilsson