On 26 April 2012 09:33, sebastian.st...@softwareag.com < sebastian.st...@softwareag.com> wrote:
> Hi, > > > I wonder how to best use Maven profiles on Jenkins. Our profile is > stored in a settings.xml file, which is contained in our source tree. > Smells like an anti-pattern... how goes the fight with Maven? > We can include this profile in Jenkins using -s path/to/settings.xml > option. > > Usually, a developer would need to alter this file and adapt it to his > working machine like including correct local hostname in some > properties. How do I do that on Jenkins? I know I can ssh to the > machine and make a local change, but that's probably not the best > approach. > There is a plugin that lets you upload things like Maven settings.xml files to be used for specific projects... sounds like your use case. > > Another approach could be to define specific values using the > MAVEN_OPTS edit box on job configuration. Is that the preferred > approach to be taken? > Nope, I'd rather see you define the properties using -Dname=value on either the goals or arguments box... [Trying hard not to have the SC-KK "Jenkins' Maven Project Job type considered harmful vs Jenkins' Freestyle Job type plus Maven Build Step needs more configuration" flame war start up again... though we both take it in good humour ;-) ] > > I would be glad if people could share their experience! > > > Thanks, > > Sebastian >