springboot项目目录结构
打包模块需要进行的配置
-
配置文件引入打包插件
<build> <finalName>api</finalName> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId>
</plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <configuration> <skipTests>true</skipTests> </configuration> </plugin> </plugins> </build>
-
模块的启动类
@SpringBootApplication public class RootApplication extends SpringBootServletInitializer { public static void main(String[] args) { SpringApplication.run(RootApplication.class, args); } @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { return application.sources(RootApplication.class); } }
-
配置文件