springboot+idea+maven多模块项目搭建的方法-创新互联

这篇文章给大家分享的是有关springboot+idea+maven多模块项目搭建的方法的内容。小编觉得挺实用的,因此分享给大家做个参考。一起跟随小编过来看看吧。

网站制作、成都网站设计的开发,更需要了解用户,从用户角度来建设网站,获得较好的用户体验。创新互联多年互联网经验,见的多,沟通容易、能帮助客户提出的运营建议。作为成都一家网络公司,打造的就是网站建设产品直销的概念。选择创新互联,不只是建站,我们把建站作为产品,不断的更新、完善,让每位来访用户感受到浩方产品的价值服务。

创建之前项目之前 记得改一下 maven  提高下载Pom速度 

springboot+idea+maven多模块项目搭建的方法

 记得 setting 中要改 maven  改成 阿里云的。具体方法 网上查第一步 搭建parents 项目,为maven项目 ,不为springboot 项目 记得修改groupId 

springboot+idea+maven多模块项目搭建的方法  

第二步 搭建多个子模块, honor-dao   honor-manager   honor-common记得创建 honor-manager 的时候 要把他的gruopId 改成com.honor.manager

springboot+idea+maven多模块项目搭建的方法springboot+idea+maven多模块项目搭建的方法

这里爆红的原因是 因为 我做到后面然后忘记截屏了,返回来做。实际我已经创建了 ,所以这个步骤是对的。按照这个做法,创建 honor-dao   honor-manager   honor-common,记得创建 honor-manager 的时候 要把他的gruopId 改成com.honor.manager

springboot+idea+maven多模块项目搭建的方法

第三步  在 honor-manager 下分别创建 honor-manager-fc(maven)  honor-manager-user(maven) honor-manager-boot (springboot,记得要使用springboot创建)创建时候 有两个坑 第一个是 父级  别选错 。他一般会默认 选第一级别,就是 honor  但是我们要继承的是 honor-manager第二个是路径 别写错

springboot+idea+maven多模块项目搭建的方法springboot+idea+maven多模块项目搭建的方法

第四步 开始对各大 Pom 进行整合  dao  中一般需要引入 common  ,common 一般不需要引 其他模块,然后呢 manager 中要同时引入dao  和 common第一个是  honor  父级的 pom 

