Maven Plugins for Hibernate and JSF Annotations

Jason Van Zyl, founder of the Apache Maven sent an email to the apache committers mailing list about maven sandbox module. In his email he has announced that all the apache committers have now access to the maven sandbox so every committer can directly contribute to the maven project. Me and Sylvain Vieujot(Apache MyFaces PMC) talked about this when we’re in Dubai, he has written two maven plugins for hibernate annotations and jsf annotations.

Hibernate annotations plugin checks through the classpath and adds the <mapping class=”blablabla” /> tags to the hibernate.cfg.xml if it sees something like @Entity. The advantage is that you don’t need to maintain the mappings in the hibernate.cfg.xml for each entity you’ve annotated with hibernate annotations, they are all generated. Yesterday I’ve added a new feature to cache the generated config file to give some performance boost to the execution. So the config file is not generated each time it’s executed, this leads to a significant reduce in the execution time.

JSF annotations plugin implements a similar idea, goes through the classpath and generates the faces-config.xml from the information it collects. It was only working for managed beans and navigations, lately I’ve added new features to realize converters, validators, phaselisteners and etc.

There are still some work and refactoring left todo about them but since maven sandbox is open to all apache committers, we’ll probably commit the plugins to the maven repository soon.

2 Responses to Maven Plugins for Hibernate and JSF Annotations

  1. Geoffrey De Smet says:

    Are you referring to a seperate plugin that the mojo hibernate3-maven-plugin?
    If so, I created a patch for the mojo hibernate3-maven-plugin to allow it generate sql scripts based on @Entity classes in the classpath (without the need for a .cfg.xml):

    It would be best that only 1 plugin for hibernate exist, which has the best of both worlds.

%d bloggers like this: