开发者

Maven build for different profiles

开发者 https://www.devze.com 2023-01-19 23:38 出处:网络
We\'re trying to migrate from current Ant build to开发者_如何转开发 Maven. In the current project, we\'ve different properites files for each of the env say

We're trying to migrate from current Ant build to开发者_如何转开发 Maven. In the current project, we've different properites files for each of the env say

qa.properties, prod.properties & dev.properties.

The property values present in these files, are used to replace wherever these properties are being referred through config files (present in src\main\resources\config ). The current Ant build process replaces all these properties which are being referred in config files with their corresponding value for the current build env.

I'm somewhat aware of the Profiles concept in maven. However, I'm not able to figure how to achieve this using maven.

Any help would be appreicated.

Thanks, Prabhjot


There are several ways to implement this but they are all variations around the same features: combine profiles with filtering. A Maven2 multi-environment filter setup shows one way to implement such a setup (a little variation would be to move the filter declaration inside each profile).

See also

  • 9.3. Resource Filtering
0

精彩评论

暂无评论...
验证码 换一张
取 消