This commit is contained in:
5
.idea/compiler.xml
generated
5
.idea/compiler.xml
generated
@@ -6,8 +6,11 @@
|
||||
<sourceOutputDir name="target/generated-sources/annotations" />
|
||||
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
||||
<outputRelativeToContentRoot value="true" />
|
||||
<module name="redis-schema-checker" />
|
||||
<module name="redis-schema-checker-parent" />
|
||||
</profile>
|
||||
</annotationProcessing>
|
||||
<bytecodeTargetLevel>
|
||||
<module name="redis-schema-checker" target="11" />
|
||||
</bytecodeTargetLevel>
|
||||
</component>
|
||||
</project>
|
||||
@@ -147,11 +147,11 @@ jobs:
|
||||
## 6. 工具发布流程(redisCheck 仓库)
|
||||
|
||||
```bash
|
||||
# 在 redisCheck 仓库
|
||||
# 在 redisCheck 仓库根目录
|
||||
mvn clean package -DskipTests
|
||||
|
||||
# 发布到 Nexus(需配置 settings.xml)
|
||||
mvn deploy -DskipTests
|
||||
# 发布到 Nexus(需配置 settings.xml,并开启 deploy-nexus profile)
|
||||
mvn clean deploy -Dnexus.deploy.enabled=true -DskipTests
|
||||
```
|
||||
|
||||
发布产物:
|
||||
|
||||
46
docs/实施方案.md
46
docs/实施方案.md
@@ -171,57 +171,33 @@ flowchart TB
|
||||
|
||||
```text
|
||||
redisCheck/
|
||||
├── pom.xml
|
||||
├── pom.xml # 单模块工程(无父子结构)
|
||||
├── docs/
|
||||
│ ├── 实施方案.md # 本文档
|
||||
│ ├── 配置说明.md # YAML 配置项详解
|
||||
│ └── CI集成说明.md # 业务仓库接入步骤
|
||||
├── redis-schema-checker/
|
||||
│ ├── pom.xml
|
||||
│ └── src/
|
||||
│ ├── 实施方案.md
|
||||
│ ├── 配置说明.md
|
||||
│ └── CI集成说明.md
|
||||
├── src/
|
||||
│ ├── main/
|
||||
│ │ ├── resources/
|
||||
│ │ │ └── default-config.yaml # 内置默认配置(随 jar 发布)
|
||||
│ │ └── java/com/codechecker/redis/
|
||||
│ │ ├── cli/ # 命令行入口
|
||||
│ │ │ └── RedisSchemaCheckerMain.java
|
||||
│ │ ├── config/ # 配置模型
|
||||
│ │ │ ├── CheckerConfig.java
|
||||
│ │ │ └── ConfigLoader.java
|
||||
│ │ ├── git/ # Git 操作
|
||||
│ │ │ ├── GitDiffScanner.java
|
||||
│ │ │ └── GitException.java
|
||||
│ │ ├── analyze/ # 编排与工作树扫描
|
||||
│ │ │ ├── SchemaCheckAnalyzer.java
|
||||
│ │ │ ├── FileScanner.java
|
||||
│ │ │ └── GlobMatcher.java
|
||||
│ │ ├── detector/ # Redis 写入点检测
|
||||
│ │ │ ├── RedisWritePointDetector.java
|
||||
│ │ │ └── WritePoint.java
|
||||
│ │ ├── schema/ # Schema 提取
|
||||
│ │ │ ├── JavaSchemaExtractor.java
|
||||
│ │ │ ├── SourceIndex.java
|
||||
│ │ │ ├── TypeSchema.java
|
||||
│ │ │ ├── FieldSchema.java
|
||||
│ │ │ ├── JsonType.java
|
||||
│ │ │ └── AnnotationSupport.java
|
||||
│ │ ├── diff/ # 结构对比
|
||||
│ │ │ ├── SchemaDiffer.java
|
||||
│ │ │ ├── SchemaChange.java
|
||||
│ │ │ ├── ChangeType.java
|
||||
│ │ │ └── Severity.java
|
||||
│ │ ├── key/ # Key 推断
|
||||
│ │ │ └── RedisKeyResolver.java
|
||||
│ │ ├── report/ # 报告
|
||||
│ │ │ ├── ReportBuilder.java
|
||||
│ │ │ └── CheckReport.java
|
||||
│ │ └── notify/ # 企微通知
|
||||
│ │ └── WeComNotifier.java
|
||||
│ └── test/
|
||||
│ ├── resources/fixtures/tenant/ # 夹具:TenantVO/Helper 新旧版本
|
||||
│ └── java/... # 各模块单测
|
||||
└── .gitea/
|
||||
└── demo.yaml # 工具自身 CI(可选)
|
||||
│ ├── resources/fixtures/tenant/
|
||||
│ └── java/...
|
||||
├── .gitea/
|
||||
│ ├── workflows/redis-schema-check.yaml
|
||||
│ └── config/redis-schema-check-config.yaml
|
||||
└── target/ # 构建产物
|
||||
```
|
||||
|
||||
### 5.1 Maven 坐标
|
||||
|
||||
139
pom.xml
139
pom.xml
@@ -5,16 +5,12 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>com.codechecker</groupId>
|
||||
<artifactId>redis-schema-checker-parent</artifactId>
|
||||
<artifactId>redis-schema-checker</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
<packaging>pom</packaging>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>redis-schema-checker-parent</name>
|
||||
<description>Redis 序列化结构变更检测工具(父工程)</description>
|
||||
|
||||
<modules>
|
||||
<module>redis-schema-checker</module>
|
||||
</modules>
|
||||
<name>redis-schema-checker</name>
|
||||
<description>基于 JavaParser 的 Redis value 序列化结构变更检测器</description>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>11</maven.compiler.source>
|
||||
@@ -27,5 +23,132 @@
|
||||
<picocli.version>4.7.5</picocli.version>
|
||||
<junit.version>5.10.2</junit.version>
|
||||
<maven.shade.version>3.5.1</maven.shade.version>
|
||||
|
||||
<!-- 制品库上传开关:默认关闭,发布时加 -Dnexus.deploy.enabled=true -->
|
||||
<nexus.deploy.enabled>false</nexus.deploy.enabled>
|
||||
<!-- server.id 必须与 settings.xml 中 <server><id> 一致 -->
|
||||
<nexus.repository.id>fantaibao-fantaibao-maven-repository</nexus.repository.id>
|
||||
<!-- 上传必须用 hosted 仓库;group 仓库只能拉依赖不能 deploy -->
|
||||
<nexus.repository.url>http://192.168.3.25:18081/nexus/repository/maven-releases/</nexus.repository.url>
|
||||
<nexus.snapshots.repository.url>${nexus.repository.url}</nexus.snapshots.repository.url>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.github.javaparser</groupId>
|
||||
<artifactId>javaparser-symbol-solver-core</artifactId>
|
||||
<version>${javaparser.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.yaml</groupId>
|
||||
<artifactId>snakeyaml</artifactId>
|
||||
<version>${snakeyaml.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-databind</artifactId>
|
||||
<version>${jackson.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>info.picocli</groupId>
|
||||
<artifactId>picocli</artifactId>
|
||||
<version>${picocli.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter</artifactId>
|
||||
<version>${junit.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>deploy-nexus</id>
|
||||
<activation>
|
||||
<property>
|
||||
<name>nexus.deploy.enabled</name>
|
||||
<value>true</value>
|
||||
</property>
|
||||
</activation>
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
<id>${nexus.repository.id}</id>
|
||||
<url>${nexus.repository.url}</url>
|
||||
</repository>
|
||||
<snapshotRepository>
|
||||
<id>${nexus.repository.id}</id>
|
||||
<url>${nexus.snapshots.repository.url}</url>
|
||||
</snapshotRepository>
|
||||
</distributionManagement>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<version>3.1.2</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>deploy-to-nexus</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>deploy</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
<build>
|
||||
<finalName>redis-schema-checker-${project.version}</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>3.2.5</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<version>${maven.shade.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>shade</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<createDependencyReducedPom>false</createDependencyReducedPom>
|
||||
<transformers>
|
||||
<transformer
|
||||
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
|
||||
<mainClass>com.codechecker.redis.cli.RedisSchemaCheckerMain</mainClass>
|
||||
</transformer>
|
||||
<transformer
|
||||
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
|
||||
</transformers>
|
||||
<filters>
|
||||
<filter>
|
||||
<artifact>*:*</artifact>
|
||||
<excludes>
|
||||
<exclude>META-INF/*.SF</exclude>
|
||||
<exclude>META-INF/*.DSA</exclude>
|
||||
<exclude>META-INF/*.RSA</exclude>
|
||||
<exclude>module-info.class</exclude>
|
||||
</excludes>
|
||||
</filter>
|
||||
</filters>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
||||
@@ -1,97 +0,0 @@
|
||||
<?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>
|
||||
|
||||
<parent>
|
||||
<groupId>com.codechecker</groupId>
|
||||
<artifactId>redis-schema-checker-parent</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>redis-schema-checker</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>redis-schema-checker</name>
|
||||
<description>基于 JavaParser 的 Redis value 序列化结构变更检测器</description>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.github.javaparser</groupId>
|
||||
<artifactId>javaparser-symbol-solver-core</artifactId>
|
||||
<version>${javaparser.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.yaml</groupId>
|
||||
<artifactId>snakeyaml</artifactId>
|
||||
<version>${snakeyaml.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-databind</artifactId>
|
||||
<version>${jackson.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>info.picocli</groupId>
|
||||
<artifactId>picocli</artifactId>
|
||||
<version>${picocli.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter</artifactId>
|
||||
<version>${junit.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>redis-schema-checker-${project.version}</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>3.2.5</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<version>${maven.shade.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>shade</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<createDependencyReducedPom>false</createDependencyReducedPom>
|
||||
<transformers>
|
||||
<transformer
|
||||
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
|
||||
<mainClass>com.codechecker.redis.cli.RedisSchemaCheckerMain</mainClass>
|
||||
</transformer>
|
||||
<transformer
|
||||
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
|
||||
</transformers>
|
||||
<filters>
|
||||
<filter>
|
||||
<artifact>*:*</artifact>
|
||||
<excludes>
|
||||
<exclude>META-INF/*.SF</exclude>
|
||||
<exclude>META-INF/*.DSA</exclude>
|
||||
<exclude>META-INF/*.RSA</exclude>
|
||||
<exclude>module-info.class</exclude>
|
||||
</excludes>
|
||||
</filter>
|
||||
</filters>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
Reference in New Issue
Block a user