简介
The maven plugin is designed for people who use Apache Maven as a build tool.
maven插件的设计是被人们当初maven构建工具使用。
As well as this maven plugin, dbdeploy supports an ant task and a command line interface.
以及这个Maven插件,dbdeploy支持ant任务 和 命令行接口
使用
The maven plugin was introduced in version 3.0M3. It is published to maven central.
Maven插件被引入到3.0m3版本中。它发布到Maven中心。
Example pom.xml:
<build> <plugins> <plugin> <groupId>com.dbdeploy</groupId> <artifactId>maven-dbdeploy-plugin</artifactId> <version>3.0M3</version> <configuration> <scriptdirectory>.</scriptdirectory> <driver>org.hsqldb.jdbcDriver</driver> <url>jdbc:hsqldb:file:db/testdb;shutdown=true</url> <userid>sa</userid> <password></password> <dbms>hsql</dbms> <delimiter>;</delimiter> <delimiterType>row</delimiterType> </configuration> <dependencies> <dependency> <groupId>hsqldb</groupId> <artifactId>hsqldb</artifactId> <version>1.8.0.7</version> </dependency> </dependencies> </plugin> </plugins> </build>
The parameters match up with those on the ant interface, see UsingTheAntInterface for more information. Currently (3.0M3), the maven parmaters differ from the ant interface in the following ways:
这些参数匹配ant接口,更多的信息看使用ant接口。目前(3.0M3)版本maven参数不同与ant接口在下面几个方面:
the ant dir
parameter is called scriptdirectory
in the maven plugin
ant dir参数在maven插件中被称为目录脚本
The maven plugin supports the following goals:
maven插件支持下面的目标:
db-scripts: executes dbdeploy in "output file" mode
数据库脚本:执行dbdeploy“输出文件”模式
update: executes dbdeploy in "direct to database" mode
更新:执行dbdeploy在“直接数据库”模式
So, you can use mvn dbdepoy:update
in a directory with a configured pom to apply updates to the database. As with any plugin you canconfigure a dbdeploy goal to execute automatically in any maven lifecycle phase. None of its goals bind to a lifecycle phase by default.
所以,你可以使用:
mvn dbdeploy:update
去运行一个数据库的更新这个更新是配置在pom文件里的。正如任何插件,您可以配置dbdeploy目标自动执行任何Maven生命周期阶段。它的目标不绑定到一个默认的生命周期阶段。
You can use:
mvn help:describe -Dplugin=com.dbdeploy:maven-dbdeploy-plugin -Ddetail
to get full plugin documentation.
你也可以使用
mvn help:describe -Dplugin=com.dbdeploy:maven-dbdeploy-plugin -Ddetail
获取全部的插件文档
3.0M3版本需要特别注意的
Unfortunately the pom.xml in the examples directory of the distribution is incorrect, see issue 56 for details.
很不幸的是,pom.xml文件在分布例子的目录中是不正确的,详细看问题56
Specifically, you need to replace the version of 3.0-SNAPSHOT with 3.0M3 for it to work. Apologies.
具体的,你需要使用3.03M替换3.0-SNAPSHOT版本让他继续工作,抱歉
原文:http://my.oschina.net/u/260244/blog/323351