Maven Plugins for Hibernate and JSF Annotations
October 12, 2006 2 Comments
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.