Archive

Archive for the ‘Continuous Integration’ Category

How to execute several maven plugins within a single build phase and set the respective execution order

You can use the build lifecycle or phases to control the order of the plugin execution. In some scenario, you have to bound few plugins to same phase, but still want to control the order of the plugin execution.

Plugins bound to the same build phase should be executed in the same order as they are listed in the POM. But under certain circumstances , the order is not executed in the expected order, see this MNG-2258 and MNG-3719. This bug is fixed in Maven 3.0.3. With Maven 3.0.3 and above plugins bound to same phase will be executed in the same order as they are listed in the pom.xml.

 

If you have to use an older Maven version you can spread the tasks to different phases. But I dont think there is much sence for this solution. You can also do one of the following to solve the problem:

  1. try your luck and see if Maven chosses the right order for you (you probably tried that already)
  2. use standalone plugin – run the goal outside the lifecycle. something like: mvn package org.codehaus.mojo:nsis-maven-plugin:1.0:compile.
  3. separate them into module: have a parent pom containing two sub modules, one – your war project and the other for the nsis project.
  4. use a custom lifecycle by changing the type, in your case you can use “exe”. this is done by using a custom plugin extension (guide to using extension)
  5. use the jetspeed-mvn-maven-plugin. I have never used it but it seems relevant to your needs.

 

Advertisements

How to schedule jobs in Jenkins / Triggering a Build Job

October 17, 2013 1 comment

In the job configuration one can define various build triggers. With periodically build enabled in the Build Triggers section it is possible to schedule a job.

jenkins_build_triggers

The cron-syntax for triggering a job in Jenkins looks like this:
minute (0-59), hour (0-23), day (1-31), month (1-12), day of week (0-7)

Examples:

# start build daily at morning
03 09 * * 1-5

# start build daily at lunchtime
00 12 * * 1-5

# start build daily in the afternoon
00 14 * * 1-5

# start build daily in the late afternoon
00 16 * * 1-5

#start build at midnight
#@midnight
59 23 * * 1-5

For more informations about Jenkins have a look at the book Jenkins: The Definitive Guide of John Ferguson Smart
here.
jenkins-continuous-integration-cookbook

or
The Jenkins Continuous Integration Cookbook of Alan Mark Berg here.
jenkins-the-definitive-guide

Jenkins URL Options

http://[jenkins-server]/%5Bcommand%5D

available commands:

  • exit shutdown jenkins
  • restart restart jenkins
  • reload to reload the configuration

Jenkins web pages don’t render correctly in Chrome after a time of inactivity

Happens semi-random, but whenever I leave the Jenkins page for an amount of time and then come back and hit refresh or with autorefresh enabled, the CSS seems to break.

Hitting refresh again does not fix it. However, holding shift while refreshing (forced refresh) fixes the issue and the page goes back to looking normal.

I’ve tried it in different browsers and it is happening there too.

How to integrate soapUI with jenkins / hudson?

With the included testrunner.bat/.sh script one can run soapUI functional tests from the command-line. One can find the available arguments here.

One can create a batch file like this (my_soapUI.bat) to perform a regression test:

@ECHO OFF
SET currentDir=%~dp0
SET soapUIDir=C:\Program Files\eviware\soapUI-4.5.0\bin
SET soapUIProject=C:\soapUI_workspace\my_soapui-project.xml

cd /d "%soapUIDir%"
cmd.exe /C CALL testrunner.bat "%soapUIProject%" -smy_test_suite -cmy_testcase

This command can also be executed via Jenkins.

2013-08-13 15_43_19-test_ip_banking 2013.3.0 Config [Jenkins]

Jenkins Plugins URL

This is the URL of the Jenkins Plugins:
http://updates.jenkins-ci.org/download/plugins/

Save the downloaded *.hpi file into the $JENKINS_HOME/plugins directory. You will then need to restart Jenkins.