My first steps with Cocoon 2.2
Better late than never is maybe the best description of what I did this morning. Cocoon 2.2 is about to be released but apart from Andrew Savory’s presentation at the ApacheCon I had never seen it running. I finally finished my running projects so I had some time to play with Cocoon 2.2.
Cocoon 2.2 seems to be better documented than the previous versions so there was actually an online tutorial how to make your first application. Maven 2 appeared to be on my system already so I had to remove the old beta version which was from 2005 or so. Luckily this was not rocket science. Then I created a Java project in Eclipse and created my own block in that folder. I shouldn’t have done that because I ended up with a double folder structure. Shift-delete, re-create my own block and import that in Eclipse, much better 🙂 I tried to create it from 1.0.0-RC2 because I saw there was a tag for it not knowing Reinhard was working hard releasing all the artifacts today. I had to do it with 1.0.0-RC1 but that worked too.
1 hour and 2 cups of coffee later I had my first Cocoon 2.2 application running, NOT! The maven Jetty plugin cost me a lot more time. For some unknown reason it couldn’t find the right version of some jars so Jetty wouldn’t start. I have no experience with Maven 2 at all so I didn’t know where to look. Jeroen was so kind to help me with settings but in the end I had to manual install those jars in my repository. Took some time but finally I had a "Hello World!" on my screen. Getting Cocoon 2.1 run for the first time is much easier but the 2.2 blocks setup is better to maintain in the real world.
Then it was time for the next step: connect it with Hippo Repository through WebDAV. I added the WebDAV block to the dependencies and recompiled my project. I don’t know what I did wrong but I found no WebDAV configuration at all. I checked out the whole 2.2 trunk to find a working sample but by the time I had checked out and compiled that, playtime was over and I had to do other work (and eat a "broodje knakworst"). To be continued during the Cocoon GT hackaton…