I found a solution. Spring context searches for the Main class and application.yml in the current module. If these files are missing in the current module - Spring context searches for them in the other modules and uses first available. As a result it found another Main class (not a MainServerApp). To fix this problem it is needed to remove all previous Main files OR create new Main class for the current module.