Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

maven profiles

 
Eun Mi
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I'm not actually sure if this question belongs in here, but I will try. I have a job on Jenkins/Hudson and is it possible to call this job when the project performs a maven release?

Thanks in advance
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You lost me when you said "the project". What project do you mean?

And you lost me again when you said "maven release". Did you mean "mvn deploy"?

I assume you do not mean that you want the completion of one build job in Hudson to trigger another job to start. Or perhaps you mean you have two jobs and you want the second one to be triggered only if a "mvn deploy" is used on the first one.
 
Eun Mi
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I use Jenkins, and there is a job on Jenkins which perform deploy and release. When I run this 'release job' it changes the versions from snapshot to stable version and then prepare snapshot again (which is right), but I need to generate and deploy site (but only for release), so i thought, if profiles can solve this problem. Also I would like the site generation to be a separate job... But I have no idea, how could I do this.
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are probably numerous ways you can do what you want. Some involve Hudson job changes, others involve pom.xml changes. Here is one possibility:

In the pom.xml define a profile that includes the site generation (that is, within the profile have a <build> section including the site generation plugin). Have the profile be active when a 'release' build is done. (I'd have to see the full details of both you Hudson job and your pom.xml to give an exact mechanism for making the profile active. Depending on how things are set up, activating the profile could be done based on environment variables that Hudson sets, or you might already have properties in your pom.xml that could be used. Looking at how profiles are activated might give you some ideas.)

And you don't need a separate job to generate a site. In most of our Hudson jobs, we have a "Maven target" parameter that can be set. One of the options I provide is "site" which causes the web site to be generated. I don't know exactly how your job differentiates between 'deploy' and 'release', but a third 'site' option might be possible.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic