I have a multi-module maven project like this:
my-parent
--my-domain
--my-service
--my-app <<< this is a Spring Boot module
I want to run mvn spring-boot:run command directly from the parent module without having to cd into the 'my-app' directory first.
I figure this is related to configuration of the spring-boot-maven-plugin but I can't seem to get it right.
I have tried the following:
Use
spring-boot-starter-parentand otherwise default config withspring-boot-maven-pluginincluded in plugins section of my-app.
Runningmvn spring-boot:runfrom the parent results in:Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.4.2.RELEASE:run (default-cli) on project my-parent: Unable to find a suitable main class, please add a 'mainClass' property -> [Help 1] in the parent moduleDo NOT use
spring-boot-starter-parent.
Definespring-boot-dependenciesin depManagement as described elewhere.
Definespring-boot-maven-pluginin pluginManagement section of my-parent and include the plugin in plugins section of my-app module.
Running mvn spring-boot:run from the parent results in same error as #1:
Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.4.2.RELEASE:run (default-cli) on project my-parent: Unable to find a suitable main class, please add a 'mainClass' property -> [Help 1]Do NOT use
spring-boot-starter-parent.
Definespring-boot-dependenciesin depManagement as described elewhere.
Definespring-boot-maven-pluginin plugins section of my-app.
Running mvn spring-boot:run from the parent results in:No plugin found for prefix 'spring-boot' in the current project and in the plugin groups
In all cases described above, running mvn spring-boot:run from the my-app directory works fine.
I figure there should be a way to make this work. In a traditional non-Boot Spring project it was fairly simple to configure tomcat7 plugin such that i could run mvn tomcat7:run-war from the parent and the webapp sub-module would start as expected