提交 67343d6b 编写于 作者: ibiz4j's avatar ibiz4j

pom

上级 0c59b969
<?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">
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.4.0</version>
<relativePath/>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>ibizlab-boot-starter-gateway</artifactId>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<spring-boot.version>2.4.0</spring-boot.version>
<spring-cloud.version>2020.0.1</spring-cloud.version>
<spring-cloud-alibaba.version>2021.1</spring-cloud-alibaba.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<!-- Import dependency management from Spring Boot,not include plugin
management as the parent import style -->
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring-boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-alibaba-dependencies</artifactId>
<version>${spring-cloud-alibaba.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-ribbon</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-ribbon</artifactId>
</exclusion>
<exclusion>
<artifactId>spring-cloud-netflix-ribbon</artifactId>
<groupId>org.springframework.cloud</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-gateway</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-loadbalancer</artifactId>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>${basedir}/src/main/resources</directory>
<includes>
<include>**/**</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<finalName>ibizlab-gateway</finalName>
<jvmArguments>-Dfile.encoding=UTF-8</jvmArguments>
<mainClass>cn.ibizlab.boot.GatewayApplication</mainClass>
<outputDirectory>../</outputDirectory>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
package cn.ibizlab.boot;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
@EnableDiscoveryClient
@SpringBootApplication
public class GatewayApplication {
public static void main(String[] args) {
SpringApplication.run(GatewayApplication.class, args);
}
}
#eureka配置中心
spring:
cloud:
nacos:
discovery:
enabled: false
eureka:
client:
enabled: true
serviceUrl:
defaultZone: http://127.0.0.1:8762/eureka/
#nacos配置中心
spring:
cloud:
nacos:
discovery:
server-addr: 172.16.100.77:8848
enabled: true
eureka:
client:
enabled: false
server:
port: 8080
compression:
enabled: true
mime-types: application/javascript,text/css,application/json,application/xml,text/html,text/xml,text/plain
min-response-size: 10240
spring:
application:
name: gateway
profiles:
include: nacos, gateway
main:
allow-bean-definition-overriding: true
resources:
static-locations: classpath:/static/,file:/dist/
cloud:
gateway:
discovery:
locator:
enabled: true
lowerCaseServiceId: true
routes: #配置网关路由规则
- id: cloud_uaa
uri: lb://${ibiz.ref.service.uaa:ibzuaa-api}
order: 10
predicates:
- Path=/${ibiz.gateway}/v7/**,/${ibiz.gateway}/uaa/**,/${ibiz.gateway}/sysauthlogs
filters:
- StripPrefix=1
- id: ibizcloud_ou
uri: lb://${ibiz.ref.service.ou:ibzou-api}
order: 20
predicates:
- Path=/${ibiz.gateway}/ibzemployees**,/${ibiz.gateway}/sysemployees**,/${ibiz.gateway}/ibzdepartments**,/${ibiz.gateway}/sysdepartments**,/${ibiz.gateway}/ibzorganizations**,/${ibiz.gateway}/sysorganizations**
filters:
- StripPrefix=1
- id: cloud_workflow
uri: lb://${ibiz.ref.service.wf:ibzwf-api}
order: 30
predicates:
- Path=/${ibiz.gateway}/wfcore/**
filters:
- StripPrefix=1
- id: cloud_oss
uri: lb://${ibiz.ref.service.disk:ibzdisk-api}
order: 40
predicates:
- Path=/${ibiz.gateway}/ibizutil/**,/${ibiz.gateway}/net-disk/**
filters:
- StripPrefix=1
- id: cloud_conf
uri: lb://${ibiz.ref.service.conf:ibzuaa-api}
order: 50
predicates:
- Path=/${ibiz.gateway}/configs/**
filters:
- StripPrefix=1
- id: cloud_dict
uri: lb://${ibiz.ref.service.dict:ibzdict-api}
order: 60
predicates:
- Path=/${ibiz.gateway}/dictionar**/**
filters:
- StripPrefix=1
#跨域设置
globalcors:
corsConfigurations:
'[/**]':
allowedOriginPatterns: "*"
allowed-methods: "*"
allowed-headers: "*"
allow-credentials: true
exposedHeaders: "Content-Disposition,Content-Type,Cache-Control"
# 暴露监控端点
management:
endpoints:
web:
exposure:
include: '*'
logging:
level:
root: error
ibiz:
gateway: ${spring.application.name}
\ No newline at end of file
.__ ___. .__ .____ ___.
|__|\_ |__ |__|________| | _____ \_ |__
| | | __ \ | |\___ /| | \__ \ | __ \
| | | \_\ \| | / / | |___ / __ \_| \_\ \
|__| |___ /|__|/_____ \|_______ \(____ /|___ /
\/ \/ \/ \/ \/
......@@ -27,6 +27,7 @@
<module>ibizlab-boot-starter-parent</module>
<module>ibizlab-boot-starter</module>
<module>ibizlab-boot-starter-data</module>
<module>ibizlab-boot-starter-gateway</module>
</modules>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册