The task is to extend existing spring boot application and override some of the beans and deploy it in spring boot.
Kotlin language is used. So I have spring boot application (APP-A)
@SpringBootApplication
open class MyApp {
... //start staff here
}
And I have a module (MODULE-B) which extends some existing logic with dependency injection
open class ExtensionModule {
//... extension logic is here
}
for this module, spring autoconfiguration is used. So it should be registered in spring container
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
com.example.ExtensionModule
When I have the dependency in pom.xml(APP-A) on MODULE-B everything work just fine. My goal is to build a docker image without dependency in pom.xml, so in such case APP-A will know nothing about MODULE-B but the logic will be extended, like with old spring container classpath-xml based approach I tested with next Dockerfile
FROM openjdk:8-jre
ADD app-a.jar /usr/share/jvmservice/app-a.jar
ADD module-b.jar /usr/share/jvmservice/module-b.jar
ENTRYPOINT exec /usr/bin/java $JAVA_OPTS -jar /usr/share/jvmservice/app-a.jar
The result is that app-a is successfully launched, but no changes from module-b are applied. Is it possible to compose the docker image with two jars in one spring container, without explicit dependency?