maven使用liqubase管理数据库
来源:互联网 发布:扣扣群发软件 编辑:程序博客网 时间:2024/06/03 14:55
第二次使用maven的liqubase插件在项目启动的时候自动建表,记录一下,备忘:
使用eclipse的maven插件:
changelog.xml
<?xml version="1.0" encoding="UTF-8"?><databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.0.xsd http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd"><changeSet id="xxx-2015-6-30-1" author="jiangyu"> <sqlFile path="city_table_struct.sql" encoding="UTF-8"relativeToChangelogFile="true" /></changeSet><changeSet id="xxx-2015-6-30-2" author="jiangyu"> <sqlFile path="city_init_data.sql" encoding="UTF-8"relativeToChangelogFile="true" /></changeSet></databaseChangeLog>
pom文件配置:
<plugin><groupId>org.liquibase</groupId><artifactId>liquibase-maven-plugin</artifactId><version>3.0.5</version><configuration><changeLogFile>src/main/resources/city/cityinit.changelog.xml</changeLogFile><driver>${dataSource.project.driverClass}</driver><url>${dataSource.project.jdbcURL}</url><username>${dataSource.project.user}</username><password>${dataSource.project.password}</password></configuration><executions><execution><phase>process-resources</phase><goals><goal>update</goal></goals></execution></executions></plugin>
<pre name="code" class="html"><pluginManagement><plugins><!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself. --><plugin><groupId>org.eclipse.m2e</groupId><artifactId>lifecycle-mapping</artifactId><version>1.0.0</version><configuration><lifecycleMappingMetadata><pluginExecutions><pluginExecution><pluginExecutionFilter><groupId>org.liquibase</groupId><artifactId>liquibase-maven-plugin</artifactId><versionRange>[3.0.5,)</versionRange><goals><goal>update</goal></goals></pluginExecutionFilter><action><ignore></ignore></action></pluginExecution></pluginExecutions></lifecycleMappingMetadata></configuration></plugin></plugins></pluginManagement>
0 0
- maven使用liqubase管理数据库
- 使用Maven管理项目
- 使用Maven管理Spring
- 使用Maven管理Spring
- 使用Maven管理Spring
- 使用Maven管理Spring
- 使用Maven管理Spring
- 使用Maven管理Spring
- 使用Maven管理Spring
- 使用Maven管理Spring
- 使用Maven进行项目管理
- 使用Maven创建管理项目
- 使用Maven进行项目管理
- 使用nexus管理maven仓库
- 使用maven管理scala项目
- android使用maven管理项目
- 使用Maven管理Android项目
- 使用maven管理andorid工程
- 基于REST 的 Web 服务:基础
- 获取某一个view所在视图控制器,进而可以进行跳转等操作
- HttpURLConnection
- 数据库连接池配法
- AFNetwork上传文件,下载文件,监控网络状态
- maven使用liqubase管理数据库
- java面向对象的三大特性
- Oracle时间运算
- webService之(二)java原生态客户端
- 二叉树的深度优先遍历与广度优先遍历
- Android Studio project有多个module情况下安装到手机出现多个app问题
- PHP 获取 ping 时间
- AES128加密解密方法
- 【C语言】不使用+-*/实现两个数之和