Maven 聚合工程的创建( 四 )

common 子工程的 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"><parent><artifactId>fmmall</artifactId><groupId>com.luis</groupId><version>2.0.1</version></parent><modelVersion>4.0.0</modelVersion><artifactId>common</artifactId><!-- 不指定默认也是 jar --><packaging>jar</packaging></project>beans 子工程的 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"><parent><artifactId>fmmall</artifactId><groupId>com.luis</groupId><version>2.0.1</version></parent><modelVersion>4.0.0</modelVersion><artifactId>beans</artifactId><!-- 不指定默认也是 jar --><packaging>jar</packaging></project>mapper 子工程的 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"><parent><artifactId>fmmall</artifactId><groupId>com.luis</groupId><version>2.0.1</version></parent><modelVersion>4.0.0</modelVersion><artifactId>mapper</artifactId><!-- 不指定默认也是 jar --><!--<packaging>jar</packaging>--><dependencies><!-- beans --><dependency><groupId>com.luis</groupId><artifactId>beans</artifactId><version>2.0.1</version></dependency><!-- mysql --><dependency><groupId>mysql</groupId><artifactId>mysql-connector-java</artifactId><version>5.1.47</version></dependency><!-- mybatis--><dependency><groupId>org.mybatis.spring.boot</groupId><artifactId>mybatis-spring-boot-starter</artifactId><version>2.1.4</version></dependency><!-- spring-boot-starter --><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter</artifactId><version>2.4.4</version></dependency><!-- druid --><dependency><groupId>com.alibaba</groupId><artifactId>druid-spring-boot-starter</artifactId><version>1.2.9</version></dependency><!-- test --><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-test</artifactId><version>2.4.4</version></dependency><!-- junit 单元测试--><dependency><groupId>junit</groupId><artifactId>junit</artifactId><scope>test</scope></dependency></dependencies></project>service 子工程的 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"><parent><artifactId>fmmall</artifactId><groupId>com.luis</groupId><version>2.0.1</version></parent><modelVersion>4.0.0</modelVersion><artifactId>service</artifactId><!-- 不指定默认也是 jar --><!--<packaging>jar</packaging>--><dependencies><!-- mapper --><dependency><groupId>com.luis</groupId><artifactId>mapper</artifactId><version>2.0.1</version></dependency><!-- common 需要用到 vo,utils,封装数据传参到前端以及工具类 --><dependency><groupId>com.luis</groupId><artifactId>common</artifactId><version>2.0.1</version></dependency></dependencies></project>

经验总结扩展阅读