🔖 2.5.0. Spring Cloud Hoxton、Spring Boot 2.2

This commit is contained in:
冷冷 2019-11-05 01:07:27 +08:00
parent ea06c5a990
commit e9dcaa4c2e
24 changed files with 77 additions and 338 deletions

View File

@ -4,12 +4,12 @@
<p align="center">
<img src="https://img.shields.io/badge/Avue-2.1.0-green.svg" alt="Build Status">
<img src="https://img.shields.io/badge/Spring%20Cloud-Greenwich.SR3-blue.svg" alt="Coverage Status">
<img src="https://img.shields.io/badge/Spring%20Boot-2.1.9.RELEASE-blue.svg" alt="Downloads">
<img src="https://img.shields.io/badge/Avue-2.2.0-green.svg" alt="Build Status">
<img src="https://img.shields.io/badge/Spring%20Cloud-Hoxton.RC1-blue.svg" alt="Coverage Status">
<img src="https://img.shields.io/badge/Spring%20Boot-2.2.0.RELEASE-blue.svg" alt="Downloads">
</p>
- 基于 Spring Cloud Greenwich.SR3 、Spring Security OAuth2 的RBAC权限管理系统
- 基于 Spring Cloud Hoxton 、Spring Boot 2.2、 OAuth2 的RBAC权限管理系统
- 基于数据驱动视图的理念封装 element-ui即使没有 vue 的使用经验也能快速上手
- 提供对常见容器化支持 Docker、Kubernetes、Rancher2 支持
- 提供 lambda 、stream api 、webflux 的生产实践
@ -22,6 +22,15 @@
#### 快速构架微服务应用
```xml
<!-- pig-gen archetype -->
<dependency>
<groupId>com.pig4cloud.archetype</groupId>
<artifactId>pig-gen</artifactId>
<version>last.version</version>
</dependency>
```
<img src="https://images.gitee.com/uploads/images/2019/1026/004238_9a73e1e7_393021.gif"/>
#### 核心依赖
@ -29,12 +38,12 @@
依赖 | 版本
---|---
Spring Boot | 2.1.9.RELEASE
Spring Cloud | Greenwich.SR3
Spring Boot | 2.2.0.RELEASE
Spring Cloud | Hoxton.RC1
Spring Security OAuth2 | 2.3.6
Mybatis Plus | 3.2.0
hutool | 5.0.3
Avue | 2.1.0
Avue | 2.2.0

File diff suppressed because one or more lines are too long

View File

@ -21,7 +21,7 @@
<parent>
<groupId>com.pig4cloud</groupId>
<artifactId>pig</artifactId>
<version>2.4.4</version>
<version>2.5.0</version>
</parent>
<artifactId>pig-auth</artifactId>
@ -39,13 +39,13 @@
<dependency>
<groupId>com.pig4cloud</groupId>
<artifactId>pig-upms-api</artifactId>
<version>2.4.4</version>
<version>2.5.0</version>
</dependency>
<!--security-->
<dependency>
<groupId>com.pig4cloud</groupId>
<artifactId>pig-common-security</artifactId>
<version>2.4.4</version>
<version>2.5.0</version>
</dependency>
<!--JDBC相关-->
<dependency>

View File

@ -21,7 +21,7 @@
<parent>
<groupId>com.pig4cloud</groupId>
<artifactId>pig-common</artifactId>
<version>2.4.4</version>
<version>2.5.0</version>
</parent>
<artifactId>pig-common-core</artifactId>
@ -49,7 +49,7 @@
</dependency>
<!--mybatis plus extension,包含了mybatis plus core-->
<dependency>
<groupId>com.baomidou</groupId>
<groupId>com.pig4cloud</groupId>
<artifactId>mybatis-plus-extension</artifactId>
<version>${mybatis-plus.version}</version>
</dependency>

View File

@ -21,7 +21,7 @@
<parent>
<groupId>com.pig4cloud</groupId>
<artifactId>pig-common</artifactId>
<version>2.4.4</version>
<version>2.5.0</version>
</parent>
<artifactId>pig-common-log</artifactId>
@ -35,13 +35,13 @@
<dependency>
<groupId>com.pig4cloud</groupId>
<artifactId>pig-common-core</artifactId>
<version>2.4.4</version>
<version>2.5.0</version>
</dependency>
<!--UPMS接口模块-->
<dependency>
<groupId>com.pig4cloud</groupId>
<artifactId>pig-upms-api</artifactId>
<version>2.4.4</version>
<version>2.5.0</version>
</dependency>
<!--安全依赖获取上下文信息-->
<dependency>

