在命令行中运行mvn liquibase:update命令。
老是build failure。提示“The driver has not been specified either as a parameter or in a properties file”错误。
找了好久的终于找到解决方法了
我在pom.xml文件中配置的是:
<plugin>
<groupid>org.liquibase</groupid>
<artifactid>liquibase-plugin</artifactid>
<version>2.0.5</version>
<executions>
<execution>
<phase>process-resources</phase>
<configuration>
<propertyFileWillOverride>true</propertyFileWillOverride>
<propertyFile>src/main/resources/liquibase.properties</propertyFile>
<changeLogFile>${changeLogFile}</changeLogFile>
<driver>${driver}</driver>
<url>${url}</url>
<username>${username}</username>
<password>${password}</password>
</configuration>
<goals>
<goal>update</goal>
</goals>
</execution>
</executions>
</plugin>
将上面的代码修改为:
<plugin>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-maven-plugin</artifactId>
<version>2.0.5</version>
<configuration>
<propertyFileWillOverride>true</propertyFileWillOverride>
<propertyFile>src/main/resources/liquibase.properties</propertyFile>
<changeLogFile>${changeLogFile}</changeLogFile>
<driver>${driver}</driver>
<url>${url}</url>
<username>${username}</username>
<password>${password}</password>
</configuration>
<executions>
<execution>
<!-- 通过phase参数指定何时运行,一般为process-resources -->
<phase>process-resources</phase>
<goals>
<goal>update</goal>
</goals>
</execution>
</executions>
</plugin>
大功告成啦。哈哈