Lavender

Dev

maven-release-plugin and git fix

After hours of trying and wondering why my release scripts suddenly stopped working, I found out that maven-release-plugin seems to have an issue with git on recent systems. If you invoke mvn release:prepare and find out that the release process just runs against the current SNAPSHOT instead of the release version, you likely stumbled upon bug MRELEASE-812.

The reason for this issue seems to be that mvn release:prepare parses the output of git status. However the status is localized in recent versions of git, and maven-release-plugin fails to parse the localized output.

The coming fix will probably use git status --porcelain, which returns a machine-readable output. However, for the time being

LANG='en_US.UTF-8'
mvn release:prepare

is a valid workaround.

Cilla source code released

Finally, after almost three years of development, I have published the source code of Cilla. Cilla is the software that runs this blog.

I started working on a new blog software on June 3, 2009. It should replace my old home page made with PHP. I decided to write an own blog software in Java, as there was no open source Java blog software that suited my needs. However I never expected that this project would grow that huge. The core modules alone consist of 27,000 lines of code in 295 classes.

The core modules of Cilla are now available on my development site shredzone.org. The source code is published on GitHub. The documentation, a few plugins, and a simple example web frontend are still missing. I will publish them later.

Cilla is published under a GNU Affero General Public License.

hibernate3-maven-plugin fails with Java 1.7

If you're using Maven's hibernate3-maven-plugin for creating a DDL file from your entities, you might encounter the following error when using Java 1.7:

Execution default of goal org.codehaus.mojo:hibernate3-maven-plugin:2.2:hbm2ddl failed:
An AnnotationConfiguration instance is required

The reason seems to be a broken JRE detection in the Mojo code, which mistakenly assumes that Java 1.7 does not support annotations. However, I haven't checked that in depth.

The fix is pretty easy. In the plugin configuration of the hibernate3-maven-plugin, add an implementation property to the componentProperties like this:

<plugin>
  <groupId>org.codehaus.mojo</groupId>
  <artifactId>hibernate3-maven-plugin</artifactId>
  <version>2.2</version>
  <configuration>
    <componentProperties>
      <implementation>annotationconfiguration</implementation>
    </componentProperties>
  </configuration>
</plugin>

This enforces the use of an AnnotationConfiguration instance.

Arduino auf Fedora 15 einrichten

Die Arduino-Plattform ist eine offene Entwicklungsplattform für kleine Hardwareprojekte, inklusive einer Entwicklungsumgebung und verschiedener günstiger Boards wie dem Arduino Uno. Wegen verschiedener Bugs ist die Installation der Entwicklungsumgebung auf einem System mit Fedora 15 leider nicht ganz trivial.

Die notwendigen Pakete befinden sich im Fedora-Repository. Zuerst installieren wir also die Arduino-IDE und stellen die Gruppenrechte her, die zum Zugriff auf die USB-Schnittstelle benötigt werden:

sudo yum install 'arduino*'
sudo usermod -a -G uucp,dialout,lock $USER

Neben der IDE werden der C-Compiler avr-gcc in Version 4.6.1-2 und die avr-libc in Version 1.7.0 installiert. Diese Version des Compilers wirft allerdings nur Fehlermeldungen. Ein Update steht schon bereit, liegt derzeit aber noch in fedora-testing und muss deshalb explizit installiert werden:

sudo yum --enablerepo=updates-testing update 'avr-*'

Danach ist der avr-gcc in Version 4.6.1-3 und die avr-libc in Version 1.7.1 installiert. Die IDE kann nun gestartet und die Sketches können kompiliert werden.

Allerdings bleibt noch ein Problem: durch eine zu aggressive Compiler-Optimierung funktioniert die delay()-Funktion unter Umständen nicht. So leuchtet bei dem Beispiel Blink die Test-LED dauerhaft, statt zu blinken. Die Ursache dafür lässt sich zum Beispiel durch einen Eingriff in eine Datei beheben. Folgender Patch führt diese Änderung aus:

sudo patch -d /usr/share/arduino/hardware/arduino/cores/arduino wiring.c << __END__
25a26
> #include <avr/delay.h>
106c107
< {
---
> {/*
114a116
> */ _delay_ms(ms);
__END__

Danach steht der Experimentierfreude nichts mehr im Wege!

Treppenlicht 2.0

Es ist schon fantastisch, was man mit modernen LEDs alles anstellen kann.

Diese Wendeltreppe zum Beispiel soll dezent und Strom sparend beleuchtet werden, damit man sie auch im Dunkeln sicher benutzen kann. Eine Weihnachtslichterkette erfüllte den Zweck bisher. Allerdings war sie recht schwach und gab der Treppe außerdem einen hässlichen Partykeller-Look.

Dieser Blogartikel beschreibt, wie man sich mit ein wenig handwerklichem Geschick und geringem Aufwand eine Treppenbeleuchtung selbst bauen kann.

Continue reading...