# maven plugin problem with maven 3

**URL:** <https://forum.liquibase.org/t/maven-plugin-problem-with-maven-3/1082>\
**Category:** General Discussion\
**Created:** [January 21, 2011, 7:12am UTC](https://forum.liquibase.org/t/maven-plugin-problem-with-maven-3/1082 "2011-01-21T07:12:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![henning\_juva](https://avatars.discourse-cdn.com/v4/letter/h/ecd19e/32.png) [@henning\_juva](https://forum.liquibase.org/u/henning_juva)\
**Post date:** [January 21, 2011, 7:12am UTC](https://forum.liquibase.org/t/maven-plugin-problem-with-maven-3/1082/1 "2011-01-21T07:12:00Z")

</div>

Did the spam filter consume my previous post from yesterday?

Anyway I have an issue where username and password provided to the liquibase maven plugin is always overwritten by the server settings in maven. See [http://liquibase.jira.com/browse/CORE-784](http://liquibase.jira.com/browse/CORE-784)

In liquibase maven plugin class AbstractLiquibaseMojo on line 230:

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

In maven 2.0 DefaultWagonManager the above logic works as the AuthenticationInfo is retrieved from a map thereby returning null if we have not defined the server:

&nbsp; &nbsp; public AuthenticationInfo getAuthenticationInfo( String id ) &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; &nbsp; return (AuthenticationInfo) authenticationInfoMap.get( id ); &nbsp; &nbsp; }

Running the plugin from eclipse using an external maven 3.0.1 installation it will use DefaultWagonManager from maven-compat-3.0.1.jar. There the implementation has changed to:

&nbsp; &nbsp; public AuthenticationInfo getAuthenticationInfo( String id ) &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; &nbsp; MavenSession session = legacySupport.getSession(); &nbsp; &nbsp; &nbsp; &nbsp; if ( session != null && id != null ) &nbsp; &nbsp; &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MavenExecutionRequest request = session.getRequest(); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ( request != null ) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; List servers = request.getServers(); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ( servers != null ) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for ( Server server : servers ) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ( id.equalsIgnoreCase( server.getId() ) ) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ... SNIP ...

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return authInfo;  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }  
&nbsp; &nbsp; &nbsp; &nbsp; }

&nbsp; &nbsp; &nbsp; &nbsp; // empty one to prevent NPE  
&nbsp; &nbsp; &nbsp; return new AuthenticationInfo();  
&nbsp; &nbsp; }

So it will always return a non null value meaning the plugin logic is broken.

---

<div class="post-metadata">

**Author:** ![nvoxland](https://avatars.discourse-cdn.com/v4/letter/n/87869e/32.png) [@nvoxland](https://forum.liquibase.org/u/nvoxland)\
**Post date:** [January 21, 2011, 7:12am UTC](https://forum.liquibase.org/t/maven-plugin-problem-with-maven-3/1082/2 "2011-01-21T07:12:00Z")

</div>

I applied patch to trunk (from you?) that should resolve this.&nbsp; It will be in the 2.0.1 release.

Nathan
