I’m having issues getting the mavin plugin working, and the documentation in the manual looks like it is from the 1.6 version of the plugin. Right now I’m getting the error “The driver has not been specified either as a parameter or in a properties file.”
After playing around with this more, I believe my question should be, “How do I setup the plugin using the eclipse maven plugin?” Basically I want to create a project just for liquibase so that there is one place to maintain the database schema. I want to be able to just right-click and say new maven project than add the plugin and other dependencies. Am I going about this the completely wrong way? I have used Maven before, but I’m still pretty new at it.
For starters, I remember having some issues with 1.9.4.0 so I’m using 1.9.3.0. I don’t off-hand remember the specifics but to answer your question about the driver issue, what does your properties file look like that you are pointing to in your snippet? It sounds as though the properties file does not contain a driver property.
[...]
I want to be able to just right-click and say new maven project than add the plugin and other dependencies.
[...]
You could also look at creating an maven archetype for that purpose. That way you can just create a new project with your liquibase archetype and it will populate a POM file for you with all the needed dependencies and POM layout that you require.
I am having the same problem and the workaround did not seem to help. I am using maven 3 and liquibase 2.0.1 .
Using the pom.xml below, with my update.xml in the src/main/resources directory, I can run “mvn process-resources” and it will successfully run the update and then it will also successfully run the rollback. I don’t want it to run both the update and rollback and so I try to run the specific goal with this command “mvn liquibase:update” . At this point I get the error “[ERROR] Failed to execute goal org.liquibase:liquibase-maven-plugin:2.0.1:update (default-cli) on project bidsync-liquibase: The driver has not been specified either as a parameter or in a properties file.”
For whatever reason if you try to run the specific goal then the liquibase plugin ignores all of the configuration parameters that have been set.
Turns out I was able to solve my own problem. The problem is that the example given here http://www.liquibase.org/manual/maven is wrong. The configuration in the example is specified in the executions tag and it should be specified directly under the plugin tag. Also a phase is not needed but you can use it if you want your update to run automatically when you do a mvn compile or a mvn test. So using this new pom.xml I can run “mvn process-resources” or a “mvn compile” and the update goal will run successfully. Or I can run “mvn liquibase:update” and the update goal will run successfully. Or I can run “mvn liquibase:rollback -DrollbackCount=5” and my rollback goal will run and rollback the last 5 change sets.
One other note – you can create your own liquibase.properties file, but I find it much easier to add settings to your ~/.m2/settings.xml file and then directly reference those properties in your pom.xml like I did with my ${jdbc.url} references.
Hey, this has bailed me out. I had the same problem. On shifting the configuration tag to grace directly below the plug tag, everything worked seamlessly.