exec-maven-plugin如何退出SQL * Plus

时间:2016-06-02 12:50:56

标签: maven exec sqlplus

我正在使用exec-maven-plugin运行SQL脚本(简单DML),然后运行:

mvn clean install -Prunmysql

并且在执行期间我打开了SQL>控制台,直到手动输入EXIT才能继续。

如何让插件知道,执行后需要退出SQL控制台?

<profile>
  <id>runmysql</id>
  <build>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <version>1.5.0</version>
        <executions>
          <execution>
            <phase>pre-integration-test</phase>
            <goals>
              <goal>exec</goal>
            </goals>
            <configuration>
              <executable>sqlplus</executable>
              <arguments>
                <argument>user/pwd@localhost:1521/dbname</argument>
                <argument>@myfile.sql</argument>
              </arguments>
              <workingDirectory>C:\sqlproject\</workingDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</profile>

0 个答案:

没有答案