title: 新增模块 permalink: /pages/010201/ article: false

date: 2022-02-09 10:50:01

新建模块

这里演示使用 Idea 创建一个新的子模块

选择 File -> New -> Module

新增模块 - 图1

选择 Maven -> Next

新增模块 - 图2

选择父模块 -> Finish

新增模块 - 图3

回到项目,在新模块中创建包

新增模块 - 图4

::: tip 如果包名和 System 模块 me.zhengjie 不一样,那么需要在 AppRun.class 中配置扫描路径,两个地方都需增加@ComponentScan及@EnableJpaRepositories。 :::

详见:新建模块后访问接口 404

给新模块起一个名字

新增模块 - 图5

最后在 System 模块的 pom.xml 的 dependencies 节点加入创建的子模块

新增模块 - 图6