我的maven项目结构:

我的问题是,我只需要运行父模块,自动实例化子模块(tomcat服务器)。弹簧引导多模块项目有可能吗?
注:我正在使用STS。父包是pom,子模块打包是jar文件。
我的父pom文件
">http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0
<groupId>com.test</groupId>
<artifactId>test-parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<name>test-parent</name>
<description>testproject for Spring Boot</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.7.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<modules>
<module>userService</module>
<module>authenticationService</module>
<module>dataLayerService</module>
</modules>
我的问题是如何使用tomcat运行父项目?如果我运行父项目,子模块是否会自动运行?
提前谢谢!
发布于 2017-10-16 16:46:45
我已经将所有的微服务配置在一个坞-撰写文件中。使用docker-compose命令启动所有模块。(将一个微服务作为服务,而其他则是子微服务)。
https://stackoverflow.com/questions/46603473
复制相似问题