---
title: "use hibernate3-maven to export sql based on entity"
author: "IvanLi"
date: "2011-08-07T18:19:12Z"
tags: []
categories: ["数据库"]
slug: "use-hibernate3-maven-to-export-sql-based-on-entity"
draft: false
lastmod: "2011-08-07T18:19:12Z"
id: 1142063
url: "https://ivanl.iteye.com/blog/1142063"
---

```xml

<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>hibernate3-maven-plugin</artifactId>
				<configuration>
					<components>
						<component>
							<name>hbm2ddl</name>
						</component>
					</components>
					<componentProperties>
						<drop>true</drop>
						<create>true</create>
						<ejb3>true</ejb3>
						<java5>true</java5>
						<export>true</export>
						<scan-classes>true</scan-classes>
						<outputfilename>schema.sql</outputfilename>
						<configurationfile>src/main/resources/local/hibernate.cfg.xml</configurationfile>
					</componentProperties>
				</configuration>
				<dependencies>
					<dependency>
						<groupId>mysql</groupId>
						<artifactId>mysql-connector-java</artifactId>
						<version>5.1.13</version>
					</dependency>
				</dependencies>
			</plugin>

```