# Liquibase Command works in maven plugin but not jar

**URL:** <https://forum.liquibase.org/t/liquibase-command-works-in-maven-plugin-but-not-jar/5474>\
**Category:** General Discussion\
**Created:** [May 18, 2021, 3:16pm UTC](https://forum.liquibase.org/t/liquibase-command-works-in-maven-plugin-but-not-jar/5474 "2021-05-18T15:16:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jchaplin](https://avatars.discourse-cdn.com/v4/letter/j/35a633/32.png) [@jchaplin](https://forum.liquibase.org/u/jchaplin)\
**Post date:** [May 18, 2021, 3:16pm UTC](https://forum.liquibase.org/t/liquibase-command-works-in-maven-plugin-but-not-jar/5474/1 "2021-05-18T15:16:31Z")

</div>

I’m having issues with the below liquibase command while connecting to a cockroachDB:

java -cp “/path/to/my/project/\*” -Dliquibase.username=me -Djava.security.auth.login.config=/path/to/jaas.conf -Djava.security.krb5.conf=/path/to/krb5.conf -Djdk.tls.client.protocols=TLSv1.2 -Dhttp.auth.preference=Kerberos -Dsecurity.auth.useSubjectCredsOnly=false liquibase.integration.commandline.Main --defaultsFile=/path/to/liquibase.properties --changeLogFile=/path/to/main-changelog.yaml updateSQL

**Unexpected error running Liquibase: liquibase.exception.DatabaseException: liquibase.exception.DatabaseException: Connection could not be created to jdbc:postgresql://(cockroachdb-url-goes-here) with driver org.postgresql.Driver. GSS Authentication failed**

The unusal part is that the below liquiibase command through the maven plugin works.

mvn liquibase:updateSQL -Dliquibase.changeLogFile=/path/to/main-changelog.yaml -Dliquibase.username=me -Djava.security.auth.login.config=/path/to/jaas.conf -Djava.security.krb5.conf=/path/to/krb5.conf

What I’ve tried/verified:

```
1. liquibase.properties has the following properties (both commands use properties file):
	driver
	url

2. The maven plugin has the following specified in pom.xml (added via command line for standalone jar approach). 
	jdk.tls.client.protocols=TLSv1.2 
	http.auth.preference=Kerberos	
	security.auth.useSubjectCredsOnly=false

3. I've put the following jars in /path/to/my/project/ (they are the same ones used by maven-plugin).
	liquibase-core-4.3.3.jar 
	postgresql-42.2.19.jar
	snakeyaml-1.19.jar

```

Has anyone faced this issue? Any general tips for trouble shooting? Why would the plugin work and not the standalone jar?

---

<div class="post-metadata">

**Author:** ![ronak](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.liquibase.org/ronak/32/221_2.png) [@ronak](https://forum.liquibase.org/u/ronak)\
**Post date:** [May 21, 2021, 1:47pm UTC](https://forum.liquibase.org/t/liquibase-command-works-in-maven-plugin-but-not-jar/5474/2 "2021-05-21T13:47:41Z")

</div>

Hi @jchaplin ,

May we see the complete log (logLevel=debug) from command line and maven? Looking for context on what Liquibase tried to do or not do in opening the connection.

For the commandline, I noticed you are calling updateSQL, were you running it against a database that has had a successful liquibase update? (I know you mentioned maven works, but not sure if the db persists or it is created for the first time fresh before you run the updateSQL).

Thanks,

Ronak

---

<div class="post-metadata">

**Author:** ![jchaplin](https://avatars.discourse-cdn.com/v4/letter/j/35a633/32.png) [@jchaplin](https://forum.liquibase.org/u/jchaplin)\
**Post date:** [May 21, 2021, 2:26pm UTC](https://forum.liquibase.org/t/liquibase-command-works-in-maven-plugin-but-not-jar/5474/3 "2021-05-21T14:26:08Z")

</div>

Hi Ronak,

Thank you for your reply. We’ve resolved this issue. In short, we had to add user as a parameter to the database connection string (see example below).

For some reason this only impacts the standalone jar case and not the maven plugin. For what it’s worth, I’m using version 4.3.3 of the liquibase core jar for standalone case and version 4.3.2 of the maven plugin.

jdbc:postgresql://database.url.goeshere/myschema?myparm1=value1&myparam2=value2& **user=myuserid**
