dbdeploy的maven外掛程式使用

來源:互聯網
上載者:User

標籤:des   style   http   color   io   os   使用   ar   strong   

Introduction

簡介

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任務 和 命令列介面

Usage

使用

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

擷取全部的外掛程式文檔

Special note for the 3.0M3 release

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版本讓他繼續工作,抱歉


dbdeploy的maven外掛程式使用

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.