maven - create schema during build for hibernate-4 using annotated classes -
i'm trying upgrade hibernate 4.1.3 (from 3.6.9). model annotation based (that is, persistent classes defined @entity , @column annotations)
the maven build uses hibernate3-maven-plugin create sql script schema, plugin doesn't work 4.1.3. thought of using schemaexporttask vi antrun, understanding need explicitly configure classes analyse , don't know how them in maven. how provide task classes?
any other create schema great.
juplo has created maven plugin hibernate 4. plugin automatically scans project annotated classes , supports schema export including envers. working example below. check official plugin configuration documentation more information on used options.
the plugin generates schema.sql file in maven /target directory on test goal. or can manually run hibernate4:export goal update file.
<project> <build> <plugins> <plugin> <groupid>de.juplo</groupid> <artifactid>hibernate4-maven-plugin</artifactid> <version>1.0.3</version> <executions> <execution> <goals> <goal>export</goal> </goals> </execution> </executions> <configuration> <envers>true</envers> <format>true</format> <delimiter>;</delimiter> <force>true</force> <type>create</type> <target>script</target> <hibernatedialect>org.hibernate.dialect.postgresql9dialect</hibernatedialect> </configuration> </plugin> </plugins> </build> </project>
Comments
Post a Comment