淄博易宝网站建设,小企业网站建设在哪里,wordpress索引,阿里巴巴网址1、首先创建springboot项目作为父项目
只留下pom.xml 文件#xff0c;删除src目录及其他无用文件 2、创建子项目
子项目可以是maven项目#xff0c;也可以是springboot项目 3、父子项目关联 4、父项目中依赖管理
?xml version1.0 encodingUTF-8删除src目录及其他无用文件 2、创建子项目
子项目可以是maven项目也可以是springboot项目 3、父子项目关联 4、父项目中依赖管理
?xml version1.0 encodingUTF-8?
project xmlnshttp://maven.apache.org/POM/4.0.0 xmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexsi:schemaLocationhttp://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsdmodelVersion4.0.0/modelVersion
!-- 继承的springboot版本--parentgroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-parent/artifactIdversion2.6.3/versionrelativePath/ !-- lookup parent from repository --/parent!-- 引入子模块 --modulesmodulesystem/modulemodulegateway/modulemodulecommon/module/modulesgroupIdcom.matter/groupIdartifactIdrecord/artifactIdversion0.0.1-SNAPSHOT/versionnamesyh_matter_record_server/namedescriptionsyh_matter_record_server/descriptionpackagingpom/packaging!-- 作用公共依赖引入使用场景基本所有子模块都用到的依赖--dependenciesdependencygroupIdorg.projectlombok/groupIdartifactIdlombok/artifactId/dependency!-- jdbc依赖包 --dependencygroupIdmysql/groupIdartifactIdmysql-connector-java/artifactId/dependency/dependencies!-- 版本管理 --propertiesjava.version1.8/java.versionspring.cloud.version2021.0.1/spring.cloud.versionspring.cloud.alibaba.version2021.0.1.0/spring.cloud.alibaba.versionmybatis.plus.version3.4.3.4/mybatis.plus.versionfastjson2.version2.0.9/fastjson2.versionpagehelper.version1.4.3/pagehelper.version/properties!-- 作用依赖版本生命不做依赖引入。使用dependencyManagement统一管理项目的版本号确保应用的各个项目的依赖和版本一致不用每个模块项目都弄一个版本号不利于管理。 --dependencyManagementdependencies!-- spring-loud --dependencygroupIdorg.springframework.cloud/groupIdartifactIdspring-cloud-dependencies/artifactIdversion${spring.cloud.version}/versiontypepom/typescopeimport/scope/dependency!-- 阿里微服务 --dependencygroupIdcom.alibaba.cloud/groupIdartifactIdspring-cloud-alibaba-dependencies/artifactIdversion${spring.cloud.alibaba.version}/versiontypepom/typescopeimport/scope/dependency!-- mybatis-plus --dependencygroupIdcom.baomidou/groupIdartifactIdmybatis-plus-boot-starter/artifactIdversion${mybatis.plus.version}/version/dependency!-- 阿里json解析 --dependencygroupIdcom.alibaba.fastjson2/groupIdartifactIdfastjson2/artifactIdversion${fastjson2.version}/version/dependency!-- 分页插件--dependencygroupIdcom.github.pagehelper/groupIdartifactIdpagehelper-spring-boot-starter/artifactIdversion${pagehelper.version}/version/dependency/dependencies/dependencyManagementbuildpluginsplugingroupIdorg.springframework.boot/groupIdartifactIdspring-boot-maven-plugin/artifactId/plugin/plugins/build/project5、公共模块使用
第一步创建公共模块 common
第二步父子关联
第三步其他模块使用公共模块 common
dependencies标签引入公共模块 common然后就可以调用方法了