Friedrich Merza
Friedrich Merza

Reputation: 109

Hibernate 3 Maven Plugin -> remove "Generated by Hibernate Tools"

I am Using the hibernate 3 Maven Plugin Version 2.2 to create my Entities of the database. This works great, but i have one problem. My entities contain the Comment : // Generated 07.10.2015 12:46:10 by Hibernate Tools 3.2.2.GA

Is there any way to configure the maven plugin to not put the comment in my generated entities?

I like to add them to git when i regenerated them. But in that case the entities change on every generate-sources goal cause the date in the "generated by" comment changes.

I searched alot, but i didnt find any working solution. Some wrote that it is possible to use a custom .ftl file to define to generated entities. but in my case this ftl file i added wasnt used by the maven plugin.

thx alot ;)

Upvotes: 0

Views: 459

Answers (1)

Grim
Grim

Reputation: 2040

Override the templates distributed by hibernate-tools. Copy them to /src/main/templates and configure them in maven like <templatepath>src/main/tempates</templatepath>.

I actually generate like you and i come to a different problem: Sometimes the fields, getters and setters shuffle its order in the java-files. That makes it hard to compare. In eclipse you could order the fields and getters in the correct order before commit. Maybe there is a way to do it using the maven-lifecycle.

Upvotes: 0

Related Questions