Enable Maven profile?

2,315 views
Skip to first unread message

David J. Biesack

unread,
Apr 13, 2011, 12:22:10 PM4/13/11
to jenkins...@googlegroups.com

How does one enable a specific Maven2 profile from Jenkins (1.405)?
The main Jenkins config for Maven projects lets me set MAVEN_OPTS
but those are JVM options, not mvn command line arguments.
https://wiki.jenkins-ci.org/display/JENKINS/Building+a+maven2+project
does not mention it

I want the equivalent of

-Pcontinuous-integration-build

to enable the Maven profile continuous-integration-build

https://wiki.jenkins-ci.org/display/JENKINS/Cobertura+Plugin uses
the following, stating that Jenkins sets BUILD_NUMBER, but
I don't know if I can/should rely on that.
<profiles>
<profile>
<id>continuous-integration-build</id>
<activation>
<property>
<name>BUILD_NUMBER</name>
</property>
</activation>

I suppose I could set the profile in the settings.xml
associated with the MAVEN_HOME ... is that the best way?

thanks

--
David J. Biesack, SAS
SAS Campus Dr. Cary, NC 27513
www.sas.com (919) 531-7771

Cimballi

unread,
Apr 13, 2011, 12:38:14 PM4/13/11
to jenkins...@googlegroups.com, David J. Biesack
You can do that in your project configuration Build / Root POM / Goals
and options : package xxxxx -Pcontinuous-integration-build

Cimballi

Hilco Wijbenga

unread,
Apr 13, 2011, 12:39:20 PM4/13/11
to jenkins...@googlegroups.com, David J. Biesack

Can't you simply add it to the Maven goals in the Jenkins job configuration?

e.g. clean verify -Pcontinuous-integration-build

That's what I do. Or do you mean something else?

David Biesack

unread,
Apr 14, 2011, 9:36:13 AM4/14/11
to Jenkins Users
Thanks, I'll use that.

Luckily, I generate each job's config.xml from a script/template
(otherwise I'd have to edit a lot of configs manually...)
Reply all
Reply to author
Forward
0 new messages