Montag, 2. Januar 2012

Bahncard online kündigen

Unter dem Link https://fahrkarten.bahn.de/privatkunde/kontakt/kontakt_start.post?scope=bc findet man ein Kontaktformular der Deutschen Bahn, mit dem man eine Bahncard auch online kündigen kann. Ich habe das soeben getan, sobald die Bestätigung eintrifft, werde ich das hier melden.

Update: Bereits heute morgen, also am Tag nach der Kündigung, kam die Bestätigung.

Montag, 7. November 2011

Write Groovy scripts for Jenkins with Code completion

In the Jenkins instance of my company we have now over 80 jobs. Sometimes i have to configure the same thing in many jobs, and the easiest thing for that is a Groovy script.
To execute Groovy scripts, you just have to go to "Manage Jenkins" and then "Script console". But there is one problem with the script console: Do you always remember all methods of all classes in Jenkins and its plugins? I do not, and i don't always want to read all Javadocs. So my thought was, how can i use the features like code completion in my favourite IDE, Eclipse, to write the Groovy scripts.
All you need is Eclipse with the m2e and the Groovy plugin. Now create a new Maven project (i called mine "jenkinsgroovy") and add at least jenkins-core and the plugins you need as dependency in the pom.xml. Your pom.xml should look like this to start:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
 <modelVersion>4.0.0</modelVersion>
 <groupId>jenkinsgroovy</groupId>
 <artifactId>jenkinsgroovy</artifactId>
 <version>0.0.1-SNAPSHOT</version>

 <dependencies>
  <dependency>
   <groupId>org.jenkins-ci.main</groupId>
   <artifactId>jenkins-core</artifactId>
   <version>1.437</version>
  </dependency>
  <dependency>
   <groupId>org.jenkins-ci.main</groupId>
   <artifactId>maven-plugin</artifactId>
   <version>1.437</version>
  </dependency>
 </dependencies>
</project>

To add the Groovy compiler and libraries to that project, you have to make a right click on the project, choose "Configure" and then "Convert to Groovy project". Now you can simply create Groovy scripts (i created them in the folder src/main/java), and for example refer to Jenkins.instance with code completion.
Everytime you need classes of new plugins, just add the plugins in your pom.xml and all dependencies are automatically downloaded.

Samstag, 5. November 2011

XULRunner errors with Eclipse and Linux

In newer versions of Debian or Ubuntu you may face the error message “Could not detect registered XULRunner to use” in your logfiles, if you want to start Eclipse or an Eclipse based application, which uses the SWT browser widgets. Current Debian Testing (Wheezy) comes with XULRunner 7.0, but you need a XULRunner < 2.0. You can download XULRunner 1.9.1 from the Debian packages site.

Network Shares With GVFS and FUSE on Debian

If you use Debian and want to mount Windows network shares in the path ~/.gvfs/pathtoshare, you have to install the packages gvfs-mount, fusesmb and fuse (should already be installed). Then add your user to the group ‘fuse’. After a reboot, the shares should be mounted in your home folder, if you browse them with Nautilus.

Donnerstag, 17. Februar 2011

Remote Debugging mit Eclipse und Tomcat

Tomcat wird mit der Datei "catalina.bat" bzw. "catalina.sh" und den Argumenten "jdpa start" gestartet. Damit wird auf Port 8000 ein Socket bereitgestellt. In Eclipse muss nun eine Debug Configuration vom Typ "Remote Java Application" angelegt werden. Die Standardeinstellungen können dabei so belassen werden.
Zum Debuggen muss vorher das Projekt wie gewohnt deployed werden, danach kann in Eclipse der Debug-Modus mit der entsprechenden Konfiguration aufgerufen werden. Das weitere Vorgehen entspricht dem lokalen Debuggen (Breakpoints, Variablen etc.)

Dienstag, 11. Januar 2011

Gerrit with Apache as Reverse Proxy

This is an example how to configure Apache as a Reverse Proxy with SSL and Gerrit:

Apache VHost configuration:

NameVirtualHost *:443
<VirtualHost *:443>
      ServerName hostname:443


      SSLEngine on
      SSLCertificateFile /etc/pki/tls/certs/localhost.crt
      SSLCertificateKeyFile /etc/pki/tls/private/localhost.key


      ProxyRequests Off
      ProxyVia Off
      ProxyPreserveHost On
      SSLProxyEngine On


      <Proxy *>
            Order deny,allow
            Allow from all
      </Proxy>


      ProxyPass / http://127.0.0.1:8080/


</VirtualHost>

Gerrit configuration (only the relevant parts):

[gerrit]
        canonicalWebUrl = https://hostname/
[httpd]
        listenUrl = proxy-https://127.0.0.1:8080/

The canonicalWebUrl stands for the URL under which you want to reach the Gerrit interface. The listenUrl have to be exactly the same as the URL in the ProxyPass directive of the Apache configuration. The prefix proxy-https means, that the SSL handling is done by the Apache and not by Gerrit.

Samstag, 1. Januar 2011

Eclipse Summit Europe 2010 - Nachlese

Vom 2. - 4. November fand in Ludwigsburg der Eclipse Summit Europe 2010 statt, welchen ich ebenfalls besuchte. Auch wenn ich erst am Anfang der Softwareentwicklung mit Eclipse RCP stehe, gab es doch einige sehr interessante Talks.
So zum Beispiel am Dienstag nachmittag ein Symposium mit dem Namen "What's in a build?". Der Name war Programm, denn Thema war die Strukturierung von Buildprozessen, was mich derzeit natürlich erheblich betrifft, da ich die Aufgabe habe, einen Ant-basierten Buildprozess umzustrukturieren für die Verwendung von Maven und Hudson.

Für die weiteren Vorträge liste ich einfach die wesentlichen interessanten Punkte auf:

Using Git in Eclipse: Es gibt in EGit nun die Integration des Compare-Editors von Eclipse als Mergetool. Nach einem Merge mit Konflikten gibt es dazu im Kontextmenü den Eintrag "Mergetool", mit dem eine entsprechende Datei bearbeitet werden kann. Weiter offen ist die Integration des rebase-Befehles, an der wird aber gearbeitet, geplant ist die Integration für das Dezember-Release.

Control your home with OSGI: Interessanter Vortrag über das openHAB-Projekt, ein Open-Source-Projekt zur Heimautomatisierung, unabhängig von den Hardwareherstellern.

Eclipse Scout querbeet: Eclipse Scout ist ein sehr vielversprechendes Framework zur einfachen und schnellen Entwicklung von Client-Server-Applikationen. Derzeit wird auf dem Client Swing und SWT unterstützt, geplant ist die Unterstützung von Apache Wicket für Webapplikationen. Thema in diesem Vortrag war jedoch die Integration von JasperReports zur Generierung aller Art von Berichten.

Functional and UI Testing for Eclipse UI: Ebenfalls ein recht interessanter Vortrag über das Testframework Q7 von Xored. Es ermöglicht UI-Tests auch für EMF- und GMF-basierte Anwendungen. Ob das Framework auch in meinem geschäftlichen Umfeld brauchbar ist, muss sicherlich durch einige Tests mal evaluiert werden.

Click out your JPA model: Präsentation des neuen JPA-Diagram-Editors. Er befindet sich derzeit noch in starker Entwicklung, daher fehlen noch einige wichtige Features, beispielsweise die Unterstützung von JPA 2.0 (derzeit werden nur JPA 1.0 Projekte unterstützt).