1.创建base-entity
选中base工程,右键创建一个新的maven工程
自动选择了base这个目录存放子工程
创建后,pom.xml修改成如下内容:
<?xml version="1.0"?> <projectxsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><modelVersion>4.0.0</modelVersion><parent><groupId>net.common</groupId><artifactId>base</artifactId><version>1.0.0</version></parent><artifactId>base-entity</artifactId><name>base-entity</name><url>http://maven.apache.org</url><properties><project.build.sourceEncoding>UTF-8</project.build.sourceEncoding></properties> </project>
重点:
2.同理建立base-mapper层,pom.xml修改之后如下:
<?xml version="1.0"?> <projectxsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><modelVersion>4.0.0</modelVersion><parent><groupId>net.common</groupId><artifactId>base</artifactId><version>1.0.0</version></parent><artifactId>base-mapper</artifactId><name>base-mapper</name><url>http://maven.apache.org</url><properties><project.build.sourceEncoding>UTF-8</project.build.sourceEncoding></properties><dependencies><dependency><groupId>net.common</groupId><artifactId>base-entity</artifactId><version>1.0.0</version></dependency></dependencies> </project>
重点:
2.同理建立base-service层,pom.xml修改之后如下:
<?xml version="1.0"?> <projectxsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><modelVersion>4.0.0</modelVersion><parent><groupId>net.common</groupId><artifactId>base</artifactId><version>1.0.0</version></parent><artifactId>base-service</artifactId><name>base-service</name><url>http://maven.apache.org</url><properties><project.build.sourceEncoding>UTF-8</project.build.sourceEncoding></properties><dependencies><dependency><groupId>net.common</groupId><artifactId>base-mapper</artifactId><version>1.0.0</version></dependency></dependencies> </project>
重点:
4.建立base-web层
这个时候不是建立一个普通的web工程,二是springboot工程。
重点:
一定确保生成工程的位置是否在父目录下面,如果确认不在,可以勾除“use default locatioin”,自己重新选择。
创建springboot工程需要安装插件:
创建完毕后,pom.xml文件修改成如下:
<?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><parent><groupId>net.common</groupId><artifactId>base</artifactId><version>1.0.0</version></parent><artifactId>base-web</artifactId><packaging>war</packaging><name>base-web</name><description>企业内部门户</description><properties><project.build.sourceEncoding>UTF-8</project.build.sourceEncoding><project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding><java.version>1.8</java.version></properties><dependencies><dependency><groupId>net.common</groupId><artifactId>base-service</artifactId><version>1.0.0</version></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-devtools</artifactId><optional>true</optional></dependency></dependencies><build><plugins><plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId><configuration><fork>true</fork></configuration></plugin></plugins></build></project>
重点:
只要运行base-web就可以把整个工程运行起来了。
至此介绍完毕!
有问题的请给我留言!