I would like to use a Java Spring-boot application as an API dependency for others non-Spring-boot Scala / Java applications.
From my understanding, this is possible.
I should be able to build a dependency JAR module with all my annotated beans, and import it in my main application. Then, to be able to use this dependency JAR, I think I will just have to convert my main application to a Spring boot application, adding annotation @SpringBootApplication to main class, and adding code "SpringApplication.run(Application.class, args))" in main().
I'm wondering about the practicality of this project, more specifically :
- Would it indeed be possible to directly use the @Configuration class of my dependency (or will I be forced to recreate a new class in main application) ?
- Would it be possible to import / use the Spring boot dependency without having to modify the main class of my main application (convert it to a Spring boot application) ? This is a bit of an issue for me, because I would like to use this API in the most easy way.