Skip to content

aniaan/gradle-spring-profile

Repository files navigation

gradle-spring-profile

Like maven's profile replacement plugin

Quick Start

1.You have files such as application.yml or application.yaml, application.properties, etc. in your project, where it says ${spring.active}

spring.profiles.active=${spring.active}
spring:
  profiles:
    active: ${spring.active}
  1. Introduce the plugin in the build.gradle.kts file
plugins {
    id("com.github.aniaan.gradle-spring-profile") version "1.0.1-RELEASE"
}
  1. start build
./gradlew clean bootJar -Pprofile=dev
  1. In your jar, you can see that ${spring.active} has been replaced