View File

@ -21,7 +21,7 @@
<parent>
<groupId>com.pig4cloud</groupId>
<artifactId>pig-common</artifactId>
<version>2.4.4</version>
<version>2.5.0</version>
</parent>
<artifactId>pig-common-security</artifactId>
@ -35,7 +35,7 @@
<dependency>
<groupId>com.pig4cloud</groupId>
<artifactId>pig-common-core</artifactId>
<version>2.4.4</version>
<version>2.5.0</version>
</dependency>
<!--安全模块-->
<dependency>
@ -50,7 +50,7 @@
<dependency>
<groupId>com.pig4cloud</groupId>
<artifactId>pig-upms-api</artifactId>
<version>2.4.4</version>
<version>2.5.0</version>
</dependency>
</dependencies>
</project>

View File

@ -21,7 +21,7 @@
<parent>
<groupId>com.pig4cloud</groupId>
<artifactId>pig</artifactId>
<version>2.4.4</version>
<version>2.5.0</version>
</parent>
<artifactId>pig-common</artifactId>

View File

@ -21,7 +21,7 @@
<parent>
<groupId>com.pig4cloud</groupId>
<artifactId>pig</artifactId>
<version>2.4.4</version>
<version>2.5.0</version>
</parent>
<artifactId>pig-config</artifactId>

View File

@ -8,18 +8,6 @@ spring:
redis:
password:
host: pig-redis
# zipkin
zipkin:
enabled: true
base-url: http://pig-zipkin
sleuth:
web:
client:
enabled: true
sampler:
# 默认的采样比率为0.1,不能看到所有请求数据
# 更改采样比率为1就能看到所有的请求数据了但是这样会增加接口调用延迟
probability: 1.0
# 暴露监控端点
management:

View File

@ -1,18 +0,0 @@
spring:
# 数据源
datasource:
type: com.zaxxer.hikari.HikariDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
username: root
password: root
url: jdbc:mysql://pig-mysql:3306/pig?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai
management:
metrics:
web:
server:
auto-time-requests: false
zipkin:
storage:
type: mysql
sleuth:
enabled: true

View File

@ -21,7 +21,7 @@
<parent>
<groupId>com.pig4cloud</groupId>
<artifactId>pig</artifactId>
<version>2.4.4</version>
<version>2.5.0</version>
</parent>
<artifactId>pig-eureka</artifactId>

View File

@ -21,7 +21,7 @@
<parent>
<groupId>com.pig4cloud</groupId>
<artifactId>pig</artifactId>
<version>2.4.4</version>
<version>2.5.0</version>
</parent>
<artifactId>pig-gateway</artifactId>
@ -54,7 +54,7 @@
<dependency>
<groupId>com.pig4cloud</groupId>
<artifactId>pig-common-core</artifactId>
<version>2.4.4</version>
<version>2.5.0</version>
</dependency>
</dependencies>

View File

@ -21,7 +21,7 @@
<parent>
<groupId>com.pig4cloud</groupId>
<artifactId>pig-upms</artifactId>
<version>2.4.4</version>
<version>2.5.0</version>
</parent>
<artifactId>pig-upms-api</artifactId>
@ -35,7 +35,7 @@
<dependency>
<groupId>com.pig4cloud</groupId>
<artifactId>pig-common-core</artifactId>
<version>2.4.4</version>
<version>2.5.0</version>
</dependency>
</dependencies>
</project>

View File

@ -21,7 +21,7 @@
<parent>
<groupId>com.pig4cloud</groupId>
<artifactId>pig-upms</artifactId>
<version>2.4.4</version>
<version>2.5.0</version>
</parent>
<artifactId>pig-upms-biz</artifactId>
@ -34,19 +34,19 @@
<dependency>
<groupId>com.pig4cloud</groupId>
<artifactId>pig-upms-api</artifactId>
<version>2.4.4</version>
<version>2.5.0</version>
</dependency>
<!--安全模块-->
<dependency>
<groupId>com.pig4cloud</groupId>
<artifactId>pig-common-security</artifactId>
<version>2.4.4</version>
<version>2.5.0</version>
</dependency>
<!--日志处理-->
<dependency>
<groupId>com.pig4cloud</groupId>
<artifactId>pig-common-log</artifactId>
<version>2.4.4</version>
<version>2.5.0</version>
</dependency>
<!--配置中心客户端-->
<dependency>
@ -55,7 +55,7 @@
</dependency>
<!--mybatis-->
<dependency>
<groupId>com.baomidou</groupId>
<groupId>com.pig4cloud</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>${mybatis-plus.version}</version>
</dependency>

