Home > Git, Hudson, Maven > Hudson: Git and Maven plugins

Hudson: Git and Maven plugins

Suddenly, something went wrong .. :(
A usual Hudson job pulling sources from Git repository started to fail with NPE:

Parsing POMs
[nexttags-CI] $ c:\Winny\java\jdk1.6.0_18\/bin/java -Xmx1024m -XX:MaxPermSize=512m -cp c:\dev\hudson-slave\maven-agent.jar;C:\Winny\java\apache-maven-2.2.1\boot\classworlds-1.1.jar hudson.maven.agent.Main C:\Winny\java\apache-maven-2.2.1 C:\dev\hudson-slave\slave.jar c:\dev\hudson-slave\maven-interceptor.jar 3841 c:\dev\hudson-slave\maven2.1-interceptor.jar
<===[HUDSON REMOTING CAPACITY]===>channel started
channel stopped
ERROR: Processing failed due to a bug in the code. Please report this to users@hudson.dev.java.net
java.lang.NullPointerException
	at java.util.Hashtable.put(Hashtable.java:394)
	at java.util.Hashtable.putAll(Hashtable.java:466)
	at hudson.maven.MavenBuilder.call(MavenBuilder.java:156)
	at hudson.maven.MavenModuleSetBuild$Builder.call(MavenModuleSetBuild.java:688)
	at hudson.maven.MavenModuleSetBuild$Builder.call(MavenModuleSetBuild.java:632)
	at hudson.remoting.UserRequest.perform(UserRequest.java:114)
	at hudson.remoting.UserRequest.perform(UserRequest.java:48)
	at hudson.remoting.Request$2.run(Request.java:270)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:619)

What ?! But it worked half an hour ago. Hmm, that’s interesting …

After re-installing Hudson from scratch, installing it locally on my machine, going back and forward with versions, creating simple jobs doing absolutely nothing except pulling sources from various Git projects and running "mvn clean" .. I still couldn’t git rid of this error.

Well, it was clearly time for some debugging and .. here we go!

For some reason Git plugin started to pass null value for GIT_BRANCH environment variable.
This caused Maven plugin to fail in System.getProperties().putAll(systemProps) call.

The solution was to use "master" as default Git branch instead of "**" or empty String:

My versions were: Hudson v1.352, Git plugin v0.8.1

P.S
Some Hudson links:

About these ads
Categories: Git, Hudson, Maven Tags: , ,
  1. Jan
    April 27, 2010 at 09:23

    Thank you so much … this error kept me searching quite a while !!

    Good Job!

  2. July 25, 2010 at 15:39

    Ah, finally my github builds works with hudson.

  3. July 25, 2010 at 20:45

    Great :)

  4. Henrique M. Gontijo
    March 21, 2012 at 15:38

    Great, now Jenkins + Github worked for me! I just specified “master” as branch.

  1. April 8, 2010 at 16:28

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: