Browse Source

Derive kotlin version from parent (#212)

pull/214/head
Biju Kunjummen 7 years ago committed by Spencer Gibb
parent
commit
16c8a07d7c
  1. 23
      spring-cloud-gateway-sample/pom.xml
  2. 5
      spring-cloud-gateway-sample/src/main/kotlin/org/springframework/cloud/gateway/sample/AdditionalRoutes.kt

23
spring-cloud-gateway-sample/pom.xml

@ -11,7 +11,6 @@
<description>Spring Cloud Gateway Sample</description> <description>Spring Cloud Gateway Sample</description>
<properties> <properties>
<kotlin.version>1.1.51</kotlin.version>
</properties> </properties>
<parent> <parent>
@ -57,26 +56,27 @@
<dependency> <dependency>
<groupId>org.jetbrains.kotlin</groupId> <groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib</artifactId> <artifactId>kotlin-stdlib</artifactId>
<version>${kotlin.version}</version>
<optional>true</optional> <optional>true</optional>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.jetbrains.kotlin</groupId> <groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-reflect</artifactId> <artifactId>kotlin-reflect</artifactId>
<version>${kotlin.version}</version>
<optional>true</optional> <optional>true</optional>
</dependency> </dependency>
</dependencies> </dependencies>
<build> <build>
<plugins> <plugins>
<plugin> <plugin>
<artifactId>kotlin-maven-plugin</artifactId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.jetbrains.kotlin</groupId> <groupId>org.jetbrains.kotlin</groupId>
<version>${kotlin.version}</version> <artifactId>kotlin-maven-plugin</artifactId>
<configuration> <configuration>
<compilerPlugins> <args>
<plugin>spring</plugin> <arg>-Xjsr305=strict</arg>
</compilerPlugins> </args>
<jvmTarget>1.8</jvmTarget> <jvmTarget>1.8</jvmTarget>
</configuration> </configuration>
<executions> <executions>
@ -107,13 +107,6 @@
</configuration> </configuration>
</execution> </execution>
</executions> </executions>
<dependencies>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-allopen</artifactId>
<version>${kotlin.version}</version>
</dependency>
</dependencies>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>

5
spring-cloud-gateway-sample/src/main/kotlin/org/springframework/cloud/gateway/sample/AdditionalRoutes.kt

@ -1,6 +1,5 @@
package org.springframework.cloud.gateway.sample package org.springframework.cloud.gateway.sample
import org.springframework.cloud.gateway.route.RouteLocator
import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder
import org.springframework.cloud.gateway.route.builder.filters import org.springframework.cloud.gateway.route.builder.filters
import org.springframework.cloud.gateway.route.builder.routes import org.springframework.cloud.gateway.route.builder.routes
@ -8,10 +7,10 @@ import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration import org.springframework.context.annotation.Configuration
@Configuration @Configuration
class AdditionalRoutes { open class AdditionalRoutes {
@Bean @Bean
fun additionalRouteLocator(builder: RouteLocatorBuilder): RouteLocator = builder.routes { open fun additionalRouteLocator(builder: RouteLocatorBuilder) = builder.routes {
route(id = "test-kotlin") { route(id = "test-kotlin") {
host("kotlin.abc.org") and path("/image/png") host("kotlin.abc.org") and path("/image/png")
filters { filters {

Loading…
Cancel
Save