Spring Boot is not compiling simple multi-modules project.
- THIS IS A MAVEN PROJECT *
The Project has 3 modules => module1, module2, module3.
- Module1 has a class called Module1Class.
- Module2 has a class called Module2Class.
- Module3 has a class called Module3Class.
Module3Class includes Module1Class, and lastly Module2Class.
When you compile the project from root, the compiler throws the following type of error:
package X.Y.Z does not exist
Link to Github project - please ask to be included as contributor.
https://github.com/offthecactus/sprinboot-nocompile
Comment From: snicoll
thanks for the report but I think the GitHub project you've created is private. Can you please make it public?
Edit: or add me as you've requested.
Comment From: offthecactus
Thank you, I have included you.
Comment From: snicoll
Thanks for the update.
Module 1 and Module 2 both produce an application jar (also called fat jar) with your code and all the libraries so that you can run them with java -jar
. These are not standard jar "library" that you can use as a dependency. The reference guide has a dedicated section about this and the Maven Plugin has a dedicated example.
Going forward, please ask questions on StackOverflow, as mentioned in the guidelines for contributing, we prefer to use GitHub issues only for bugs and enhancements.
Comment From: offthecactus
Just as a heads up, I have done the above and it has not worked for me.
I have been able to compile in another way, because I have both springboot and non-sboot modules in my project.
I hope this is not going too far...
Comment From: snicoll
I've pushed a branch (gh-24591
) on your repo with what is described in the documentation and things are working just fine for me.
Comment From: offthecactus
Sigh ... ok that works, but in consultation with a colleague I think we provided something too simple.
Please note - we do not request further assistance.
We just want to say we are creating an Uber Jar, because we do not like 500MB of libraries, and feel we could reduce the size. When we try the Uber Jar, the project does not simply build, as it is composed of spring-boot sub-project-modules, and other maven-based project modules, which are parents to that. We had to manually script our build to specification.
Thank you kindly.