Archive for March, 2010

Git Internals – a diagram

March 31, 2010 Leave a comment

A beautiful diagram from Git Internals:

Highly recommended! Both PDF and screencast are really good.

Categories: Git Tags:

Hudson: Git and Maven plugins

March 27, 2010 8 comments

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
	at java.util.Hashtable.put(
	at java.util.Hashtable.putAll(
	at hudson.maven.MavenModuleSetBuild$
	at hudson.maven.MavenModuleSetBuild$
	at hudson.remoting.UserRequest.perform(
	at hudson.remoting.UserRequest.perform(
	at hudson.remoting.Request$
	at java.util.concurrent.Executors$
	at java.util.concurrent.FutureTask$Sync.innerRun(
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(
	at java.util.concurrent.ThreadPoolExecutor$

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

Some Hudson links:

Categories: Git, Hudson, Maven Tags: , ,

Multi-level ternary operator

March 24, 2010 Leave a comment

Love one. Can’t be easily debugged, probably .. But reads very nicely:

String getScmClass()
    ( this.@scmClass == 'svn' ) ? 'hudson.scm.SubversionSCM'  :
    ( this.@scmClass == 'git' ) ? 'hudson.plugins.git.GitSCM' :

Still, standard mapping is usually better – it allows to dump all known options:

Map    scmClasses = [ svn : 'hudson.scm.SubversionSCM',
                      git : 'hudson.plugins.git.GitSCM' ]
String getScmClass()
  def    scmClass = scmClasses[ this.@scmClass ]
  assert scmClass, "Unknown [${this.@scmClass}]. Known classes are ${scmClasses.keySet()}"
Categories: Groovy Tags: ,

Moving to a private WordPress hosting

March 22, 2010 Leave a comment

I think I will be moving to a private WordPress hosting within time.
The problem with is that it:

  • .. is annoyingly slow oftentimes.
       There were cases when “Update” operation just stuck for no reason and I had to repost
       the whole article.
  • .. doesn’t allow to install any custom plugin, theme or widget

I mean, it’s good as a free service but from all SaaS-es I’ve met recently – this one definitely needs to go more personal, so I’m giving DreamHost a try now. Any other recommendations may be?

But, of course, I wouldn’t like to lose community and auto-generated links service so I’m planning to repost everything here from my personal WordPress setup.

Categories: Web Tags:

Using Groovy++ with Maven – an update

March 22, 2010 2 comments

In his comment to “Using Groovy++ with Maven” Joern Schimmelpfeng has correctly pointed out about transitive dependencies that may be added to groovypp POM, eliminating the need to specify them explicitly.

He’s right! That’s what we have Maven dependencies mechanism for.

It is now fixed so you can use




Full examples:

Now it looks practically the same – what’s the difference then?

As previously, groovypp-all.jar contains all required libraries, repackaged in one jar:

In addition to groovy ("groovy", "org.codehaus.groovy" packages) and groovypp ("org.mbte.groovypp" package) it also contains antlr, asm, commons-cli and junit libraries, some of which are stored under modified package names to avoid collisions with libraries that may be available already in your project.

groovypp.jar is bound to all above libraries in separate jars, as declared by its <dependencies>.

Which one to choose then?

  • If your application has already declared <dependency> on either antlr or asm and you
       don’t like them packaged twice (note, even in this case – there are no collisions due to
       packages modified), then you can choose the groovypp version.
       It usually works better in IDEA project as it doesn’t recognize "groovypp-all" jar as
       Groovy and tries to search for it elsewhere.
       Note: sometimes you may need to add an explicit junit:4.7 dependency, otherwise
       Maven brings old 3.8.2 JUnit version lacking classes required for Groovy++ compilation.
       It can be seen in groovypp example above, see the diff of switching from "groovypp-all"
       to "groovypp".
  • If you just want to just use Groovy++ without dealing with JUnit versions and you
       experience no Groovy-related IDEA problems – you can use groovypp-all.
Categories: Groovy, Maven Tags: , , ,

Git GUI Here

March 20, 2010 Leave a comment

Rather than right-clicking the folder and choosing “Git GUI Here” ..


@echo off
start d:\winny\Git\bin\wish.exe d:\winny\Git\libexec\git-core\git-gui --working-dir %*

assuming msysgit is installed at "d:\winny\Git"

Now, I only need to type "git-gui ." to launch it:

Much better. Hate it when someone forces me to use a mouse ..

Categories: Git, PC Tags:

Using Groovy++ with Maven

March 18, 2010 11 comments

Note, an update is available.

Groovy++ artifacts are now deployed in Maven repository at:


So you can compile your Groovy++ sources with Maven.
As in Groovy, where you pick up either groovy.jar or groovy-all.jar – you can do the same here:

  • Use groovy + groovypp + asm + antlr + commons-cli:

  • Use groovypp-all:

As you see, the second way is much simpler so I suggest you stick to “groovypp-all”. It’s the same as a longer version but with all required libraries packaged nicely in one bigger jar. 

Of course, you’ll need to instruct Maven about repository:




.. and configure GMaven plugin:


Full examples:

If you didn’t do so yet – you’re welcome to join a community to take part in Groovy++ discussions and be notified about new releases (@groovypp is available as well).

Also, you can follow Alex Tkachman who is Groovy++ inventor at @alextkachman and DZone.