Samstag, 6. November 2010

Slides Agiles Lernen und Software Entwicklung das OSGi Code Camp

Here the slides from the talk "Agiles Lernen und Software Entwicklung das OSGi Code Camp" which we have at OSGi Users Forum Meeting 2010.


Links

Samstag, 16. Oktober 2010

Sonatype Maven Shell and Parallel builds in Maven 3


Today I played around with the parallel build feature from Maven 3 and with the sonatype maven shell. The sonatype maven shell is based (required) on Maven 3. Here my first build performance results.

Maven 3 Maven 3 (mvn -T 10) Maven 3 (mvn -T 1.5C) Maven Shell
mvn clean compile ca. 5 sec ca. 3 sec ca. 4 sec ca. 2 sec
mvn clean package ca. 12 sec ca. 10 sec ca. 10 sec ca. 7 sec
mvn package ca. 7 sec ca. 6 sec ca. 6 sec ca. 3 sec
mvn clean site ca. 4 min ca. 4 min ca. 4 min crashed
mvn javadoc:javadoc ca. 56 sec ca. 29 sec ca. 29 sec ca. 27 sec

More about parallel builds in Maven 3 here:
https://cwiki.apache.org/confluence/display/MAVEN/Parallel+builds+in+Maven+3

More about the maven shell from sonatype here:
http://shell.sonatype.org/index.html

Apache Maven 3 and the Maven Site Plugin

Today I have a look on maven 3 features, when I start to build the maven site of my project it always failed. Because the configuration for the maven site was changed in the maven version 3.X. Here my first maven site configuration that worked for my project:



More about the maven site plugin configuration version for maven version 3.X here:
https://cwiki.apache.org/MAVEN/maven-3x-and-site-plugin.html

Dienstag, 24. August 2010

OSGi Bundle Quality or Bundle Information Repository

A lot of projects build their JARs as OSGi bundles e.g. Jersey. The quality varies from very good bundles up to the bundles they do not work they only generate a MANIFEST file. Often you spend a lot of time until you have your frameworks running in an OSGi environment. Even if these frameworks JARs are offered as OSGi bundles already. So Neil Bartlett came up at Twitter with the idea to build a portal where you can find information about the quality of OSGi bundles.

After the twitter post from Neil, I think about such a portal and here are my first ideas about such a information portal. I think first we need a small command line tool which implements a set of static and dynamic tests for OSGi bundles. Nice would be a set of plugins which integrate the tool into your build tool (e.g. maven, ant) or favorite IDE.

What kind of static tests should this bundle test tool support?
  • Check if the to test JAR (bundle) have a valid MANIFEST e.g. to check via Peter Kriens BND lib.
  • Check some MANIFEST pattern e.g. do the bundle import the exported packages, which is a OSGi best practice.
  • Do the bundle describe e.g. via extra configuration where to get the runtime dependencies e.g. via maven pom.xml? Provide this dependencies (JARs) all of the imported packages.
  • Use the bundle a framework for declarative services? E.g. do the bundle use DS, Blue Print, iPOJO, Pearbeary...
  • Which OSGi services does the bundle use e.g. configuration service, logging service etc.

What kind of dynamic test should the test tool provided?
  • Check if the bundle can be deployed in an OSGi container (equinox, felix,… therefore the pax runner can be used for implementation). The bundle should ship a reference set of runtime dependencies or provided a configuration file which describes where to get these dependencies e.g. via maven or ivy. The order in which the runtime dependencies will be started can be determined via a static test on each bundle (for implementation the BND lib can be used, or pax runner do this already?). In addition to the runtime dependencies it should be a possibility that a bundle can describe a set of system properties.
  • Test that the exported packages can be used from a bundle. There for a test bundle can be generated which use the exported package resources of the bundle under test.
  • Check that if a started OSGi bundle provides OSGi services.
  • When a bundle use a framework for declarative services e.g. DS, verify that the decelerated services are up and running in the service registry.
  • Check that a bundle restart works. Service is down and will be started again etc.

When we have such a tool to automatically verify the quality of an OSGi bundle and get a set of information about the bundle. A central information portal/repository would be very nice where you can submit your bundles and the checks will be run on your bundle and published. Where you can search for bundles and you get information where to download the bundle and a set of information of the quality of the bundle. I think such an information repository about OSGi bundles and there quality should be hosted under www.osgi.org.

