Top Topic ?

Hudson upgrade 1.339 to 1.348

Posted in cie by Ladislav Prskavec on March 3, 2010

We try upgrade Hudson 1.339 to 1.342 and more and we have problems with Section View plugin.

[!] Error
org.jvnet.hudson.reactor.ReactorException: hudson.util.IOException2:
Unable to read /srv/tomcat/.hudson/config.xml
at org.jvnet.hudson.reactor.Reactor.execute(
at hudson.model.Hudson.executeReactor(
at hudson.model.Hudson.(
at hudson.WebAppMain$
Caused by: hudson.util.IOException2: Unable to read
at hudson.XmlFile.unmarshal(
at hudson.model.Hudson$
at org.jvnet.hudson.reactor.Reactor.runTask(
at hudson.model.Hudson$3.runTask(
at org.jvnet.hudson.reactor.Reactor$
at org.jvnet.hudson.reactor.Reactor$
Caused by: java.lang.NoSuchFieldError: DESCRIPTOR
at hudson.plugins.sectioned_view.ListViewSection.(

Solution is so complicated.

  1. Stop using Section View plugin
  2. Stop Hudson
  3. Backup /user/.hudson/config.xml file
  4. Delete config.xml
  5. Make upgrade to last Hudson war
  6. Start Hudson
  7. Upgrade Section view plugin
  8. Start using Section View Plugin
  9. Stop hudson
  10. Restore config.xml from backup
  11. Start Hudson

All working! Good luck!


PHP CodeBrowser and Hudson integration

Posted in qa by Ladislav Prskavec on December 10, 2009

I read about PHP_CodeBrowser and their html reports are nice.

How can add this reports to Hudson ?

Use HTML Publisher Plugin!

It’s easy, add to your build script new target phpcb in this style:

<target name="phpcb">
<exec executable="phpcb" dir="${basedir}/source">
<arg line="--log reports/logs/
--source source/
--output reports/phpcb/" />

Don’t forget install HTML Publisher Plugin and make in job settings to directory with reports:

Reports are done:

Tagged with: , , ,

Backup jobs for Hudson

Posted in php by Ladislav Prskavec on November 11, 2009

Hudson has new version every week. Before migration I recommend backup jobs and plugins. For backup you can used my hudson-manager. It’s Ant script with some targets. Source you can see at

In you set directories and days after delete old backups.

To run backup use cron with this parameters:

05 10,15 * * 1-5 /usr/bin/ant -f /srv/hudson/hudson-manager/manager.xml backupOnlyJobs
05 19 * * 1-5 /usr/bin/ant -f /srv/hudson/hudson-manager/manager.xml backup

Bigger backup i make one per day and minor backup (jobs only) twice per day. In full backup are stored plugins and jobs. Sometimes you can after upgrade plugins and backup is useful.

Tagged with: ,

PHP Class for Hudson

Posted in php by Ladislav Prskavec on April 29, 2009

I make php class for work with Hudson ( Is useful for save all jobs configs and deploy jobs on another server or some multichanges in jobs. Useful is easy and some example is in wiki.

Save all config.xml

* Retrive all config.xml and save into directory
require_once ("src/phphudson.php");
$hudson = new PhpHudson('http://localhost:8080/');
// save all jobs config into temp

Recreate all jobs

* Read all config.xml from directory and create jobs in Hudson
require_once ("src/phphudson.php");
$hudson = new PhpHudson('http://localhost:8080/');
$dir = '/tmp/hudson/';
if ($handle = opendir($dir)) {
echo "Directory handle: $handle\n";
echo "Files:\n";
while (false !== ($file = readdir($handle))) {
echo "$file\n";
$hudson->createJob(basename(str_replace("-config.xml", "", $file)), file_get_contents($dir . $file));

Tagged with:

PHP and Hudson

Posted in php by Ladislav Prskavec on February 26, 2009

Hudson is extensible continuous integration engine used for Java projects. It’s architecture can be used for others languages as PHP too.


  1. download war file
  2. run direct in console java -jar hudson.war (free port 8080 andJDK 1.5+)
  3. or make install to servlet server (Tomcat, Jetty, JBoss, …)
  4. after that go http://localhost:8080
  5. plugins recommended for php


For build can use phing (example) or ant.

<?xml version="1.0" encoding="UTF-8"?>
<project name="start_page" basedir="." default="main">
<!-- $Id: build.xml 102 2009-02-26 14:39:10Z abtris $ -->
<property name="tmp" value="/tmp" />
<property name="wsname" value="source" />
<property name="package"  value="${}" override="true" />
<property name="builddir" value="${tmp}/build/${}" override="true" />
<property name="srcdir"   value="./src/" override="true" />

<!-- Main Target -->
<target name="main" description="main target">

<!-- Create dirs -->
<mkdir dir="${builddir}/reports"/>
<mkdir dir="${builddir}/reports/coverage"/>

<!-- PHP API Documentation -->
<phpdoc title="API Documentation"
<fileset dir=".">
<include name="*/*.php" />

<!-- PHP CodeSniffer -->
<exec command="phpcs --standard=ZEND --report=checkstyle ${ws}/${wsname}/src/ > ${builddir}/reports/checkstyle.xml" escape="false" />

<!-- PHPUnit -->
<exec command="phpunit --log-xml ${builddir}/reports/phpunit.xml --log-pmd ${builddir}/reports/phpunit.pmd.xml --coverage-clover ${builddir}/reports/coverage/clover.xml --coverage-html ${builddir}/reports/coverage/ tests/AllTests.php"/>


Example configuration

Project name: StartPage
Source Code Management: Subversion
Repository URL: https://localhost/svn/start_page/trunk
Local module directory (optional): source
Use update: true


Execute shell: phing -f $WORKSPACE/source/build.xml -Dws=$WORKSPACE -Dtmp=$WORKSPACE

Post-build action

Publish Javadoc
Javadoc directory = build/start_page/apidocs/
Retain javadoc for each successful build = false
Publish JUnit test result report
Test report XMLs = build/start_page/reports/phpunit.xml
Publish Checkstyle analysis results
Checkstyle results = build/start_page/reports/checkstyle.xml
Publish PMD analysis results
PMD results = build/start_page/reports/phpunit.pmd.xml
Publish Clover Coverage Report
Clover report directory = build/start_page/reports/coverage/