wood burning stoves 2.0*
The moose likes Ant, Maven and Other Build Tools and the fly likes maven profiles Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "maven profiles" Watch "maven profiles" New topic
Author

maven profiles

Eun Mi
Greenhorn

Joined: Oct 10, 2011
Posts: 7
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

Joined: May 14, 2008
Posts: 5779
    
    7

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.


JBoss In Action
Eun Mi
Greenhorn

Joined: Oct 10, 2011
Posts: 7
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

Joined: May 14, 2008
Posts: 5779
    
    7

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: maven profiles
 
Similar Threads
Hudson for CI - Maven Project Build
Eclipse: project builder out of template
Is there a way to publish maven artifacts to nexus repository using a Fusion Job?
Maven or Ant?
Starting and stopping tomcat6 with maven before/after deploy