View File

@ -21,7 +21,7 @@
<parent>
<groupId>com.pig4cloud</groupId>
<artifactId>pig</artifactId>
<version>2.4.4</version>
<version>2.5.0</version>
</parent>
<artifactId>pig-upms</artifactId>

View File

@ -22,7 +22,7 @@
<parent>
<groupId>com.pig4cloud</groupId>
<artifactId>pig-visual</artifactId>
<version>2.4.4</version>
<version>2.5.0</version>
</parent>
<artifactId>pig-codegen</artifactId>
@ -38,7 +38,7 @@
</dependency>
<!--mybatis-->
<dependency>
<groupId>com.baomidou</groupId>
<groupId>com.pig4cloud</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>${mybatis-plus.version}</version>
</dependency>
@ -50,13 +50,13 @@
<dependency>
<groupId>com.pig4cloud</groupId>
<artifactId>pig-common-core</artifactId>
<version>2.4.4</version>
<version>2.5.0</version>
</dependency>
<!--安全模块-->
<dependency>
<groupId>com.pig4cloud</groupId>
<artifactId>pig-common-security</artifactId>
<version>2.4.4</version>
<version>2.5.0</version>
</dependency>
<!--代码生成模板引擎-->
<dependency>

View File

@ -21,7 +21,7 @@
<parent>
<groupId>com.pig4cloud</groupId>
<artifactId>pig-visual</artifactId>
<version>2.4.4</version>
<version>2.5.0</version>
</parent>
<artifactId>pig-monitor</artifactId>

View File

@ -1,15 +0,0 @@
FROM anapsix/alpine-java:8_server-jre_unlimited
MAINTAINER wangiegie@gmail.com
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN mkdir -p /pig-zipkin
WORKDIR /pig-zipkin
EXPOSE 5002
ADD ./pig-visual/pig-zipkin/target/pig-zipkin.jar ./
CMD java -Djava.security.egd=file:/dev/./urandom -jar pig-zipkin.jar

View File

@ -1,94 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>pig-visual</artifactId>
<groupId>com.pig4cloud</groupId>
<version>2.4.4</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pig-zipkin</artifactId>
<packaging>jar</packaging>
<description>pig 服务链路跟踪模块,基于zipkin</description>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<!--排除tomcat依赖-->
<exclusion>
<artifactId>spring-boot-starter-tomcat</artifactId>
<groupId>org.springframework.boot</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>
</dependency>
<!--配置中心客户端-->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
</dependency>
<!--jdbc相关-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<!--zipkin-->
<dependency>
<groupId>io.zipkin.java</groupId>
<artifactId>zipkin-server</artifactId>
<version>${zipkin.version}</version>
<!--排除log4j2 避免和logback冲突警告-->
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-log4j2</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.zipkin.java</groupId>
<artifactId>zipkin-autoconfigure-ui</artifactId>
<version>${zipkin.version}</version>
</dependency>
<!-- 使用mysql存储-->
<dependency>
<groupId>io.zipkin.java</groupId>
<artifactId>zipkin-autoconfigure-storage-mysql</artifactId>
<version>${zipkin.version}</version>
</dependency>
<dependency>
<groupId>io.zipkin.java</groupId>
<artifactId>zipkin-storage-mysql</artifactId>
<version>${zipkin-storage-mysql.version}</version>
</dependency>
<!-- zipkin2.x 需要此包连接操作mysql -->
<dependency>
<groupId>org.jooq</groupId>
<artifactId>jooq</artifactId>
<version>${jooq.version}</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

View File

@ -1,28 +0,0 @@
package com.pig4cloud.pig.zipkin;
import org.springframework.boot.SpringApplication;
import org.springframework.cloud.client.SpringCloudApplication;
import org.springframework.context.annotation.Bean;
import zipkin.storage.mysql.MySQLStorage;
import zipkin2.server.internal.EnableZipkinServer;
import javax.sql.DataSource;
/**
* 服务链路追踪
*
* @author lishangbu
* @date 2019/2/23
*/
@EnableZipkinServer
@SpringCloudApplication
public class PigZipkinApplication {
public static void main(String[] args) {
SpringApplication.run(PigZipkinApplication.class, args);
}
@Bean
public MySQLStorage mySQLStorage(DataSource datasource) {
return MySQLStorage.builder().datasource(datasource).executor(Runnable::run).build();
}
}

