diff --git a/MEMO.md b/MEMO.md new file mode 100644 index 00000000..c30419b4 --- /dev/null +++ b/MEMO.md @@ -0,0 +1,41 @@ + +## 未完成目标: + + +### 1、尝试将所有 `` 依赖版本号定义在同一个 pom.xml 里。 **[❌失败]** + +**尝试1:将所有 `` 定义在 `sa-token-dependencies` 里:** + +结果: 无法在 `sa-token-spring-boot2/3/4-dependencies` 中引用这些 ``,因为 ` import` 只会导入目标的 `` 版本号定义,不会导入目标的 `` 属性。 + +`` 只会在 父子结构中向下传递,不会在 ` import` 中传递。 + + +**尝试2:将所有 `` 定义在 `sa-token-parent` 里:** + +结果:在 `sa-token-dependencies` 里无法引用这些 ``,因为 `sa-token-parent` 不是 `sa-token-dependencies` 的父模块。 + +将 `sa-token-parent` 定义为 `sa-token-dependencies` 的父模块行吗? + +不行,因为在 `sa-token-parent` 通过 ` import` 导入了 `sa-token-dependencies`,如果再把 `sa-token-parent` 定义为 `sa-token-dependencies` 的父模块,会造成循环依赖。 + +执行 `mvn package` 打包时,maven 会直接报错: + +``` +[ERROR] [ERROR] Some problems were encountered while processing the POMs: +[ERROR] The dependencies of type=pom and with scope=import form a cycle: cn.dev33:sa-token-parent:1.44.0 -> cn.dev33:sa-token-basic-dependencies:1.44.0 -> cn.dev33:sa-token-basic-dependencies:1.44.0 @ cn.dev33:sa-token-basic-dependencies:1.44.0 + @ +[ERROR] The build could not read 1 project -> [Help 1] +[ERROR] +[ERROR] The project cn.dev33:sa-token-parent:1.44.0 (E:\work\project-yun\sa-token\pom.xml) has 1 error +[ERROR] The dependencies of type=pom and with scope=import form a cycle: cn.dev33:sa-token-parent:1.44.0 -> cn.dev33:sa-token-basic-dependencies:1.44.0 -> cn.dev33:sa-token-basic-dependencies:1.44.0 @ cn.dev33:sa-token-basic-dependencies:1.44.0 +[ERROR] +[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. +[ERROR] Re-run Maven using the -X switch to enable full debug logging. +[ERROR] +[ERROR] For more information about the errors and possible solutions, please read the following articles: +[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException +``` + + + diff --git a/pom.xml b/pom.xml index 2dd4a8fd..7fef7524 100644 --- a/pom.xml +++ b/pom.xml @@ -109,7 +109,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.4.1 + 3.12.0 true @@ -132,7 +132,7 @@ jar - -Xdoclint:none + none diff --git a/sa-token-bom/pom.xml b/sa-token-bom/pom.xml index a0585006..51c916fa 100644 --- a/sa-token-bom/pom.xml +++ b/sa-token-bom/pom.xml @@ -4,6 +4,13 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 + + org.sonatype.oss + oss-parent + 7 + + + cn.dev33 sa-token-bom ${revision} @@ -264,14 +271,6 @@ - - - org.sonatype.oss - oss-parent - 7 - - - diff --git a/sa-token-dependencies/pom.xml b/sa-token-dependencies/pom.xml index 1da1dfbb..176d9f7f 100644 --- a/sa-token-dependencies/pom.xml +++ b/sa-token-dependencies/pom.xml @@ -4,16 +4,20 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 - cn.dev33 + + cn.dev33 + sa-token-bom + ${revision} + + ../sa-token-bom/pom.xml + + pom + sa-token-dependencies - ${revision} - pom sa-token-dependencies Sa-Token Dependencies - 1.44.0 - 2.13.4.1 2.11.2 @@ -250,96 +254,8 @@ ${okhttps.version} - - - cn.dev33 - sa-token-bom - ${revision} - pom - import - - - - - org.sonatype.oss - oss-parent - 7 - - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.10.1 - - 1.8 - 1.8 - UTF-8 - - - - - - org.codehaus.mojo - flatten-maven-plugin - 1.2.7 - - true - resolveCiFriendliesOnly - - - - flatten - process-resources - - flatten - - - - flatten.clean - clean - - clean - - - - - - - - - - org.eclipse.m2e - lifecycle-mapping - 1.0.0 - - - - - - org.apache.maven.plugins - maven-enforcer-plugin - [1.0.0,) - - enforce - - - - - - - - - - - - - \ No newline at end of file diff --git a/sa-token-special-dependencies/pom.xml b/sa-token-special-dependencies/pom.xml index d6c43f18..66561f14 100644 --- a/sa-token-special-dependencies/pom.xml +++ b/sa-token-special-dependencies/pom.xml @@ -14,7 +14,7 @@ pom sa-token-special-dependencies sa-token-special-dependencies - Sa-Token Special Dependencies - 聚合 Spring Boot 各版本依赖 + Sa-Token Special Dependencies sa-token-spring-boot2-dependencies diff --git a/sa-token-starter/sa-token-spring-boot-reactor-v2v3v4-common/src/main/java/cn/dev33/satoken/reactor/filter/SaReactorFilter.java b/sa-token-starter/sa-token-spring-boot-reactor-v2v3v4-common/src/main/java/cn/dev33/satoken/reactor/filter/SaReactorFilter.java index 83c59151..00e1f5ea 100644 --- a/sa-token-starter/sa-token-spring-boot-reactor-v2v3v4-common/src/main/java/cn/dev33/satoken/reactor/filter/SaReactorFilter.java +++ b/sa-token-starter/sa-token-spring-boot-reactor-v2v3v4-common/src/main/java/cn/dev33/satoken/reactor/filter/SaReactorFilter.java @@ -147,3 +147,10 @@ public class SaReactorFilter implements SaFilter, WebFilter { return chain.filter(exchange); } } + +/* + * 三种 Filter : + * WebFilter: Spring WebFlux 的过滤器,用于拦截 Web 请求 + * GlobalFilter: Spring Cloud Gateway 的全局过滤器,用于拦截 Gateway 请求 + * GatewayFilter: Spring Cloud Gateway 的局部过滤器,用于拦截 Gateway 请求 + */ \ No newline at end of file diff --git a/sa-token-test/pom.xml b/sa-token-test/pom.xml index 87af7e7b..f8b8b626 100644 --- a/sa-token-test/pom.xml +++ b/sa-token-test/pom.xml @@ -36,18 +36,30 @@ org.springframework.boot spring-boot-starter-test - 2.5.12 test org.springframework.boot spring-boot-configuration-processor - 2.5.12 true + + + + + cn.dev33 + sa-token-spring-boot2-dependencies + ${project.version} + pom + import + + + + +