mardi 21 juin 2011

Comparing pom.xml files while waiting for indigo




I know you're all waiting for the Indigo release final bits ! These 0 and 1 are finding their way on the mirrors as I'm writing to make sure we'll get the smoothest release ever ;)

So, you ends up waiting ... In the meantime, I'm going to show you a nice piece of technology which is not going to be a new feature is Indigo ... as it's been around a few years already ;)

Maybe you had a look at Maven/Tycho, it definitely gained momentum this year, it's completely based on these pom.xml< files. I used them a few times already and even with the Minerva project (which helps a lot) I'm already in a love/hate relationship with those files.

"When the wise man point at the model, the idiot looks at the XML "

Hopefully Maven is providing an XSD here : http://maven.apache.org/maven-v4_0_0.xsd which you can use to initiate an EMF model :




Starting from an XSD is never as cool as starting from Ecore, but at least the EMF project can provide you an automatic mapping. And here is the mapped Ecore :




If you want a cleaner model you can tweak the mapping.

Using the genmodel you'll get the corresponding Java code. From now EMF is now able to load and save pom.xml files transparently and you can work with them using the Java API or the EMF reflective API.

What for ? To leverage all the great components around here, for instance, EMF compare is then able to use this and compare the model and not the XML serialization.


Ok, It probably took you less than five minutes to read this, if you're not a Friend of Eclipse you still have to wait for the release. As a sidenote, it did not take me more than 5 minutes to prepare it ;)

If you did not checked out EMF&co, you should really have a look !


Enregistrer un commentaire