tags:

views:

38

answers:

1

Correct me if I'm wrong but one normally puts deployment or user-specific properties (e.g. development/testserver settings) inside settings.xml. And by specifying which profiles to use, we can change the behaviour of the maven build.

However there are usually settings in the profiles (settings.xml) which should be shared. Since I don't want to check in settings.xml, I want the maven build to query a database for those profile settings & do the filtering. Is this possible via some plugin ?

+1  A: 

Correct me if I'm wrong but one normally puts deployment or user-specific properties (e.g. development/testserver settings) inside settings.xml. And by specifying which profiles to use, we can change the behaviour of the maven build.

Well, settings.xml is not the best choice for profiles if you don't want to make your build non portable. You should actually put profiles in the pom.xml of your project instead and use settings.xml for "secret" things only. See chapter 11.5. Tips and Tricks of Sonatype's Maven book. Actually, I'd suggest to read the whole chapter 11. Build Profiles.

However there are usually settings in the profiles (settings.xml) which should be shared. Since I don't want to check in settings.xml, I want the maven build to query a database for those profile settings & do the filtering. Is this possible via some plugin ?

Well, as I said, putting the profiles in the pom.xml should solve this (and I don't know if such a plugin exists). An intermediary solution would be to use profiles and filters as described in this blog post but this isn't much different.

Pascal Thivent