It took me awhile to figure it out, but I figured out how to run the liquibase logging through slf4j/log4j/logback etc, for Liquibase 3.0.8. There’s an easy way and a hard way. The easy way is just the hard way pre-packaged as a jar for you. You’ll understand.

The easy way

Drop in a jar called liquibase-slf4j, by Matt Bertolini, and configure its class logging through slf4j instead. In my case I’m using slf4j-log4j12 on top of that so I configure everything log4j style (make sure you have log4j on your classpath!).

read on

As I was again trying to remember how to sort a list of objects in Java bases on multiple keys, I had the luminous idea to finally write it down.

We have a list of pizza’s, and I want them sorted according to size, number of toppings and furthermore by name. This means that there will be groups ordered by size and within those groups the pizza’s are ordered into groups by number of toppings and in those groups the pizza’s are ordered by name.

We want to end up with a list like this:

  1. Pizza’s 34cm:
  2. Anchovy (34cm, tomato, cheese, Anchovies)
  3. Prosciutto (34cm, tomato, cheese and ham)
  4. Chicken Special (34cm, tomato, cheese, chicken and turkey pieces)
  5. Vulcano (34cm, tomato, cheese, mushrooms and ham)
  6. Peperone (34cm, tomato, cheese, mushrooms, ham, capsicum, chili peppers and onions)
  7. Pizza’s 30cm:
  8. Anchovy (30cm, tomato, cheese, Anchovies)
  9. Prosciutto (30cm, tomato, cheese and ham)
  10. Chicken Special (30cm, tomato, cheese, chicken and turkey pieces)
  11. Vulcano (30cm, tomato, cheese, mushrooms and ham)
  12. Peperone (30cm, tomato, cheese, mushrooms, ham, capsicum, chili peppers and onions)
  13. Pizza’s 26cm:
  14. Anchovy (26cm, tomato, cheese, Anchovies)
  15. Prosciutto (26cm, tomato, cheese and ham)
  16. Chicken Special (26cm, tomato, cheese, chicken and turkey pieces)
  17. Vulcano (26cm, tomato, cheese, mushrooms and ham)
  18. Peperone (26cm, tomato, cheese, mushrooms, ham, capsicum, chili peppers and onions)

read on

Here’s a blatant repost of How to make Clover ignore private constructors by Alex Ruiz.

I was actually looking for a regular expression matching private constructors so that I could make Clover ignore these in the Eclipse plugin. His post is about how to configure Clover in Maven however, here’s how you configure the Eclipse plugin.

read on

Having several projects in Bamboo that share a repository, build script and libraries, it can be tricky to configure Bamboo build plans correctly; but it isn’t hard at all. I’m going to quickly show you how I configured Bamboo Plans for two projects that are in the same repository, but share a master library. This is a very common setup and the point is to make Bamboo build only for the plans if their associated project has been updated.

In addition to the shared master library folder, I’m going to include a master build.xml file as well and see how that works with the nested projects.

read on

I love the (now aging) Apache collections15 library, but here’s a small ugly detail that is good to know.

The following call doesn’t do what you would think it does – or what I thought it would do anyway (and the JavaDoc isn’t clear enough):

read on

Today I was trying to figure out how to exclude certain resources/classes from the war that was being deployed to my embedded server in Eclipse. I couldn’t find out how to do this in the Eclipse settings file.

Apparently, it has nothing to do with the source folder you see in the Project Explorer view, or the export settings in the Buildpath dialogs: instead you need to edit the Eclipse settings file “project-war.settingsorg.eclipse.wst.common.component” (viewable in the Navigator view) and modify the deployed source folders in there. Changes there do *not* reflect in the Project explorer (at least not with my version of Eclipse, Galileo). I’ve removed the test sourcefolder from there and everything was honky dory.

November 4, 2012 – PageList has now been released on GitHub!

Here’s a list implementation I came up with to enable true paged data fetching completely transparent to any List user. It works independent of persistence layers, such as JPA implementations etc and it can be used by anything that only needs a List, such as a < rich:dataTable >.

read on

[RE: JSF – Still pretty much a steaming pile of donkey turd] – I was replying to Wille Faler’s post about why JSF sucks, when the comment was getting too large, so I made it into a post on my own blog.

JSF is hard to learn yes, but in my opinion it doesn’t suck as bad as Wille says. All the points Wille mentions can be solved by certain libraries or write-once reusable solutions (I’ve included my ‘magical’ combination of frameworks on the bottom). JSF is a diamond in the rough, you just need to make it shine.

read on

Yes, it is possible. Yes, it requires hacking JSF with filters and/or phaselisteners and/or custom servlets for encoding/decoding serializing/deserializing GET parameters and force redirects upon JSF view resolvers. The good news however: it’s all been done before and you can just hang back and use a small framework that does all this stuff for you. Enter PrettyFaces.

But before we come to that, I would like to show you how PrettyFaces sums up what you need. This involves solving two problems: The JSF POST compulsion and the JSF Redirect problem. You can in fact solve all of these problems separately, but PrettyFaces just encapsulates all these annoying things for you in a convenient little jar.

read on