username and password overwritten in maven plugin 2.0 with maven 3

Hi,

I just started using Liquibase and I am trying to setup the maven plugin. I kept getting invalid username/password even though I was sure all config was ok. Looking at the source of the plugin there seems to be a feature added in december 2010 http://liquibase.jira.com/browse/CORE-784 which states: “Instead of both properties username and password, you could reference connection credentials using the server tag details of settings.xml for not disclosing login & password in the POM file.”

This is a nice feature but it always overwrites the manually configured username and password. Surely this was not the intention?

Sorry forgot to mention I’m using maven 3.
In DefaultWagonManager the implementation of getAuthenticationInfo always returns a non null value. This might be a change between maven 2 and maven 3. I think it got it from a map in maven 2 thereby returning null if the server could not be found.

        public AuthenticationInfo getAuthenticationInfo( String id )     {         MavenSession session = legacySupport.getSession(); ....         // empty one to prevent NPE       return new AuthenticationInfo();     }

In liquibase maven plugin class AbstractLiquibaseMojo on line 230:

            AuthenticationInfo info = wagonManager.getAuthenticationInfo( server );         if ( info != null ) {             username = info.getUserName();             password = info.getPassword();         }

info is never null so the logic needs rewritten to check the actual content and not just if not null.

I committed this fix for 2.0.1.  Thanks for the fix info.

Nathan