2.0.0 Maven plugin

Hello,

I upgrade liquibase to 2.0. The maven plugin does not use username configuration anymore. Is it an issue?

Thanks.

Here is the plugin configuration.

                          org.liquibase liquibase-maven-plugin ${liquibase-version} process-test-resources ${project.build.outputDirectory}/database/master.xml ${connection-driver} ${connection-url} ${connection-username} ${connection-password} false update

It should be.  I’m not a maven user, but the code in AbstractLiquibaseMojo for the username has not changed since 1.9

Nathan

Thank you Nathan. So the problem is in my pom.xml. Hope i’ll find it.

Didier

I’m also encountering the same issue.

Error setting up or running Liquibase: java.sql.SQLException: Access denied for user ‘’@‘localhost’ (using password: NO) -> [Help 1]

Error setting up or running Liquibase: java.sql.SQLException: Access denied for user ‘’@‘localhost’ (using password: NO)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:203)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:140)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:316)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:153)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:451)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:188)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:134)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoExecutionException: Error setting up or running Liquibase: java.sql.SQLException: Access denied for user ‘’@‘localhost’ (using password: NO)
at org.liquibase.maven.plugins.AbstractLiquibaseMojo.execute(AbstractLiquibaseMojo.java:315)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:107)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:195)
… 19 more
Caused by: liquibase.exception.DatabaseException: java.sql.SQLException: Access denied for user ‘’@‘localhost’ (using password: NO)
at liquibase.integration.commandline.CommandLineUtils.createDatabaseObject(CommandLineUtils.java:88)
at org.liquibase.maven.plugins.AbstractLiquibaseMojo.execute(AbstractLiquibaseMojo.java:270)
… 21 more
Caused by: java.sql.SQLException: Access denied for user ‘’@‘localhost’ (using password: NO)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1075)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3562)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3494)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:920)
at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:4000)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1285)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2186)
at com.mysql.jdbc.ConnectionImpl.(ConnectionImpl.java:787)
at com.mysql.jdbc.JDBC4Connection.(JDBC4Connection.java:49)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:409)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:357)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:285)
at liquibase.integration.commandline.CommandLineUtils.createDatabaseObject(CommandLineUtils.java:79)
… 22 more

It may need to be specified as liquibase.username  Again, not a maven user, but I maybe saw taht somewhere

Nathan

I had the same issue.
Can’t find the article now, but it seems Liquibase maven plugin 2.0.0 has a bug when working with maven 3.x.
The username running maven is taking over the username setting in the liquibase plugin.
The plugin version 2.0.1 fixes this, not sure if it’s considered stable though.

Issue doesn’t seem to be fixed in 2.0.1 for Maven 2 too. 

Even when the liquibase verbose mode shows correct username and password they do not get applied.

When the same credentials are passed via command line, like

mvm liquibase:update -Dliquibase.username=XXX -Dliquibase.password

everything works.