I have upgraded to Spring Boot 1.4.0 and my Maven project does not compile. Here is the scenario:
When I compile Module 2, I receive errors that the packages/classes do not exist (they exist in Module 1). Maven correctly set the class patch (jar from target of Module 1 is included).
When I change to Spring Boot 1.3.6, it compiles without any issues.
I checked the release notes for Spring Boot 1.4 and there is no information about any action to be performed in this area.
Have you observed the same behavior with Spring Boot 1.4?
I have such configuration to allow test execution. Both modules are microservices and I have tests for Module 2 which I want to execute without starting Module 1 as separate microservice.
You are using the fat jar of Module 1 as a dependency for Module 2. So you are basically embedding the full app from Module 1 in module 2. You shouldn't do that.
In 1.4, classes have moved to BOOT-INF/classes
so they aren't found anymore. I guess that's a nice side effect to let you know that your project setup is broken.
You should generate both a regular jar and an app jar (if you really need to) for module 1. Is module 1 an app? If it isn't, disable the spring-boot-maven-plugin
there. If it is, configure the classifier
option to generate two jars.
Change your layout to MODULE, ZIP layout seem to have change in 1.4.x. Zip layout will put all your project classes under BOOT-INF/classe/**, module will put your class on root.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With