目录
一 概述说明
1.1 逻辑说明
1.将sdk打成jar包,提供可用的坐标依赖
2.在调用方(服务启动方)的pom中配置此sdk依赖,在调用方启动app类中,添加能够扫描到此sdk的包路径。
二 sdk项目
2.1 工程结构
2.1. 1 工程结构说明
说明:sdk项目目录中只有基础的service类以及mybatis操作数据库的相关文件,service类中包含查询数据库的方法。
本博客记录的案例:均是在springboot 2.x版本下。

说明:https://www.cnblogs.com/sueyyyy/p/12197922.html
2.1. 2 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>
<!-- 引入springboot -->
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.1.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.pab</groupId>
<artifactId>dlock-component</artifactId>
<version>1.0-SNAPSHOT</version>
<name>dlock-component</name>
<!-- FIXME change it to the project's website -->
<url>http://www.example.com</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<!--spring boot的依赖 -->
<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>1.3.2</version>
</dependency>

最低0.47元/天 解锁文章
4124

被折叠的 条评论
为什么被折叠?



