Reputation: 506
When maven install goal runs it copies some directories to the src/main/resources. I want to move this functionality at runtime when the application is deployed. The idea is to pass a system variable, which will hold the directory path. When the application is deployed it should look that variable and copy the directory. What I want to achieve is to have a single war file for different environments and properly "inject" the proper configuration for the target environment.
Upvotes: 0
Views: 66
Reputation: 27976
You can't shouldn't change the war artifact once it's built as the groupId/artifactId/version combination is considered immutable once built and can be cached.
Here's a few of common approaches to environment specific config
src/main/resources/dev
, src/main/resources/prod
, src/main/resources/uat
etc) and use a system property to pick which config to use at runtimeUpvotes: 1