View File

@ -1,16 +0,0 @@
${AnsiColor.BRIGHT_YELLOW}
::::::::: ::::::::::: ::::::::
:+: :+: :+: :+: :+:
+:+ +:+ +:+ +:+
+#++:++#+ +#+ :#:
+#+ +#+ +#+ +#+#
#+# #+# #+# #+#
### ########### ########
www.pig4cloud.com
Pig Microservice Architecture

View File

@ -1,26 +0,0 @@
server:
port: 5002
spring:
application:
name: pig-zipkin
profiles:
active: dev
#配置中心
cloud:
config:
fail-fast: true
name: ${spring.application.name}
profile: ${spring.profiles.active}
discovery:
enabled: true
service-id: pig-config
main:
allow-bean-definition-overriding: true
# 注册中心配置
eureka:
instance:
prefer-ip-address: true
client:
service-url:
defaultZone: http://pig:pig@pig-eureka:8761/eureka/

View File

@ -21,7 +21,7 @@
<parent>
<groupId>com.pig4cloud</groupId>
<artifactId>pig</artifactId>
<version>2.4.4</version>
<version>2.5.0</version>
</parent>
<artifactId>pig-visual</artifactId>
@ -31,6 +31,5 @@
<modules>
<module>pig-codegen</module>
<module>pig-monitor</module>
<module>pig-zipkin</module>
</modules>
</project>

58
pom.xml
View File

@ -19,31 +19,33 @@
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>com.pig4cloud</groupId>
<artifactId>pig-cloud-dependencies-parent</artifactId>
<version>Hoxton.RELEASE</version>
</parent>
<groupId>com.pig4cloud</groupId>
<artifactId>pig</artifactId>
<version>2.4.4</version>
<version>2.5.0</version>
<name>${project.artifactId}</name>
<packaging>pom</packaging>
<url>https://www.pig4cloud.com</url>
<properties>
<spring-boot.version>2.1.9.RELEASE</spring-boot.version>
<spring-cloud.version>Greenwich.SR3</spring-cloud.version>
<spring-boot.version>2.2.0.RELEASE</spring-boot.version>
<spring-cloud.version>Hoxton.RC1</spring-cloud.version>
<spring-platform.version>Cairo-SR8</spring-platform.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<spring-boot-admin.version>2.1.6</spring-boot-admin.version>
<spring-boot-admin.version>2.2.0-SNAPSHOT</spring-boot-admin.version>
<hutool.version>5.0.3</hutool.version>
<mybatis-plus.version>3.2.0</mybatis-plus.version>
<kaptcha.version>0.0.9</kaptcha.version>
<velocity.version>1.7</velocity.version>
<jasypt.version>2.1.0</jasypt.version>
<security.oauth.version>2.3.6.RELEASE</security.oauth.version>
<!--zipkin2.12.x需要此版本jooq-->
<jooq.version>3.11.11</jooq.version>
<zipkin.version>2.12.2</zipkin.version>
<zipkin-storage-mysql.version>2.8.4</zipkin-storage-mysql.version>
</properties>
<dependencies>
@ -74,15 +76,6 @@
<artifactId>spring-boot-admin-starter-client</artifactId>
<version>${spring-boot-admin.version}</version>
</dependency>
<!--服务链路追踪-->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-sleuth</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-sleuth-zipkin</artifactId>
</dependency>
<!--断路器依赖-->
<dependency>
<groupId>org.springframework.cloud</groupId>
@ -190,6 +183,25 @@
</build>
<repositories>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>sonatype-nexus-snapshots</id>
<name>Sonatype Nexus Snapshots</name>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>false</enabled>
</releases>
</repository>
<!--阿里云主仓库代理了maven central和jcenter仓库-->
<repository>
<id>aliyun</id>
@ -202,18 +214,6 @@
<enabled>false</enabled>
</snapshots>
</repository>
<!--阿里云代理Spring 官方仓库-->
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://maven.aliyun.com/repository/spring</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<!--阿里云代理Spring 插件仓库-->