Hibernate+maven+eclipse 实现自动建表(三)

2014-11-24 02:08:41 · 作者: · 浏览: 5
.jdbc.Driver
${hibernate.credit.url}
${hibernate.credit.username}
${hibernate.credit.password}
org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider
50
${hibernate.credit.min_size}
9000
0
2
180
Test
30
1000
true
30
30
true
true
utf-8
thread
2
update
false
false
复制代码
test.properties
hibernate.credit.url=jdbc: mysql://127.0.0.1:3306/juxinli_credit useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true
hibernate.credit.username=root
hibernate.credit.password=root
hibernate.credit.min_size=5
在pom.xml 中 之后,加上如下配置:
复制代码
hibernate
compile
maven-compiler-plugin
2.3.1
1.7
1.7
UTF-8
src/main/webapp/WEB-INF/lib
src/main/resources
true
development
true
src/main/resources/environment/test.properties
production
src/main/resources/environment/production.properties
复制代码
在使用maven打war包时:
1)可以手动运行命令:
mvn package -Ptest
这样表示的是打id为test的war包。
2)也可以采用:项目名称,鼠标右键Run As--> Maven install 进行打包。