Here some ideas how to submit a bundle into such an information repository/portal? I think the portal should provide a REST service and web form to submit bundles to check and to add to the repository. The runtime dependencies can submit as ZIP or as maven pom.xml or ivy configuration. For the REST service plugins for build tools and IDEs would be nice. E.g. a plugin for maven which will be bind to the deploy phase of maven, could automatically deploy the bundle to check also to the bundle information repository.

Is anyone interested to build the testing tool with me as an open source project? Or is there a cool tool out there which can do such tests? Please contact me or write a comment to the post?


Links:

Sonntag, 15. August 2010

Eclipse Tipp Reloaded - Disable STS Dashboard On Startup

Last year I wrote a blog entry how to disable the STS (Spring Tool Suite) dashboard on eclipse startup see here. In newer version of STS the option is now in the preference dialog of STS see the screenshot bellow.


Links
  • http://tux2323.blogspot.com/2009/11/eclipse-tipp-disable-sts-dashboard-on.html
  • http://www.springsource.com/developer/sts

Import a Clojure Leiningen Project into Eclipse

To import a leiningen project in the Eclipse IDE add the eclipse leiningen plugin in the project.clj as dev-dependency.


When you now invoke the command "lein help" there is a new task called eclipse. Invoke the leiningen task eclipse via "lein eclipse". The eclipse leiningen tasks creates the eclipse projects files ".project" and ".classpath".

Now you can import the project in the eclipse IDE, therefore you can use the import eclipse wizard. Therefore select "File->Import->Existing Project into Workspace" then click the next button and select the leiningen project as root directory now you can import the project via click on the finish button.


When you have installed the eclipse plugin counterclockwise you can know develop with syntax highlighting, run the project and debug the project from the eclipse IDE.



Links

Samstag, 14. August 2010

My first Clojure Web Application

I’m a fan of LISP, so I'm known a fan of Clojure, because Clojure brings LISP features to the Java platform. I don’t know if Clojure is good programming language for production use or for my daily work, but it makes a lot of fun to develop in Clojure, just try it. My first step was to write in clojure a simple hello world web application.

I choose leinigen as build and dependency management tool and the clojure web framework Compojure to develop a super simple hello world web application.

Here are the steps how I create my first hello world web application in clojure in 3 minutes:

1.) Download Leiningen
Download the lein bash script from:

http://github.com/technomancy/leiningen/raw/stable/bin/lein

2.) Install Leiningen
Invoke the bash script with the follow command:

lein self-install

3.) Create a New Clojure Project
Creating a new project with leinigen, therefore invoke the follow command:

lein new helloworld-webapp

4.) Add Compojure Dependency
Add the compojure dependency to the project, therefore add the follow dependecies to the project.clj file.


5.) Create the Hello World Application
Add the follow lines of code in "src/helloworld_webapp/core.clj"


6.) Run the Web Application
To start the hello world web application invoke the follow command:

lein test

7.) Invoke the Application
Now you can use the simple web application in your favorite browser open the URL:

http://localhost:8080/

Source Code
The source code of this simple demo can be found on GitHub:
http://github.com/tux2323/clojure-helloworld-webapp


Links

Montag, 19. Juli 2010

Gource - SCM Visualization

Gource is a cool open source tool under GPL v3 for version control visualization. With Gource you can visualize the commit history of the project as an animated tree. Its cool to see how a project grows over the time and which people are involved in the project. Here a sample video of the SVN log of the OSGi sample project mars robot from the Summer OSGi Code Camp 2010.




Links:


Sonntag, 18. Juli 2010

Donnerstag, 8. Juli 2010

Eclipse Key Scheme Version 0.0.1

The Version 0.0.1 Plugin can be downloaded here:
http://github.com/tux2323/com.github.tux2323.eclipse.keyscheme/downloads

The Key scheme extends the default eclipse key scheme and adds the follow shortcuts:
  • STRG+SHIFT+P Show Perspective dialog
  • STRG+SHIFT+S G Generate Getter and Setter
  • STRG+SHIFT+S T Generate toString()
  • STRG+SHIFT+S D Generate Delegate methods
  • STRG+SHIFT+S C Generate Constructor using fields
  • STRG+SHIFT+S H Generate hashCode() and equals()
  • STRG+ALT+X+R Run...
  • STRG+ALT+X+D Debug...
