I have a Maven2 project, with a pom.xml and a profiles.xml files at the same level.
The project configuration is provided by Maven profile properties:
dbhost=${dbhost}
dbport=${dbport}
// etc.
Locally, each developper customize his build in the “profiles.xml”. It works well.
For continuous integration, a ci “profiles.xml” has been put on our SCM server (at the same level as the pom.xml).
The problem is that Hudson simply ignores this file during the Maven build, whereas the “-P hudsonprofile” is correctly set.
If the same profile is moved directly in the “pom.xml”, or in the global “settings.xml” the build works. So we already have a solution.
I also know that the “profiles.xml” file is deprecated, but I would like to understand why the comportement is different between Hudson build and my local build…
Note: Hudson and my local build use the same version of Maven (2.2.1).
Sounds like a classpath problem to me. Why would Hudson not notice the profiles.xml? The only reason I can think of is that Hudson uses a different classpath than you would expect.
A best practice (atleast in my experience), is to try to build the project from the command line on your CI server (where Hudson runs). If that works, then Hudson should work too. Unless you have configured Maven in Hudson weirdly.
Also, adjusting the settings.xml of Maven is not that bad. At least, if you dont expect it to change too much. Even so, it is fixed quickly.