多模块开发

1:

2:自增长

private final static AtomicInteger ID_GENERATOR = new AtomicInteger();

Integer id = ID_GENERATOR.incrementAndGet();
3:主模块配置
<modules>
<module>boot-module-web</module>
<module>boot-module-repository</module>
<module>boot-module-domain</module>
<module>test</module>
</modules>
<packaging>pom</packaging>
4:web层 依赖repository
<dependency>
<groupId>com.myimooc</groupId>
<artifactId>boot-module-repository</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
//同时继承主模块
<parent>
<artifactId>boot-module</artifactId>
<groupId>com.myimooc</groupId>
<version>0.0.1-SNAPSHOT</version>
</parent>
5:

原文地址:https://www.cnblogs.com/zyy1688/p/9605513.html