Activate the key scheme in the eclipse preferences:
    STRG+SHIFT+S








    STRG+ALT+X








    See also my post call for shortcuts here:
    http://tux2323.blogspot.com/2010/07/eclipse-key-scheme-call-for-shortcuts.html

    Dienstag, 6. Juli 2010

    Eclipse Key Scheme – Call for Shortcuts

    In order to work efficiently in a development environment, I think you need an environment, which allows you to work exclusive with the keyboard. And you are rarely forced by the environment to switch back to mouse. Therefore in eclipse a cool set of keyboard shortcuts exists e.g. CTRL+1 for quick fix or refactoring rename CRTL+ALT+R. But some functions in eclipse have no default shortcut, for this function I defined always my own shortcuts. But often I forget to share these settings between my different eclipse installations and eclipse workspaces. Since I have some time I would now like to create my own key scheme plugin (see github).

    To create a key scheme in eclipse, you must create a new eclipse plugin and use the extension point "org.eclipse.ui.bindings", see the sample plugin.xml below.



    If you have any good ideas of missing eclipse shortcuts, feel free to write a comment with the idea thx...

    Sonntag, 27. Juni 2010

    Drawing and Creativity (German Post)

    Just reading slide:ology by Nancy Duarte and I come across with a nice quote from Bill McDonough. Unfortunately, I have the German edition of the book slide:ology, because of that the post is written in German.

    Was machen wir in unserem Bildungssystem nur mit der Kreativität unserer Kinder?

    Wenn ich in einem Raum voller Sechsjähriger betrete und frage: „Wer kann hier zeichnen?“, heben alle die Hand und schreien: „Ich kann’s“. „Ich kann alles mögliche Zeichnen“. Und wenn ich in einem Raum voller diplomierter Akademiker komme und frage: „Wer kann hier zeichnen?“, findet sich kein Einziger. Was ist das nur für eine Art von Bildungssystem?“ - Bill McDonough

    Ich kann das Zitat nur unterschreiben, meine Tochter kann eigentlich alles zeichnen, ich hingegen tue mir schwer mal schnell etwas zu skizzieren um einen Sachverhalt in einer Besprechung durch eine Grafik besser darlegen zu können. Aber ich arbeite so oft wie möglich dran damit ich wieder an die Leistungen meiner vierjährigen Tochter anschließen kann.

    Die große Frage für mich ist wie kommt es dass viele die Begeisterung am zeichnen verlieren, die wir als Kind hatten? Und oft eine menge Text einer kleinen Skizze in einer Besprechung oder in einem Dokument vorziehen?




    Ich glaube oft ist nur Angst, dass ein Dokument nicht professionell aussehen könnte. Meine Meinung ist, Inhalte müssen wieder im Vordergrund stehen, anstatt geschleckter Präsentation und Dokumente ohne Aussagekraft. Ich kenne sehr gute Dokumente die im Wesentlichen aus etwas Text und abfotografierten Zeichnungen aus einem Meeting bestehen die wesentlich mehr Inhalt haben als manch lange Spezifikation.

    Dieser Post ist ein JA für mehr handgemachte Zeichnungen, Grafiken und weiniger Text, Bla Bla in Meetings und Dokumenten. Auch wenn die Zeichnungen keinen Künstlerischenwert haben, wenn Sie helfen Inhalte effizient zu vermitteln war es nie ein Fehler den Stift in einer Besprechung in die Hand zu nehmen egal wie die Zeichnung danach aussieht.

    Sonntag, 13. Juni 2010

    Review Eclipse Helios RC4

    Change Log
    • 2010-06-14 - Add section about drag drop files as link in package explorer
    • 2010-06-14 - Add screen shot to JDT open implementation section
    • 2010-06-14 - Add a new section about the JDT code formatter on/off via comment tag.
    • 2010-06-13 - Initial create the review post

    Eclipse Helios is the annual release of Eclipse projects in 2010; this year 39 projects are part of the release. And here is my first contribution to the Helios Blogathon, more details on the Blogathon can be found here. Helios is the code name for this year collecting Eclipse release. The idea of such a release is to be simultaneously release a large quantity of eclipse sub projects at the same time. This gives the user an Eclipse platform with well-coordinated projects, which works together.

    My blog entry should only gives an overview of my favorite Eclipse projects and what new feature I really liked in the Helios release of Eclipse. The projects in my post are only a very small sub set of the Helios release, see here all projects.

    Preliminary first a big praise to the Eclipse developers and the community, Helios is again another great milestone and the best development environment we ever had. Ok I know there are other great IDE’s out there (Netbeans and IntelliJ) but how? I am in love with Eclipse, so please no flame war here. And also Eclipse is more then a IDE.

    The Helios RC3 was for me already so stable, that I've had it in my daily work. E.g. I have used the RC3 coding in a workshop with customers and I can tell Helios runs on my Mac Book as stable as any Eclipse version has before. First important point Helios seems to run very stable! Initial tests on Windows 7 also showed significant improvements have been made for SWT and Windows 7. But on Windows7 and Eclipse I will not actually talk here because I’m a Mac user!

    1. Eclipse Workbench 
    First a look at the basic Eclipse platform and what is new and what what pleases me.

    Drag and Drop Files
    In Helios you can drag and drop files and folders from the operating system in the Package Explorer, Project Explorer or Navigator view then a dialog popup where you can choose to copy the files or import the files as link.




    Resource Filter
    File system resources can now be filtered for each project.


    Linked Resources
    Linked resources can now be defined their locations relative to users defined variables.


    Virtual folders
    Virtual folders are a very cool new feature in Helios. A virtual folders is a new type of resource that exist only in the workspace and not in the backed directory in your file system. The function can be found in the advanced menu in the eclipse new folder wizard.


    UNIX file permissions
    Nice feature for Linux and Mac users. The full set of UNIX file permissions are now supported in the eclipse properties dialog of a resource.


    Key bindings in Quick Access
    The eclipse quick access (E.g. CMD+3 or CTRL+3) shows now the key bindings.


    Comparing configurations in the Installation History
    Now it is possible to compare the installation history, to see which plug-ins are installed and which are removed.


    2. Eclipse Workbench Team
    The eclipse runtime comes with a basic set of views, editors and wizards for SCM they will be used for CVS, SVN and GIT integration or other SCM systems.

    Open With in Compare editor
    Now there is a Menu Item open with in the context menu in the compare editor.


    3. Eclipse Workbench Debug

    Breakpoint Properties
    The breakpoints view now provides detail panel to display and edit the breakpoint properties.


    4. Eclipse JDT
    The Java Development Tools are a very cool set of views and editors for java development, refactoring, debug and testing. Here the new feature I love in Helios version of JDT.

    A nice overview off the new JDT features gives the eclipse Live screen cast here.

    Open Implementation
    Was a new feature in the eclipse Galileo release, now the function is also in the navigation menu and a key binding can be assigned.



    Code Style On/Off Tags 
    Now there is new tab in the code formatter options of your code style. The tab is called “On/off Tags”, when you enable this feature you can specify regions in your code, which should not be touch, by the auto formatter.




    Content assist for getter and setter
    Now the getter and setter for field can be create via the content assist a good alternative to quick assist via CMD+1 (CTRL +1).



    New Refactoring Pattern - Move type to new file
    Now a private class can be moved to a file see the example in screen shot. A pattern I not often need but some times it is cool you can develop all in a file and then use this pattern.


    Java Compiler Report missing @Override
    When you have a Java 1.6 project the java compiler now reports missing override annotations that’s very cool. The feature must be activated in the compiler settings.



    Compiler Setting Import / Export
    The settings of the Java compiler can now be exported and imported. That’s a cool feature when you work with more then one workspace and on different machines.


    New Build Path Error Decorator
    Build Path error is now shown by an extra icon as decorator. That’s very cool when I for got to set the Maven Classpath Variable in my Eclipse I see its not a compile problem something with my build path do not work great feature.


    Type Hierarchy
    The Type Hierarchy has now the option that can be sent to the background.


    Debugging Instance Counts
    The Variables view has now a new column displaying the number of instances of a variable.


    JUnit Result Import form URL
    JUnit results can be import form a URL e.g. form a build server that’s cool.


    JUnit Launcher Test Method
    Now the test method can be set in the JUnit launcher. That’s cool when you like to run one test, in eclipse Galileo this works also but not over the launch configuration.


    5. Eclipse PDE
    PDE is the eclipse plug-in development tool suite. Because every eclipse plug-in is also an OSGi bundle PDE provides also a great tool suite for development of OSGi based applications.

    Eclipse OSGi console
    An OSGi console is now available for the running eclipse framework.


    Export Target Content
    It's now possible to export the contents of the target platform into a directory.
    Cool feature to share a platform.



    6. Eclipse Modeling (EMF, GMF…)
    Eclipse Helios comes with a big suite of tools for model driven development. An overview of the cool tools is not scope of this post. Here the new feature in the eclipse modeling project I love.

    Text Editor for EMF
    Now in Helios there is really cool text based editor for EMF models.

     

    EMF Tree Editor
    There is new generic EMF Tree based editor in Helios with a integrated properties view.


    EMF Compare
    I cannot remember what I commemorated it there since Galileo, but a played around with the EMF generic model comparing tools and it looks great. You can use the EMF compare tool for all EMF based models also your own models which are based on EMF Ecore.


    Eclipse GMF
    Cool project I worked a longtime ago with it, when you like to create a graphical DSL this model driven tool is your fist choice I think. GMF provides a model driven approaches to create graphical editors for eclipse, which are based on EMF and GEF.

    I don’t have the really review the Helios version, I created a small editor all works but I don’t find new feature compared to Galileo version. But I don’t spend much time in the review. What I can say that the basic functions works fine in RC4. And you can use the new EMF modeling editors to create the models but this not a GMF feature.


    7. Eclipse Mylyn
    Mylyn is a great eclipse tool for management tasks.



    Mylyn WikiText
    Mylyn provides now a cool WikiText editor, the editor can be used in Mylyn but also standalone or in any eclipse based application.



    8. Eclipse Memory Analyzer
    This is cool eclipse plug-in for memory analyzes to find memory bugs.

    When you like to use the Eclipse Memory Analyzer the first step is to create a Java heap dump. This can be done when you have a server application over JMX see the screen shot, or over the default Java VM options to create a heap dump (therefore see the Java VM documentation).


    When you have a heap dump you open it and then you can analyze the dump with the Eclipse Memory Analyzer. More details see the Memory Analyzer tutorial in eclipse help.





    9. EGit
    First time in simultaneous release of eclipse a EGit. EGit is GIT SCM integration in eclipse. The basic features are implemented. What is not in EGit 0.8.1 is a team synchronization view, but I hope in version 1.0.0 which comes at the end of the year I think, this is also implemented. I think the EGit developers do a very good job in such a short time such a cool integration respect and thanks.


    10. Eclipse WTP
    The WTP project provides a huge set of tools for web development specially tools for J2EE web development.

    Web Modules 3.0 and JSF 2.0
    WTP now supports web modules version 3.0, JSF 2.0 and for e.g. apache tomcat 7.0





    Web Deployment Assembly
    In the Helios WTP version is now a preference dialog to configure the mappings of the project folder to the deployment structure. That’s a very import feature in Galileo I do this in the project settings files by hand or mvn eclipse does it for me, but there was no dialog for it. This new dialog replaced also the buggy Java EE module dependencies from Galileo dialog.



    JSF Facelet Support
    The HTML editor supports know JSF Facelet, which are also part of the JSF 2.0 specification. Now the content assist in the HTML can be used to select the JSF components.


    XPath 1.0 and 2.0 Processor
    Now there is a XPath 1.0 and 2.0 processor in WTP.


    11. Remote System Explorer

    The remote system explorer brings an eclipse integration for SCP, SSH and other cool tools to manage remote systems. I use the remote system explorer to edit configuration file on remote systems e.g. on the testing environment with my favorite eclipse editors e.g. for XML configuration files. The remote system explorer brings also a set of cool tools to work with your local system.


    Local Console Integration
    Now there is integration of the local console e.g. bash in the Helios release. In Galieo I need to use for a local consol SSH now I use the bash native cool.


    An alternative is to use the local shell feature see the screen shout bellow from the RSE project, but in this shell the TAB feature from the bash do not work. So I'm very happy about the new integration of my local bash in eclipse.