Not sure what's exactly your goal, but what you need to make it work is just understanding of what @SpringBootApplicstion and @ComponentScan annotations do. Here's first Google result with some nice self explanatory examples https://www.baeldung.com/spring-component-scanning https://spring.io/guides/gs/spring-boot/ (See text that starts with SpringBootApplication is a convenience annotation that adds all of the following..... )
the goal is to run UI with client, for now the program is running if I put @ComponentScan on main class, but UI doesn't work at all, as you can see my screen above
thanks for links, I'll investigate it👍
Not sure what is "UI" here and what is "client". Do you want to have 2 different spring boot applications in single project? That won't work
yes, you're right I have client and UI in the same project, it actually works, but without db logic
Your UI in essence depends on the client is my understanding correct? Are those Java modules or are they just two separate projects which you call "modules" because of intellij nomenclature? I saw your repository is in client and you're perhaps using auto wired somewhere in the UI for the repository?
Man, sharing IDE screenshots won't work. Nobody cares how IDE sees it)) How the spring boot jar is being built - it's the only thing that matters
okay, I'll share the project for easier understanding, no prob
There are two jars is what I understand from his project structure so far based on screenshots and the poms shared.
And I see it differently - 2 main classes in one sub-project, and no main classes at all in other one. Screenshots are useless for such kind of things )) We may guess for ages)
Imo all that you need to do is add dependency of your client in the UI and the client shouldn't be a spring boot application it should be a library for your UI. Not sure what exactly what you wanna achieve by extracting client logic separate but whatever I've said above is my take on your issue.
Обсуждают сегодня