Переглянути джерело

使用屏蔽web解决web和gateway的冲突

xiang 2 місяців тому
батько
коміт
736a0cd074
3 змінених файлів з 19 додано та 13 видалено
  1. 7 0
      base/pom.xml
  2. 12 1
      gateway/pom.xml
  3. 0 12
      parent/pom.xml

+ 7 - 0
base/pom.xml

@@ -10,4 +10,11 @@
         <relativePath>../parent</relativePath>
     </parent>
     <artifactId>base</artifactId>
+    <dependencies>    <!-- Web基础依赖 -->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+    </dependencies>
+
 </project>

+ 12 - 1
gateway/pom.xml

@@ -23,9 +23,20 @@
             <groupId>com.alibaba.cloud</groupId>
             <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
         </dependency>
+        <!--网关-->
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-gateway</artifactId>
+        </dependency>
         <dependency>
             <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-web</artifactId>
+            <artifactId>spring-boot-starter</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.springframework.boot</groupId>
+                    <artifactId>spring-boot-starter-web</artifactId>
+                </exclusion>
+            </exclusions>
         </dependency>
     </dependencies>
 </project>

+ 0 - 12
parent/pom.xml

@@ -66,11 +66,6 @@
 
     <!-- 全局依赖定义 -->
     <dependencies>
-        <!-- Web基础依赖 -->
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-web</artifactId>
-        </dependency>
 
         <!-- Lombok简化开发 -->
         <dependency>
@@ -79,13 +74,6 @@
             <version>${org.projectlombok.version}</version>
             <optional>true</optional>
         </dependency>
-
-        <!-- 测试依赖 -->
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-test</artifactId>
-            <scope>test</scope>
-        </dependency>
     </dependencies>
 
     <!-- 依赖管理 -->