<&#63;xml version="1.0" encoding="UTF-8"&#63;>
<project xmlns="http://maven.apache.org/POM/4.0.0"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
 <modelVersion>4.0.0</modelVersion>
 <groupId>com.honor</groupId>
 <artifactId>phone</artifactId>
 <packaging>pom</packaging>
 <version>1.0-SNAPSHOT</version>
 <modules>
 <module>honor-dao</module>
 <module>honor-common</module>
 <module>honor-manager</module>
 </modules>
 <parent>
 <groupId>org.springframework.boot</groupId>
 <artifactId>spring-boot-starter-parent</artifactId>
 <version>2.1.7.RELEASE</version>
 <relativePath/> <!-- lookup parent from repository -->
 </parent>
 <properties>
 <honor-common>1.0-SNAPSHOT</honor-common>
 <honor-dao>1.0-SNAPSHOT</honor-dao>
 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
 <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
 <java.version>1.8</java.version>
 <skipTests>true</skipTests>
 <hutool.version>4.5.7</hutool.version>
 <swagger2.version>2.7.0</swagger2.version>
 <mybatis-generator.version>1.3.7</mybatis-generator.version>
 <mybatis.version>3.4.6</mybatis.version>
 <postgresql.version>42.2.12</postgresql.version>
 <spring-data-commons.version>2.1.5.RELEASE</spring-data-commons.version>
 <jjwt.version>0.9.0</jjwt.version>
 <aliyun-oss.version>2.5.0</aliyun-oss.version>
 <gson.version>2.8.5</gson.version>
 <log4j2.version>2.13.3</log4j2.version>
 <mybatis-plus.version>3.1.0</mybatis-plus.version>
 <activiti.version>6.0.0</activiti.version>
 <poi.version>4.1.2</poi.version>
 </properties>
 <dependencies>
 <dependency>
 <groupId>org.springframework.boot</groupId>
 <artifactId>spring-boot-starter-web</artifactId>
 <exclusions><!-- 去掉默认配置 -->
 <!--<exclusion>
 <groupId>org.springframework.boot</groupId>
 <artifactId>spring-boot-starter-tomcat</artifactId>
 </exclusion>-->
 <exclusion>
 <groupId>org.hibernate.validator</groupId>
 <artifactId>hibernate-validator</artifactId>
 </exclusion>
 <exclusion>
 <groupId>ch.qos.logback</groupId>
 <artifactId>logback-classic</artifactId>
 </exclusion>
 <exclusion>
 <groupId>org.springframework.boot</groupId>
 <artifactId>spring-boot-starter-logging</artifactId>
 </exclusion>
 </exclusions>
 </dependency>
 <!--<dependency>
 <groupId>org.springframework.boot</groupId>
 <artifactId>spring-boot-starter-data-jpa</artifactId>
 </dependency>-->
 <!-- 移除Tomcat之后会报错,加入下面的依赖,使用外部容器 -->
 <!--<dependency>
 <groupId>org.springframework.boot</groupId>
 <artifactId>spring-boot-starter-tomcat</artifactId>
 <scope>provided</scope>
 </dependency>-->
 <dependency>
 <groupId>org.springframework.boot</groupId>
 <artifactId>spring-boot-starter-actuator</artifactId>
 </dependency>
 <dependency>
 <groupId>org.springframework.boot</groupId>
 <artifactId>spring-boot-starter-aop</artifactId>
 </dependency>
 <dependency>
 <groupId>org.springframework.boot</groupId>
 <artifactId>spring-boot-starter-test</artifactId>
 <scope>test</scope>
 </dependency>
 <dependency>
 <groupId>org.apache.logging.log4j</groupId>
 <artifactId>log4j-slf4j-impl</artifactId>
 <version>${log4j2.version}</version>
 <scope>compile</scope>
 </dependency>
 <dependency>
 <groupId>org.apache.logging.log4j</groupId>
 <artifactId>log4j-core</artifactId>
 <version>${log4j2.version}</version>
 <scope>compile</scope>
 </dependency>
 <dependency>
 <groupId>org.apache.logging.log4j</groupId>
 <artifactId>log4j-jul</artifactId>
 <version>${log4j2.version}</version>
 <scope>compile</scope>
 </dependency>
 <dependency>
 <groupId>org.apache.logging.log4j</groupId>
 <artifactId>log4j-api</artifactId>
 <version>${log4j2.version}</version>
 <scope>compile</scope>
 </dependency>
 <dependency>
 <groupId>javax.servlet</groupId>
 <artifactId>javax.servlet-api</artifactId>
 <version>3.1.0</version>
 <scope>provided</scope>
 </dependency>
 </dependencies>
 <dependencyManagement>
 <dependencies>
 <dependency>
 <groupId>org.junit.jupiter</groupId>
 <artifactId>junit-jupiter-api</artifactId>
 <version>5.5.0</version>
 <scope>test</scope>
 </dependency>
 <dependency>
 <groupId>com.honor</groupId>
 <artifactId>honor-common</artifactId>
 <version>${honor-common}</version>
 </dependency>
 <dependency>
 <groupId>com.honor</groupId>
 <artifactId>honor-dao</artifactId>
 <version>${honor-dao}</version>
 </dependency>
 <!--阿里巴巴连接池-->
 <dependency>
 <groupId>com.alibaba</groupId>
 <artifactId>druid-spring-boot-starter</artifactId>
 <version>1.1.20</version>
 </dependency>
 <!--Swagger-UI API文档生产工具-->
 <dependency>
 <groupId>io.springfox</groupId>
 <artifactId>springfox-swagger2</artifactId>
 <version>${swagger2.version}</version>
 </dependency>
 <dependency>
 <groupId>io.springfox</groupId>
 <artifactId>springfox-swagger-ui</artifactId>
 <version>${swagger2.version}</version>
 </dependency>
 <!-- MyBatis-->
 <!--<dependency>
 <groupId>org.mybatis</groupId>
 <artifactId>mybatis</artifactId>
 <version>${mybatis.version}</version>
 </dependency>-->
 <!-- mybatis plus -->
 <dependency>
 <groupId>com.baomidou</groupId>
 <artifactId>mybatis-plus-boot-starter</artifactId>
 <version>${mybatis-plus.version}</version>
 </dependency>
 <dependency>
 <groupId>com.baomidou</groupId>
 <artifactId>mybatis-plus-generator</artifactId>
 <version>${mybatis-plus.version}</version>
 </dependency>
 <!--mysql-->
 <dependency>
 <groupId>mysql</groupId>
 <artifactId>mysql-connector-java</artifactId>
 <scope>runtime</scope>
 <version>8.0.13</version>
 </dependency>
 <!--SpringData工具包-->
 <dependency>
 <groupId>org.springframework.data</groupId>
 <artifactId>spring-data-commons</artifactId>
 <version>${spring-data-commons.version}</version>
 </dependency>
 <!--JWT(Json Web Token)登录支持-->
 <dependency>
 <groupId>io.jsonwebtoken</groupId>
 <artifactId>jjwt</artifactId>
 <version>${jjwt.version}</version>
 </dependency>
 <!--Google的JSON解析工具-->
 <dependency>
 <groupId>com.google.code.gson</groupId>
 <artifactId>gson</artifactId>
 <version>${gson.version}</version>
 </dependency>
 <!-- https://mvnrepository.com/artifact/net.sf.json-lib/json-lib -->
 <dependency>
 <groupId>net.sf.json-lib</groupId>
 <artifactId>json-lib</artifactId>
 <version>2.4</version>
 <classifier>jdk15</classifier>
 </dependency>
 <!-- https://mvnrepository.com/artifact/org.activiti/activiti-engine -->
 <dependency>
 <groupId>org.activiti</groupId>
 <artifactId>activiti-engine</artifactId>
 <version>${activiti.version}</version>
 <exclusions>
 <exclusion>
 <groupId>org.mybatis</groupId>
 <artifactId>mybatis</artifactId>
 </exclusion>
 </exclusions>
 </dependency>
 <!--没有会引起mybaits plus通用mapper和activity的冲突-->
 <dependency>
 <groupId>org.activiti</groupId>
 <artifactId>activiti-spring-boot-starter-jpa</artifactId>
 <version>${activiti.version}</version>
 </dependency>
 <dependency>
 <groupId>org.apache.poi</groupId>
 <artifactId>poi</artifactId>
 <version>${poi.version}</version>
 </dependency>
 <!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml -->
 <dependency>
 <groupId>org.apache.poi</groupId>
 <artifactId>poi-ooxml</artifactId>
 <version>${poi.version}</version>
 </dependency>
 </dependencies>
 </dependencyManagement>
</project>

分享名称:springboot+idea+maven多模块项目搭建的方法-创新互联
网站地址:https://www.cdcxhl.com/article36/djeisg.html

成都网站建设公司_创新互联,为您提供网站建设商城网站电子商务网站内链网站制作品牌网站制作

广告

声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联

成都定制网站建设