You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shenyu.apache.org by xi...@apache.org on 2023/09/18 10:47:00 UTC

[shenyu] branch master updated: Migrate Admin swagger from springfox to springdoc (#5113)

This is an automated email from the ASF dual-hosted git repository.

xiaoyu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shenyu.git


The following commit(s) were added to refs/heads/master by this push:
     new 77f401bbfd Migrate Admin swagger from springfox to springdoc (#5113)
77f401bbfd is described below

commit 77f401bbfdea966a05e4a275415cae131ed512bc
Author: 吴伟杰 <wu...@apache.org>
AuthorDate: Mon Sep 18 18:46:54 2023 +0800

    Migrate Admin swagger from springfox to springdoc (#5113)
    
    * Migrate Admin swagger from springfox to springdoc
    
    * Complete SwaggerConfigurationTest
    
    * Update LICENSE for Shenyu Admin
    
    * Remove unused springfox.version from pom.xml
    
    * Remove unused ShenyuHttpRegistryControllerBeanPostProcessor
    
    ---------
    
    Co-authored-by: xiaoyu <xi...@apache.org>
---
 pom.xml                                            |  15 +--
 shenyu-admin/pom.xml                               |   9 +-
 .../shenyu/admin/config/SwaggerConfiguration.java  | 126 ++++-----------------
 ...nyuHttpRegistryControllerBeanPostProcessor.java |  49 --------
 shenyu-admin/src/main/resources/application.yml    |  15 ++-
 .../admin/config/SwaggerConfigurationTest.java     |  17 ++-
 .../src/main/release-docs/LICENSE                  |  23 ++--
 .../licenses/LICENSE-jakarta.activation-api.txt    |  28 +++++
 .../licenses/LICENSE-jakarta.xml.bind-api.txt      |  28 +++++
 9 files changed, 115 insertions(+), 195 deletions(-)

diff --git a/pom.xml b/pom.xml
index e903cc0d6d..4dc04a28b8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -101,7 +101,6 @@
 
         <!-- dependency version start -->
         <jasypt.version>1.9.2</jasypt.version>
-        <springfox.version>2.6.1</springfox.version>
         <mybatis.starter.version>2.2.2</mybatis.starter.version>
         <mysql.version>8.0.29</mysql.version>
         <commons-lang3.version>3.12.0</commons-lang3.version>
@@ -121,7 +120,7 @@
         <okhttp.version>4.9.3</okhttp.version>
         <prometheus-java-client.version>0.15.0</prometheus-java-client.version>
         <prometheus-jmx.version>0.15.0</prometheus-jmx.version>
-        <swagger.version>2.9.2</swagger.version>
+        <springdoc.version>1.7.0</springdoc.version>
         <sofa.rpc.version>5.7.6</sofa.rpc.version>
         <tars.version>1.7.2</tars.version>
         <skipTests>false</skipTests>
@@ -423,15 +422,9 @@
             </dependency>
 
             <dependency>
-                <groupId>io.springfox</groupId>
-                <artifactId>springfox-swagger2</artifactId>
-                <version>${swagger.version}</version>
-            </dependency>
-
-            <dependency>
-                <groupId>io.springfox</groupId>
-                <artifactId>springfox-swagger-ui</artifactId>
-                <version>${swagger.version}</version>
+                <groupId>org.springdoc</groupId>
+                <artifactId>springdoc-openapi-ui</artifactId>
+                <version>${springdoc.version}</version>
             </dependency>
 
             <dependency>
diff --git a/shenyu-admin/pom.xml b/shenyu-admin/pom.xml
index 1b98adf1a4..a5465ab0a4 100644
--- a/shenyu-admin/pom.xml
+++ b/shenyu-admin/pom.xml
@@ -233,13 +233,8 @@
         </dependency>
 
         <dependency>
-            <groupId>io.springfox</groupId>
-            <artifactId>springfox-swagger2</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>io.springfox</groupId>
-            <artifactId>springfox-swagger-ui</artifactId>
+            <groupId>org.springdoc</groupId>
+            <artifactId>springdoc-openapi-ui</artifactId>
         </dependency>
 
         <dependency>
diff --git a/shenyu-admin/src/main/java/org/apache/shenyu/admin/config/SwaggerConfiguration.java b/shenyu-admin/src/main/java/org/apache/shenyu/admin/config/SwaggerConfiguration.java
index 521f813f57..b2f43412d9 100644
--- a/shenyu-admin/src/main/java/org/apache/shenyu/admin/config/SwaggerConfiguration.java
+++ b/shenyu-admin/src/main/java/org/apache/shenyu/admin/config/SwaggerConfiguration.java
@@ -17,39 +17,22 @@
 
 package org.apache.shenyu.admin.config;
 
-import java.lang.reflect.Field;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Objects;
-import java.util.stream.Collectors;
-
-import org.apache.shenyu.common.constant.Constants;
+import io.swagger.v3.oas.models.Components;
+import io.swagger.v3.oas.models.OpenAPI;
+import io.swagger.v3.oas.models.info.Contact;
+import io.swagger.v3.oas.models.info.Info;
+import io.swagger.v3.oas.models.security.SecurityRequirement;
+import io.swagger.v3.oas.models.security.SecurityScheme;
+import io.swagger.v3.oas.models.security.SecurityScheme.In;
+import io.swagger.v3.oas.models.security.SecurityScheme.Type;
 import org.apache.shenyu.common.utils.VersionUtils;
-import org.springframework.beans.BeansException;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.beans.factory.config.BeanPostProcessor;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
-import org.springframework.util.ReflectionUtils;
-import org.springframework.web.servlet.mvc.method.RequestMappingInfoHandlerMapping;
-import springfox.documentation.builders.ApiInfoBuilder;
-import springfox.documentation.builders.ParameterBuilder;
-import springfox.documentation.builders.PathSelectors;
-import springfox.documentation.builders.RequestHandlerSelectors;
-import springfox.documentation.schema.ModelRef;
-import springfox.documentation.service.ApiInfo;
-import springfox.documentation.service.Contact;
-import springfox.documentation.service.Parameter;
-import springfox.documentation.spi.DocumentationType;
-import springfox.documentation.spring.web.plugins.Docket;
-import springfox.documentation.spring.web.plugins.WebMvcRequestHandlerProvider;
-import springfox.documentation.swagger2.annotations.EnableSwagger2;
 
 /**
  * Configuration class for Swagger API document.
  */
 @Configuration
-@EnableSwagger2
 public class SwaggerConfiguration {
 
     private static final String DEFAULT_SWAGGER_API_VERSION = "2.3.0";
@@ -66,91 +49,30 @@ public class SwaggerConfiguration {
 
     private static final String TOKEN_DESCRIPTION = "user auth";
 
-    private static final String TOKEN_MODEL_REF_TYPE = "string";
-
-    private static final String TOKEN_PARAMETER_TYPE = "header";
-
-    @Value("${shenyu.swagger.enable:false}")
-    private boolean enable;
-
     public SwaggerConfiguration() {
     }
 
-    /**
-     * Configure The Docket with Swagger.
-     *
-     * @return Docket {@linkplain Docket}
-     */
-    @Bean
-    public Docket createRestApi() {
-        ParameterBuilder commonParam = new ParameterBuilder();
-
-        // X-Access-Token
-        List<Parameter> pars = new ArrayList<>();
-        commonParam.name(Constants.X_ACCESS_TOKEN)
-            .description(TOKEN_DESCRIPTION)
-            .modelRef(new ModelRef(TOKEN_MODEL_REF_TYPE))
-            .parameterType(TOKEN_PARAMETER_TYPE)
-            .required(false);
-        pars.add(commonParam.build());
-
-        return new Docket(DocumentationType.SWAGGER_2)
-            .apiInfo(this.apiInfo())
-            .enable(enable)
-            .globalOperationParameters(pars)
-            .select()
-            .apis(RequestHandlerSelectors.basePackage("org.apache.shenyu.admin.controller"))
-            .paths(PathSelectors.any())
-            .build();
-    }
-
-    /**
-     * use bean to be compatible with springboot 2.6.8.
-     * @return BeanPostProcessor
-     */
-    @Bean
-    public BeanPostProcessor springfoxBeanHandler() {
-        return new BeanPostProcessor() {
-            @Override
-            public Object postProcessAfterInitialization(final Object bean, final String beanName) throws BeansException {
-                if (bean instanceof WebMvcRequestHandlerProvider) {
-                    customizeSpringfoxHandlerMappings(getHandlerMappings(bean));
-                }
-                return bean;
-            }
-
-            private <T extends RequestMappingInfoHandlerMapping> void customizeSpringfoxHandlerMappings(final List<T> mappings) {
-                List<T> copy = mappings.stream()
-                        .filter(mapping -> Objects.isNull(mapping.getPatternParser()))
-                        .collect(Collectors.toList());
-                mappings.clear();
-                mappings.addAll(copy);
-            }
-
-            @SuppressWarnings("unchecked")
-            private List<RequestMappingInfoHandlerMapping> getHandlerMappings(final Object bean) {
-                try {
-                    Field field = ReflectionUtils.findField(bean.getClass(), "handlerMappings");
-                    field.setAccessible(true);
-                    return (List<RequestMappingInfoHandlerMapping>) field.get(bean);
-                } catch (IllegalArgumentException | IllegalAccessException e) {
-                    throw new IllegalStateException(e);
-                }
-            }
-        };
-    }
-
     /**
      * Fetch version information from pom.xml and set title, version, description,
      * contact for Swagger API document.
      *
      * @return Api info
      */
-    private ApiInfo apiInfo() {
-        return new ApiInfoBuilder()
-            .title(TITLE).description(DESCRIPTION)
-            .version(VersionUtils.getVersion(getClass(), DEFAULT_SWAGGER_API_VERSION))
-            .contact(new Contact(CONTACT_NAME, CONTACT_URL, CONTACT_EMAIL))
-            .build();
+    @Bean
+    public OpenAPI apiInfo() {
+        return new OpenAPI()
+                .info(new Info()
+                        .title(TITLE).description(DESCRIPTION)
+                        .version(VersionUtils.getVersion(getClass(), DEFAULT_SWAGGER_API_VERSION))
+                        .contact(new Contact().name(CONTACT_NAME).url(CONTACT_URL).email(CONTACT_EMAIL))
+                )
+                .components(new Components()
+                        .addSecuritySchemes(org.apache.shenyu.common.constant.Constants.X_ACCESS_TOKEN, new SecurityScheme()
+                                .name(org.apache.shenyu.common.constant.Constants.X_ACCESS_TOKEN)
+                                .type(Type.APIKEY)
+                                .in(In.HEADER)
+                                .description(TOKEN_DESCRIPTION)
+                        )
+                ).addSecurityItem(new SecurityRequirement().addList(org.apache.shenyu.common.constant.Constants.X_ACCESS_TOKEN));
     }
 }
diff --git a/shenyu-admin/src/main/java/org/apache/shenyu/admin/spring/ShenyuHttpRegistryControllerBeanPostProcessor.java b/shenyu-admin/src/main/java/org/apache/shenyu/admin/spring/ShenyuHttpRegistryControllerBeanPostProcessor.java
deleted file mode 100644
index 10af5e8f21..0000000000
--- a/shenyu-admin/src/main/java/org/apache/shenyu/admin/spring/ShenyuHttpRegistryControllerBeanPostProcessor.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.admin.spring;
-
-import org.apache.shenyu.admin.controller.ShenyuClientHttpRegistryController;
-import org.apache.shenyu.common.exception.ShenyuException;
-import org.springframework.beans.BeansException;
-import org.springframework.beans.factory.config.BeanPostProcessor;
-import org.springframework.stereotype.Component;
-import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;
-
-import java.lang.reflect.Method;
-
-/**
- * The type shenyu http registry controller bean post processor.
- */
-@Component
-public class ShenyuHttpRegistryControllerBeanPostProcessor implements BeanPostProcessor {
-
-    @Override
-    public Object postProcessAfterInitialization(final Object bean, final String beanName) throws BeansException {
-        if (bean instanceof ShenyuClientHttpRegistryController) {
-            try {
-                RequestMappingHandlerMapping requestMappingHandlerMapping = SpringBeanUtils.getInstance().getBean("requestMappingHandlerMapping", RequestMappingHandlerMapping.class);
-                Method method = requestMappingHandlerMapping.getClass().getSuperclass().getSuperclass().getDeclaredMethod("detectHandlerMethods", Object.class);
-                method.setAccessible(true);
-                method.invoke(requestMappingHandlerMapping, beanName);
-            } catch (Exception e) {
-                throw new ShenyuException(e.getMessage());
-            }
-        }
-        return bean;
-    }
-}
diff --git a/shenyu-admin/src/main/resources/application.yml b/shenyu-admin/src/main/resources/application.yml
index 38aacc9ddb..c0f0723205 100755
--- a/shenyu-admin/src/main/resources/application.yml
+++ b/shenyu-admin/src/main/resources/application.yml
@@ -125,13 +125,11 @@ shenyu:
       - /actuator/health/** # /actuator/health/readiness /actuator/health/liveness
       - /actuator/prometheus
       - /swagger-ui.html
+      - /swagger-ui/**
       - /webjars/**
-      - /swagger-resources/**
-      - /v2/api-docs
+      - /v3/api-docs/**
       - /csrf
       - /alert/report
-  swagger:
-    enable: true
   dashboard:
     core:
       onlySuperAdminPermission:
@@ -148,6 +146,15 @@ shenyu:
         - system:resource:deleteButton
         - system:resource:deleteMenu
 
+springdoc:
+  api-docs:
+    enabled: true
+  swagger-ui:
+    enabled: true
+    tags-sorter: alpha
+  packages-to-scan: org.apache.shenyu.admin.controller
+  paths-to-match: /**
+
 logging:
   level:
     root: info
diff --git a/shenyu-admin/src/test/java/org/apache/shenyu/admin/config/SwaggerConfigurationTest.java b/shenyu-admin/src/test/java/org/apache/shenyu/admin/config/SwaggerConfigurationTest.java
index e514044aa0..71db596406 100644
--- a/shenyu-admin/src/test/java/org/apache/shenyu/admin/config/SwaggerConfigurationTest.java
+++ b/shenyu-admin/src/test/java/org/apache/shenyu/admin/config/SwaggerConfigurationTest.java
@@ -17,11 +17,12 @@
 
 package org.apache.shenyu.admin.config;
 
+import io.swagger.v3.oas.models.OpenAPI;
+import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.ExtendWith;
 import org.mockito.InjectMocks;
 import org.mockito.junit.jupiter.MockitoExtension;
-import org.springframework.test.util.ReflectionTestUtils;
 
 import static org.junit.jupiter.api.Assertions.assertNotNull;
 
@@ -35,13 +36,11 @@ public final class SwaggerConfigurationTest {
     private SwaggerConfiguration swaggerConfiguration;
 
     @Test
-    public void testCreateRestApi() {
-        assertNotNull(swaggerConfiguration.createRestApi());
-    }
-
-    @Test
-    public void testSwaggerEnable() {
-        ReflectionTestUtils.setField(swaggerConfiguration, "enable", true);
-        assertNotNull(swaggerConfiguration.createRestApi());
+    public void testApiInfo() {
+        OpenAPI actual = swaggerConfiguration.apiInfo();
+        assertNotNull(actual);
+        Assertions.assertEquals(1, actual.getSecurity().size());
+        Assertions.assertEquals(1, actual.getSecurity().get(0).size());
+        Assertions.assertTrue(actual.getSecurity().get(0).containsKey(org.apache.shenyu.common.constant.Constants.X_ACCESS_TOKEN));
     }
 }
diff --git a/shenyu-dist/shenyu-admin-dist/src/main/release-docs/LICENSE b/shenyu-dist/shenyu-admin-dist/src/main/release-docs/LICENSE
index 238133bbed..312c62fa0b 100644
--- a/shenyu-dist/shenyu-admin-dist/src/main/release-docs/LICENSE
+++ b/shenyu-dist/shenyu-admin-dist/src/main/release-docs/LICENSE
@@ -220,7 +220,6 @@ The text of each license is the standard Apache 2.0 license.
     annotations 4.1.1.4: http://source.android.com, Apache 2.0
     attoparser 2.0.5.RELEASE: http://www.attoparser.org, Apache 2.0
     audience-annotations 0.5.0: https://yetus.apache.org/audience-annotations, Apache 2.0
-    byte-buddy 1.12.6: https://bytebuddy.net/byte-buddy, Apache 2.0
     caffeine 2.9.3 https://github.com/ben-manes/caffeine, Apache 2.0
     classmate 1.5.1: https://github.com/FasterXML/java-classmate, Apache 2.0
     commons-beanutils 1.9.4: https://github.com/apache/commons-beanutils, Apache 2.0
@@ -273,7 +272,6 @@ The text of each license is the standard Apache 2.0 license.
     log4j-api 2.17.2: https://logging.apache.org/log4j/2.x/log4j-api, Apache 2.0
     log4j-to-slf4j 2.17.2: https://logging.apache.org/log4j/2.x/log4j-to-slf4j, Apache 2.0
     logging-interceptor 4.9.3: https://github.com/square/okhttp, Apache 2.0
-    mapstruct 1.2.0.Final: https://github.com/mapstruct/mapstruct, Apache 2.0
     micrometer-core 1.9.12: https://github.com/micrometer-metrics/micrometer, Apache 2.0
     micrometer-registry-prometheus 1.9.12: https://github.com/micrometer-metrics/micrometer, Apache 2.0
     mybatis 3.5.9: http://www.mybatis.org/mybatis-3, Apache 2.0
@@ -351,26 +349,22 @@ The text of each license is the standard Apache 2.0 license.
     spring-core 5.3.28: https://mvnrepository.com/artifact/org.springframework/spring-context-support, Apache 2.0
     spring-data-commons 2.7.13: https://mvnrepository.com/artifact/org.springframework.data/spring-data-commons, Apache 2.0
 	spring-data-ldap 2.7.13: https://mvnrepository.com/artifact/org.springframework.data/spring-data-ldap, Apache 2.0
+	springdoc-openapi-common 1.7.0: https://github.com/springdoc/springdoc-openapi, Apache 2.0
+	springdoc-openapi-ui 1.7.0: https://github.com/springdoc/springdoc-openapi, Apache 2.0
+	springdoc-openapi-webmvc-core 1.7.0: https://github.com/springdoc/springdoc-openapi, Apache 2.0
     spring-expression 5.3.28: https://mvnrepository.com/artifact/org.springframework/spring-expression, Apache 2.0
-    springfox-core 2.9.2: https://mvnrepository.com/artifact/io.springfox/springfox-core, Apache 2.0
-    springfox-schema 2.9.2: https://mvnrepository.com/artifact/io.springfox/springfox-schema, Apache 2.0
-    springfox-spi 2.9.2: https://mvnrepository.com/artifact/io.springfox/springfox-spi, Apache 2.0
-    springfox-spring-web 2.9.2: https://mvnrepository.com/artifact/io.springfox/springfox-spring-web/2.9.2, Apache 2.0
-    springfox-swagger2 2.9.2: https://mvnrepository.com/artifact/io.springfox/springfox-swagger2/2.9.2, Apache 2.0
-    springfox-swagger-common 2.9.2: https://mvnrepository.com/artifact/io.springfox/springfox-swagger-common/2.9.2, Apache 2.0
-    springfox-swagger-ui 2.9.2: https://mvnrepository.com/artifact/io.springfox/springfox-swagger-ui/2.9.2, Apache 2.0
     spring-jcl 5.3.28: https://mvnrepository.com/artifact/org.springframework/spring-jcl, Apache 2.0
     spring-jdbc 5.3.28: https://mvnrepository.com/artifact/org.springframework/spring-jdbc, Apache 2.0
     spring-ldap-core 2.4.1: https://mvnrepository.com/artifact/org.springframework.ldap/spring-ldap-core, Apache 2.0
     spring-messaging 5.3.28: https://mvnrepository.com/artifact/org.springframework/spring-messaging, Apache 2.0
-    spring-plugin-core 1.2.0.RELEASE: https://mvnrepository.com/artifact/org.springframework.plugin/spring-plugin-core, Apache 2.0
-    spring-plugin-metadata 1.2.0.RELEASE: https://mvnrepository.com/artifact/org.springframework.plugin/spring-plugin-metadata, Apache 2.0
     spring-tx 5.3.28: https://mvnrepository.com/artifact/org.springframework/spring-tx, Apache 2.0
     spring-web 5.3.28: https://mvnrepository.com/artifact/org.springframework/spring-web, Apache 2.0
     spring-webmvc 5.3.28: https://mvnrepository.com/artifact/org.springframework/spring-webmvc, Apache 2.0
     spring-websocket 5.3.28: https://mvnrepository.com/artifact/org.springframework/spring-websocket, Apache 2.0
-    swagger-annotations 1.5.20: https://github.com/swagger-api/swagger-core/modules/swagger-annotations, Apache 2.0
-    swagger-models 1.5.20: https://github.com/swagger-api/swagger-core/modules/swagger-models, Apache 2.0
+    swagger-annotations 2.2.9: https://github.com/swagger-api/swagger-core, Apache 2.0
+    swagger-core 2.2.9: https://github.com/swagger-api/swagger-core, Apache 2.0
+    swagger-models 2.2.9: https://github.com/swagger-api/swagger-core, Apache 2.0
+    swagger-ui 4.18.2: https://github.com/swagger-api/swagger-ui, Apache 2.0
     thymeleaf 3.0.15.RELEASE: http://www.thymeleaf.org, Apache 2.0
     thymeleaf-extras-java8time-3.0.4.RELEASE: http://www.thymeleaf.org, Apache 2.0
     thymeleaf-spring5-3.0.15.RELEASE: http://www.thymeleaf.org, Apache 2.0
@@ -392,6 +386,7 @@ The text of each license is the standard Apache 2.0 license.
     reactor-netty-core 1.0.33 https://github.com/reactor/reactor/blob/main/LICENSE, Apache 2.0
     reactor-netty-http 1.0.33 https://github.com/reactor/reactor-netty/blob/main/LICENSE, Apache 2.0
     javax.inject 1 http://www.apache.org/licenses/LICENSE-2.0, Apache 2.0
+    jackson-dataformat-yaml 2.13.5: https://github.com/FasterXML/jackson-dataformats-text, Apache 2.0
     kotlin-stdlib 1.6.21 https://kotlinlang.org, Apache 2.0
     kotlin-stdlib-common 1.6.21 https://kotlinlang.org, Apache 2.0
     reactor-core 3.4.30 https://github.com/reactor/reactor-core/blob/main/LICENSE, Apache 2.0
@@ -410,6 +405,8 @@ The text of each license is also included at licenses/LICENSE-[project].txt.
     qs 6.5.0: https://github.com/ljharb/qs, BSD 3-Clause
     react-intl-universal 2.4.2: https://github.com/alibaba/react-intl-universal, BSD 3-Clause
     encoder 1.2.2: https://www.owasp.org/index.php/OWASP_Java_Encoder_Project/encoder, BSD 3-Clause
+    jakarta.activation-api 1.2.2: https://github.com/jakartaee/jaf-api, BSD 3-Clause
+    jakarta.xml.bind-api 2.3.3: https://github.com/jakartaee/jaxb-api, BSD 3-Clause
     kryo-shaded 4.0.0: https://github.com/EsotericSoftware/kryo/kryo-shaded, BSD 2-Clause
     minlog 1.3.0: https://github.com/EsotericSoftware/minlog, BSD 2-Clause
     postgresql 42.3.8: https://github.com/pgjdbc/pgjdbc, BSD 2-Clause
diff --git a/shenyu-dist/shenyu-admin-dist/src/main/release-docs/licenses/LICENSE-jakarta.activation-api.txt b/shenyu-dist/shenyu-admin-dist/src/main/release-docs/licenses/LICENSE-jakarta.activation-api.txt
new file mode 100644
index 0000000000..0dea72127c
--- /dev/null
+++ b/shenyu-dist/shenyu-admin-dist/src/main/release-docs/licenses/LICENSE-jakarta.activation-api.txt
@@ -0,0 +1,28 @@
+Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+  - Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+
+  - Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in the
+    documentation and/or other materials provided with the distribution.
+
+  - Neither the name of the Eclipse Foundation, Inc. nor the names of its
+    contributors may be used to endorse or promote products derived
+    from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/shenyu-dist/shenyu-admin-dist/src/main/release-docs/licenses/LICENSE-jakarta.xml.bind-api.txt b/shenyu-dist/shenyu-admin-dist/src/main/release-docs/licenses/LICENSE-jakarta.xml.bind-api.txt
new file mode 100644
index 0000000000..e24371e817
--- /dev/null
+++ b/shenyu-dist/shenyu-admin-dist/src/main/release-docs/licenses/LICENSE-jakarta.xml.bind-api.txt
@@ -0,0 +1,28 @@
+Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+  - Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+
+  - Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in the
+    documentation and/or other materials provided with the distribution.
+
+  - Neither the name of the Eclipse Foundation, Inc. nor the names of its
+    contributors may be used to endorse or promote products derived
+    from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.