DepencyManagement & dependencies区别
dependencies:即使在子项目中不写该依赖项,那么子项目仍然会从父项目中继承该依赖项(全部继承)dependencyManagement:里只是声明依赖,并不实现引入,因此子项目需要显示的声明需要用的依赖。如果不在子项目中声明依赖,是不会从父项目中继承下来的;只有在子项目中写了该依赖项,并且没有指定具体版本,才会从父项目中继承该项,并且version 和scope都读取自父pom;另外如果子项目中指定了版本号,那么会使用子项目中指定的jar版本。
工程目录结构
yingxue-service:服务层
yingxue-web:控制层
搭建步骤
由于是多模块,所以抽出一个yingxue-base-parent来管理子项目的公共的依赖。在我们项目顶层的POM文件中,我们会看到dependencyManagement元素。通过它元素来管理jar包的版本,让子项目中引用一个依赖而不用显示的列出版本号。Maven会沿着父子层次向上走,直到找到一个拥有dependencyManagement元素的项目,然后它就会使用在这个dependencyManagement元素中指定的版本号。
父类工程
- IDEA 工具栏选择菜单 File -> New -> Project...
- 选择Spring Initializr,Initializr默认选择Default,点击Next
- 删除无用的.mvn目录、src目录、mvnw及mvnw.cmd文件,最终只留.gitignore和pom.xml
子类工程
- 选择项目根目录yingxue-base-parent右键呼出菜单,选择New -> Module
- 选择Maven,点击Next
- 填写ArifactId,点击Next
- 同理添加【yingxue-service】子模块,最终得到项目目录结构如下图
整理父 pom 文件
- 修改 spring-boot-starter-parent 版本统一2.1.6.RELEASE
- 删除 dependencies 标签及其中的依赖,因为 Spring Boot 提供的父工程已包含,并且父 pom 原则上都是通过
dependencyManagement 标签管理依赖包。 - 删除 build 标签及其中的所有内容,spring-boot-maven-plugin 插件作用是打一个可运行的包,多模块项目仅仅需要在入口类
所在的模块添加打包插件,这里父模块不需要打包运行。而且该插件已被包含在 Spring Boot 提供的父工程中,这里删掉即可。 - 整理后的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 https://maven.apache.org/xsd/maven-
4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<packaging>pom</packaging>
<modules>
<module>yingxue-web</module>
<module>yingxue-service</module>
</modules>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.6.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.yingxue.lesson</groupId>
<artifactId>yingxue-base-parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>yingxue-base-parent</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
</properties>
</project>
运行项目
- yingxue-web pom 加入必须的依赖包
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>
- 在yingxue-web层创建com.yingxue.lesson.web包(注意:这是多层目录结构并非单个目录名,com >>yingxue>>lesson>>web)并添加入口类WebApplication.java
@SpringBootApplication
public class WebApplication {
public static void main(String[] args) {
SpringApplication.run(WebApplication.class,args);
}
}
- 在com.yingxue.lesson.web包中添加controller目录并新建一个Testcontroller,添加hello方法测试接口是否可以正常访问
@RestController
@RequestMapping("/test")
public class TestController {
@GetMapping("/hello")
public String hello(){
return "Hello World";
}
}
- 运行WebApplication类中的main方法启动项目,默认端口为8080,访问http://localhost:8080/test/hello得到如下效果
配置模块间的依赖关系
通常 JAVA Web 项目会按照功能划分不同模块,模块之间通过依赖关系进行协作,下面将完善模块之间的依赖关系。
- 首先在父 pom 文件中使用「 dependencyManagement 」标签声明所有子模块依赖
<dependencyManagement>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>yingxue-web</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>yingxue-service</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
- 其次在 yingxue-service 层中的 pom 文件中添加 spring-boot-starter-web 依赖
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>
- 其次在 yingxue-web 层中的 pom 文件中添加 yingxue-service去掉spring-boot-starter-web依赖
<dependency>
<groupId>${parent.groupId}</groupId>
<artifactId>yingxue-service</artifactId>
</dependency>
web 层调用服务层接口测试
模块依赖关系配置完成之后,通过 web 层 测试下 service层的接口是否可以正常调用。
- 首先在 yingxue-service 层创建 com.yingxue.lesson包,添加 service 目录并在其中创建 UserService 接口类及 impl 目录(用于存放接口实现类)。
public interface UserService {
String testService();
}
@Service
public class UserServiceImpl implements UserService {
@Override
public String testService() {
return "testService";
}
}
- TestController 通过 @Autowired 注解注入 UserService ,修改 TestController 的 test 方法使之调用 UserService 的testService方法
@Autowired
private UserService userService;
@GetMapping("/hello")
public String hello(){
return userService.testService();
}
-
再次运行 WebApplication 类中的 main 方法启动项目,发现如下报错
- 在 WebApplication 入口类中增加包扫描,设置 @SpringBootApplication 注解中的 scanBasePackages 值为com.yingxue.lesson
@SpringBootApplication(scanBasePackages = "com.yingxue.lesson")
- 再次运行 WebApplication 类中的 main 方法启动项目 访问http://localhost:8080/test/hello得到如下效果
Spring Boot 整合实战 Mybatis3 【多模块】
先创建一个根项目,删除无用的.mvn目录、src目录、mvnw及mvnw.cmd文件,最终只留.gitignore和pom.xml、然后创建module
项目目录
yingxue-service:服务层
yingxue-web:控制层
yingxue-dao:数据持久层
yingxue-vo:接收前端&响应端数据封装
整理根项目pom
- 修改 spring-boot-starter-parent 版本统一2.1.6.RELEASE
- 删除 dependencies 标签及其中的依赖,因为 Spring Boot 提供的父工程已包含,并且父 pom 原则上都是通过dependencyManagement 标签管理依赖包。
<dependencyManagement>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>yingxue-service</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>yingxue-dao</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>yingxue-web</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>yingxue-vo</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
- 删除 build 标签及其中的所有内容,spring-boot-maven-plugin 插件作用是打一个可运行的包,多模块项目仅仅需要在入口类。所在的模块添加打包插件,这里父模块不需要打包运行。而且该插件已被包含在 Spring Boot 提供的父工程中,这里删掉即可。
- 声明管理项目所需jar包
<properties>
<java.version>1.8</java.version>
<mysql.version>5.1.47</mysql.version>
<druid.version>1.1.10</druid.version>
<mybatis.version>1.3.2</mybatis.version>
<swagger2-version>2.9.2</swagger2-version>
</properties>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql.version}</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>${druid.version}</version>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>${mybatis.version}</version>
</dependency>
<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>
- 整理后的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 https://maven.apache.org/xsd/maven-
4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<packaging>pom</packaging>
<modules>
<module>yingxue-web</module>
<module>yingxue-service</module>
<module>yingxue-dao</module>
<module>yingxue-vo</module>
</modules>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.6.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.yingxue.lesson</groupId>
<artifactId>mybatis-demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>mybatis-demo</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
<mysql.version>5.1.47</mysql.version>
<druid.version>1.1.10</druid.version>
<mybatis.version>1.3.2</mybatis.version>
<swagger2-version>2.9.2</swagger2-version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>yingxue-service</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>yingxue-dao</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>yingxue-web</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>yingxue-vo</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql.version}</version>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>${mybatis.version}</version>
</dependency>
<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>
</dependencies>
</dependencyManagement>
</project>
配置模块间的依赖关系
yingxue-vo
<?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>mybatis-demo</artifactId>
<groupId>com.yingxue.lesson</groupId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<version>${parent.version}</version>
<artifactId>yingxue-vo</artifactId>
</project>
yingxue-dao
<?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>mybatis-demo</artifactId>
<groupId>com.yingxue.lesson</groupId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<version>${parent.version}</version>
<artifactId>yingxue-dao</artifactId>
<dependencies>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>com.yingxue.lesson</groupId>
<artifactId>yingxue-vo</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
</dependency>
</dependencies>
</project>
yingxue-service
<?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>mybatis-demo</artifactId>
<groupId>com.yingxue.lesson</groupId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<version>${parent.version}</version>
<artifactId>yingxue-service</artifactId>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>com.yingxue.lesson</groupId>
<artifactId>yingxue-dao</artifactId>
</dependency>
</dependencies>
yingxue-web
<?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>mybatis-demo</artifactId>
<groupId>com.yingxue.lesson</groupId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>yingxue-web</artifactId>
<version>${parent.version}</version>
<dependencies>
<dependency>
<groupId>com.yingxue.lesson</groupId>
<artifactId>yingxue-service</artifactId>
</dependency>
</dependencies>
</project>
最后yingxue-web application.properties 加入链接池配置
生产环境商城demo:
common 为起点(不依赖任何模块) ---》其他中间模块随便互相调用 ---》 combination 为出口(把其它模块都依赖进来【除了search】)
父项目:lecshop_v3
<?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>
<modules>
<module>lecshop_api_modules</module>
<module>lecshop_base_modules</module>
</modules>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.4.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.lecshop</groupId>
<artifactId>lecshop</artifactId>
<version>3.0.0-SNAPSHOT</version>
<name>lecshop_v3</name>
<description>Demo project for Spring Boot</description>
<packaging>pom</packaging>
<properties>
<java.version>1.8</java.version>
<druid.version>1.1.16</druid.version>
<elasticsearch.version>5.5.0</elasticsearch.version>
<mybatis.version>3.4.0</mybatis.version>
<docker.image.prefix>lecshop</docker.image.prefix>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.data.lecshop</groupId>
<artifactId>spring-data-elasticsearch</artifactId>
<version>3.0.8.RELEASE</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-pool2</artifactId>
</dependency>
<!-- redis-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
<!--web-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>2.0.0</version>
</dependency>
<!--mysql-->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<!--lombok-->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<!--druid 数据源-->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>${druid.version}</version>
</dependency>
<!--jwt-->
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt</artifactId>
<version>0.7.0</version>
</dependency>
<!-- AOP 切面 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
<version>2.0.3.RELEASE</version>
</dependency>
<!--swagger2 -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.9.2</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.9.2</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>nexus</id>
<name>local private nexus</name>
<url>http://118.178.58.102:9888/nexus/content/groups/public/</url>
<releases>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
<repository>
<id>nexus repository</id>
<name>intranet public groups</name>
<url>http://118.178.58.102:9888/nexus/content/groups/public</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
</project>
部署包 lecshop_api_modules
<?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>lecshop</artifactId>
<groupId>com.lecshop</groupId>
<version>3.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>lecshop_api_modules</artifactId>
<packaging>pom</packaging>
<modules>
<module>lecshop_web_admin</module>
<module>lecshop_web_app</module>
<module>lecshop_web_applets</module>
<module>lecshop_web_store</module>
<module>lecshop_web_mobile</module>
<module>lecshop_web_pc</module>
</modules>
</project>
基础模块 lecshop_base_modules
<?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>lecshop</artifactId>
<groupId>com.lecshop</groupId>
<version>3.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>lecshop_base_modules</artifactId>
<packaging>pom</packaging>
<modules>
<module>lecshop_common</module>
<module>lecshop_system</module>
<module>lecshop_spu</module>
<module>lecshop_customer</module>
<module>lecshop_order</module>
<module>lecshop_marketing</module>
<module>lecshop_search</module>
<module>lecshop_site</module>
<module>lecshop_shopping_cart</module>
<module>lecshop_combination</module>
<module>lecshop_points_mall</module>
</modules>
</project>
平台管理端 lecshop_web_admin
<?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>lecshop_api_modules</artifactId>
<groupId>com.lecshop</groupId>
<version>3.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>lecshop_web_admin</artifactId>
<packaging>jar</packaging>
<dependencies>
<dependency>
<artifactId>lecshop_combination</artifactId>
<groupId>com.lecshop</groupId>
<version>3.0.0-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>1.0.0</version>
<configuration>
<imageName>${docker.image.prefix}/${project.artifactId}</imageName>
<dockerDirectory>src/main/docker</dockerDirectory>
<resources>
<resource>
<targetPath>/</targetPath>
<directory>${project.build.directory}</directory>
<include>${project.build.finalName}.jar</include>
</resource>
</resources>
</configuration>
</plugin>
</plugins>
</build>
</project>
app后端 lecshop_web_app
<?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>lecshop_api_modules</artifactId>
<groupId>com.lecshop</groupId>
<version>3.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>lecshop_web_app</artifactId>
<packaging>jar</packaging>
<dependencies>
<dependency>
<artifactId>lecshop_combination</artifactId>
<groupId>com.lecshop</groupId>
<version>3.0.0-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>1.0.0</version>
<configuration>
<imageName>${docker.image.prefix}/${project.artifactId}</imageName>
<dockerDirectory>src/main/docker</dockerDirectory>
<resources>
<resource>
<targetPath>/</targetPath>
<directory>${project.build.directory}</directory>
<include>${project.build.finalName}.jar</include>
</resource>
</resources>
</configuration>
</plugin>
</plugins>
</build>
</project>
小程序后端
<?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>lecshop_api_modules</artifactId>
<groupId>com.lecshop</groupId>
<version>3.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>lecshop_web_applets</artifactId>
<packaging>jar</packaging>
<dependencies>
<dependency>
<artifactId>lecshop_combination</artifactId>
<groupId>com.lecshop</groupId>
<version>3.0.0-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>1.0.0</version>
<configuration>
<imageName>${docker.image.prefix}/${project.artifactId}</imageName>
<dockerDirectory>src/main/docker</dockerDirectory>
<resources>
<resource>
<targetPath>/</targetPath>
<directory>${project.build.directory}</directory>
<include>${project.build.finalName}.jar</include>
</resource>
</resources>
</configuration>
</plugin>
</plugins>
</build>
</project>
聚合模块 lecshop_combination
<?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>lecshop_base_modules</artifactId>
<groupId>com.lecshop</groupId>
<version>3.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>lecshop_combination</artifactId>
<dependencies>
<dependency>
<artifactId>lecshop_customer</artifactId>
<groupId>com.lecshop</groupId>
<version>3.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>lecshop_common</artifactId>
<groupId>com.lecshop</groupId>
<version>3.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>lecshop_system</artifactId>
<groupId>com.lecshop</groupId>
<version>3.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>lecshop_spu</artifactId>
<groupId>com.lecshop</groupId>
<version>3.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>lecshop_order</artifactId>
<groupId>com.lecshop</groupId>
<version>3.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>lecshop_site</artifactId>
<groupId>com.lecshop</groupId>
<version>3.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>lecshop_marketing</artifactId>
<groupId>com.lecshop</groupId>
<version>3.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>lecshop_shopping_cart</artifactId>
<groupId>com.lecshop</groupId>
<version>3.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.lecshop</groupId>
<artifactId>lecshop_points_mall</artifactId>
<version>3.0.0-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
公共模块 lecshop_common
<?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>lecshop_base_modules</artifactId>
<groupId>com.lecshop</groupId>
<version>3.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>lecshop_common</artifactId>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<!--security-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<!-- 又拍云 -->
<dependency>
<groupId>com</groupId>
<artifactId>upyun</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.3.1</version>
</dependency>
<!-- 验证码插件 -->
<dependency>
<groupId>com.github.penggle</groupId>
<artifactId>kaptcha</artifactId>
<version>2.3.2</version>
</dependency>
<!-- poi execle -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.16</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.1</version>
</dependency>
<!-- 支付宝支付 jar -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.3</version>
</dependency>
<!-- 银联支付 jar -->
<dependency>
<groupId>com.unionpay.acp</groupId>
<artifactId>upacp_sdk</artifactId>
<version>1.0.0</version>
</dependency>
<!--dom4j -->
<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>1.6.1</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk16</artifactId>
<version>1.46</version>
</dependency>
<!-- 生成二维码的jar -->
<dependency>
<groupId>com.lecshop</groupId>
<artifactId>zxing</artifactId>
<version>0.0.1</version>
</dependency>
<!-- 啊里支付 -->
<dependency>
<groupId>com.lecshop</groupId>
<artifactId>alipay</artifactId>
<version>1.0.1</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.4</version>
</dependency>
<!-- 短信发送-->
<dependency>
<groupId>com.lecshop</groupId>
<artifactId>smsdys</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.lecshop</groupId>
<artifactId>smscore</artifactId>
<version>3.2.3</version>
</dependency>
<dependency>
<groupId>com.taobao</groupId>
<artifactId>alidayu</artifactId>
<version>1.0</version>
</dependency>
<!-- 邮件-->
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.4.4</version>
</dependency>
</dependencies>
</project>
会员模块 lecshop_customer
<?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>lecshop_base_modules</artifactId>
<groupId>com.lecshop</groupId>
<version>3.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>lecshop_customer</artifactId>
<dependencies>
<dependency>
<artifactId>lecshop_spu</artifactId>
<groupId>com.lecshop</groupId>
<version>3.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.lecshop</groupId>
<artifactId>lecshop_system</artifactId>
<version>3.0.0-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
促销模块 lecshop_marketing
<?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>lecshop_base_modules</artifactId>
<groupId>com.lecshop</groupId>
<version>3.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>lecshop_marketing</artifactId>
<dependencies>
<dependency>
<artifactId>lecshop_common</artifactId>
<groupId>com.lecshop</groupId>
<version>3.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>lecshop_spu</artifactId>
<groupId>com.lecshop</groupId>
<version>3.0.0-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
订单模块 lecshop_order
<?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>lecshop_base_modules</artifactId>
<groupId>com.lecshop</groupId>
<version>3.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>lecshop_order</artifactId>
<dependencies>
<dependency>
<artifactId>lecshop_common</artifactId>
<groupId>com.lecshop</groupId>
<version>3.0.0-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
搜索模块 lecshop_search
<?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>lecshop_base_modules</artifactId>
<groupId>com.lecshop</groupId>
<version>3.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>lecshop_search</artifactId>
<dependencies>
<!--spring es 搜索引擎 -->
<dependency>
<groupId>org.springframework.data.lecshop</groupId>
<artifactId>spring-data-elasticsearch</artifactId>
<version>3.0.8.RELEASE</version>
</dependency>
<dependency>
<artifactId>lecshop_common</artifactId>
<groupId>com.lecshop</groupId>
<version>3.0.0-SNAPSHOT</version>
</dependency>
</dependencies>
</project>