這篇文章給大家分享的是有關(guān)springboot+idea+maven多模塊項目搭建的方法的內(nèi)容。小編覺得挺實用的,因此分享給大家做個參考。一起跟隨小編過來看看吧。
網(wǎng)站制作、成都網(wǎng)站設(shè)計的開發(fā),更需要了解用戶,從用戶角度來建設(shè)網(wǎng)站,獲得較好的用戶體驗。創(chuàng)新互聯(lián)多年互聯(lián)網(wǎng)經(jīng)驗,見的多,溝通容易、能幫助客戶提出的運營建議。作為成都一家網(wǎng)絡(luò)公司,打造的就是網(wǎng)站建設(shè)產(chǎn)品直銷的概念。選擇創(chuàng)新互聯(lián),不只是建站,我們把建站作為產(chǎn)品,不斷的更新、完善,讓每位來訪用戶感受到浩方產(chǎn)品的價值服務(wù)。創(chuàng)建之前項目之前 記得改一下 maven 提高下載Pom速度
記得 setting 中要改 maven 改成 阿里云的。具體方法 網(wǎng)上查第一步 搭建parents 項目,為maven項目 ,不為springboot 項目 記得修改groupId
第二步 搭建多個子模塊, honor-dao honor-manager honor-common記得創(chuàng)建 honor-manager 的時候 要把他的gruopId 改成com.honor.manager
這里爆紅的原因是 因為 我做到后面然后忘記截屏了,返回來做。實際我已經(jīng)創(chuàng)建了 ,所以這個步驟是對的。按照這個做法,創(chuàng)建 honor-dao honor-manager honor-common,記得創(chuàng)建 honor-manager 的時候 要把他的gruopId 改成com.honor.manager
第三步 在 honor-manager 下分別創(chuàng)建 honor-manager-fc(maven) honor-manager-user(maven) honor-manager-boot (springboot,記得要使用springboot創(chuàng)建)創(chuàng)建時候 有兩個坑 第一個是 父級 別選錯 。他一般會默認 選第一級別,就是 honor 但是我們要繼承的是 honor-manager第二個是路徑 別寫錯
第四步 開始對各大 Pom 進行整合 dao 中一般需要引入 common ,common 一般不需要引 其他模塊,然后呢 manager 中要同時引入dao 和 common第一個是 honor 父級的 pom
<?xml version="1.0" encoding="UTF-8"?> <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文檔生產(chǎn)工具--> <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多模塊項目搭建的方法-創(chuàng)新互聯(lián)
網(wǎng)站地址:http://jinyejixie.com/article36/djeisg.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站建設(shè)、商城網(wǎng)站、電子商務(wù)、網(wǎng)站內(nèi)鏈、網(wǎng)站制作、品牌網(wǎng)站制作
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容