How can i change resource folder .yml

Answered

i want to change resource folder .yml by doing add option '-Pprofile=' at build

so 

i know that in CLI

1. gradle clean -Pprofile=env1 bootJar

2. java -jar build/libs/myProject.jar

 

- build.gradle

sourceSets {
  ext.profile = (!project.hasProperty('profile') || !profile ) ? 'env1' : profile

  main {
    resources {
      srcDirs "src/main/resources-env/${profile}"
    }
  }
}
 

but how can i add build option '-Pprofile=' in Run/debug configurations Application(in intellij build not gradle)

in Program arguments add -Pprofile= 

i think it doesn't rebuild and just run

0
1 comment
Is it a Spring boot appliation? Does it help if you override the configuration properites in the Spring Boot run configuration -> click the Modify options -> select the "Override configuration properties" -> specify the yml file in the table?
0

Please sign in to leave a comment.