新建module模块
新建一个单体的模块,并引入到system中使用!注意以下三步都是必须的,很多人会忽略掉第三步导致模块无法加载。
1.使用archetype命令新建module模块
- 请按照
包名规则 org.jeecg.modules.*进行初始化,不然bean扫描不到! - 执行mvn 命令生成erp模块, IDEA 可以直接图形化使用
- springboot3版本使用下面命令
// 注意: windows下可直接复制执行, Linux/Macos下 ^ 修改成 \
mvn archetype:generate ^
-DgroupId=org.jeecgframework.boot3 ^
-DartifactId=jeecg-module-erp ^
-Dversion=3.9.0 ^
-DarchetypeGroupId=org.jeecgframework.archetype ^
-DarchetypeArtifactId=jeecg-boot-archetype ^
-DarchetypeVersion=3.0
说明: -DarchetypeVersion=3.0版本号固定不需要修改,3.8.3根据自己项目的版本号进行调整。
- springboot2版本使用下面命令
// 注意: windows下可直接复制执行, Linux/Macos下 ^ 修改成 \
mvn archetype:generate ^
-DgroupId=org.jeecgframework.boot ^
-DartifactId=jeecg-module-erp ^
-Dversion=3.9.0 ^
-DarchetypeGroupId=org.jeecgframework.archetype ^
-DarchetypeArtifactId=jeecg-boot-gen ^
-DarchetypeVersion=2.0
说明: -DarchetypeVersion=2.0版本号固定不需要修改,3.8.1根据自己项目的版本号进行调整。
2.Module模块结构配置
如果你把新模块放到jeecg-boot-module目录下,参考下面jeecg-boot-module\pom.xml的配置

3.引入到system中
在jeecg-system-start/pom.xml中添加新模块的依赖,添加后重新加载所有Maven项目,此步骤很重要很多人会忽略掉,导致模块无法加载。
注意:springboot3与 springboot2的groupId不同,是org.jeecgframework.boot3
<dependency>
<groupId>org.jeecgframework.boot</groupId>
<artifactId>jeecg-module-erp</artifactId>
<version>${project.version}</version>
</dependency>