springboot 分布式项目,子级项目各自的作用。
一、分布式项目,需要使用maven搭建。
1.1 父级pro.xml module。
<?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.aaa</groupId>
<artifactId>2019816SpringBootCRUD</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version> <modules>
<!--1.实体类 -->
<module>model</module> <!--2.持久层 依赖于model-->
<module>mapper</module> <!-- 3.页面层 1.依赖service层 2.不允许出现任何逻辑 负责控制跳转。-->
<module>web</module> <!--4.业务层 4.1依赖mapper 4.2 依赖common 工具包-->
<module>service</module> <!-- 5.工具类 放在service层使用。 -->
<module>common</module>
</modules> <!--dependencyManagement 标签管理的各种jar包,子级的工程,通过重写的方式来继承。 -->
<dependencyManagement>
<dependencies> <!-- 将父工程 parent 放在里面 parent 和 web 项目就能跑了 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.22.RELEASE</version>
</dependency> <dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>1.5.22.RELEASE</version>
</dependency> <!--
1.添加 thymeleaf 的依赖。
2.springboot 中已经继承过了,可以直接使用。
3.添加版本号 此时已经是 父级工程了。
-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
<version>1.5.22.RELEASE</version>
</dependency> <dependency>
<groupId>net.sourceforge.nekohtml</groupId>
<artifactId>nekohtml</artifactId>
<version>1.9.21</version>
</dependency> <!--
mybatis jar包 mysql jar包 引入在父级之中,mapper层 就能用到了
mapper 和web 用到相同的( 连接数据库 做增删改查)
在mapper中放入即可。
-->
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>1.3.0</version>
</dependency>
<!--
mysql的驱动包
-->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.38</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>
1.2 子级项目之间的依赖关系、
mapper-----》 依赖 model
<?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>2019816SpringBootCRUD</artifactId>
<groupId>com.aaa</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion> <artifactId>mapper</artifactId> <!--mapper 依赖 model -->
<dependencies>
<dependency>
<groupId>com.aaa</groupId>
<artifactId>model</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<!-- 1.mapper 层 需要用到 父级工程中的jar 包,在这里重写即可。
2.web 层也需要用到,但是层级依赖 已经确定,只需要在mapper层中,重写即可。
-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId> </dependency>
<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> </dependency>
<!--
mysql的驱动包
-->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
</dependencies>
</project>
service-------》mapper
web------》service
springboot 分布式项目,子级项目各自的作用。的更多相关文章
- 【idea】idea重新打包依赖了父级项目的子级项目,父级项目代码改变,但是子级项目打包依旧是老的代码 问题解决
最简单的方法: 就是单独打包父级项目,然后替换本地maven仓库中的父级项目的jar,然后重新打包子级项目,就可以了.
- 在idea下两个项目之间的maven父子级项目依赖
配置:idea 在一个项目中的父子级依赖网上轮子太多,我就不重复造了,留个链接 http://www.cnblogs.com/tibit/p/6185704.html 说说一些我自己注意的问题,在pr ...
- SpringBoot微服务电商项目开发实战 --- 分布式文件系统实现
SpringBoot分布式开发系列文章已经持续了一段时间了,每一篇都有核心内容讲给大家.比如:分环境部署配置及服务端口号统一配置,子模块版本号管理及第三方jar依赖管理,单点登录实现,接口安全(签名+ ...
- maven项目 子父级工程。
一 .什么是 maven 子父级工程? 建立一个maven项目,然后在该项目 下创建一个module,子级的maven,他继承于父级项目. 1.新建立 maven项目,file ------new- ...
- SpringBoot微服务电商项目开发实战 --- Redis缓存雪崩、缓存穿透、缓存击穿防范
最近已经推出了好几篇SpringBoot+Dubbo+Redis+Kafka实现电商的文章,今天再次回到分布式微服务项目中来,在开始写今天的系列五文章之前,我先回顾下前面的内容. 系列(一):主要说了 ...
- SpringBoot&Dubbo&Zookeeper远程调用项目搭建
序言 Dubbo一款分布式服务框架,作为阿里巴巴SOA服务化治理方案的核心框架,通过高性能和透明化的RPC实现服务的远程调用,对服务的负载均衡以及项目的耦合性提供很强的解决方式;具体Dubbo的介绍和 ...
- 分布式协同AI基准测试项目Ianvs:工业场景提升5倍研发效率
摘要:全场景可扩展的分布式协同AI基准测试项目 Ianvs(雅努斯),能为算法及服务开发者提供全面开发套件支持,以研发.衡量和优化分布式协同AI系统. 本文分享自华为云社区<KubeEdge|分 ...
- jeecg项目子窗口获得父窗口元素id
jeecg项目子窗口获得父窗口元素id, var parentWin = frameElement.api.opener;alert($(parentWin.document).find(" ...
- Springboot项目如何把项目运行在服务器上
作为一个开发者,不可避免的要把本地项目变成可以接入外网的上线项目,今天来记录下springboot框架下如果把项目打包放在服务器上运行 第一步,首先要买个服务器,这个一般甲方会提供 第二步,导入jar ...
随机推荐
- C++string字符串截取其中元素 截取定位字符串
#include <iostream> #include <string> using namespace std; /** * 截取str后的元素 * @param stre ...
- Java EE数据持久化框架笔记 • 【目录】
章节 内容 实践练习 Java EE数据持久化框架作业目录(作业笔记) 第1章 Java EE数据持久化框架笔记 • [第1章 MyBatis入门] 第2章 Java EE数据持久化框架笔记 • [第 ...
- 【ElasticSearch】异常 Request cannot be executed; I/O reactor status: STOPPED
Caused by: java.lang.RuntimeException: Request cannot be executed; I/O reactor status: STOPPED at or ...
- 论文翻译:2020_Acoustic Echo Cancellation Based on Recurrent Neural Network
论文地址:https://ieeexplore.ieee.org/abstract/document/9306224 基于RNN的回声消除 摘要 本文提出了一种基于深度学习的语音分离技术的回声消除方法 ...
- UTF-8,GBK,ANSI之间的关系和区别
GBK应该是属于ANSI之中的,在ANSI的国际通用集,GBK是专门来解决中文编码的,是双字节的,不论中英文都是双字节,而UTF-8是才用的另外的一种编码方式,对英文是用8位,对中文使用24位,是和A ...
- VMware客户端vSphereClient新建虚拟机
1.说明 VMware客户端工具vSphere Client, 用来连接和管理ESX或ESXi主机(下面称为宿主机), 可以方便的创建.管理虚拟机,并分配相应的资源.宿主机就是使用虚拟化软件运行虚拟机 ...
- 【Python+Django+Pytest】数据库异常pymysql.err.InterfaceError: (0, '') 解决方案
问题背景: 接口自动化测试平台,在执行测试案例之外,还需要做以下五件事情(或步骤): 1.查询用户在数据准备中预置的测试套件层数据初始化相关sql (setUp_class方法中) 2.查询用户在数 ...
- Python_元类
什么是元类 我们知道,实例对象是由类创建的,那么类又是由什么创建的呢? 答案就是元类. 元类基本不会用到,但是就算不用,也应该去熟悉一下概念. 理解类也是对象 在大多数编程语言中,类就是一组用来描述如 ...
- spring security 继承 WebSecurityConfigurerAdapter 的重写方法configure() 参数 HttpSecurity 常用方法及说明
HttpSecurity 常用方法及说明 方法 说明 openidLogin() 用于基于 OpenId 的验证 headers() 将安全标头添加到响应 cors() 配置跨域资源共享( CORS ...
- PPT制作手机滑动粗糙效果
原文链接:https://www.toutiao.com/i6495291974680052238/ 选择"插入"选项卡,"插图"功能组."形状&qu ...