# Run Migrator pulling changelogs from a .JAR file (Spring boot)

**URL:** <https://forum.liquibase.org/t/run-migrator-pulling-changelogs-from-a-jar-file-spring-boot/3323>\
**Category:** General Discussion\
**Created:** [February 10, 2016, 5:55pm UTC](https://forum.liquibase.org/t/run-migrator-pulling-changelogs-from-a-jar-file-spring-boot/3323 "2016-02-10T17:55:00Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![varelasavela](https://avatars.discourse-cdn.com/v4/letter/v/f14d63/32.png) [@varelasavela](https://forum.liquibase.org/u/varelasavela)\
**Post date:** [February 10, 2016, 5:55pm UTC](https://forum.liquibase.org/t/run-migrator-pulling-changelogs-from-a-jar-file-spring-boot/3323/1 "2016-02-10T17:55:00Z")

</div>

Hi,&nbsp;

I have Spring boot Jar application with changelogs inside the jar.

I want to run updateSQL command with command line.

Is it possible?

Thx

---

<div class="post-metadata">

**Author:** ![un1382561729492r88id](https://avatars.discourse-cdn.com/v4/letter/u/c4cdca/32.png) [@un1382561729492r88id](https://forum.liquibase.org/u/un1382561729492r88id)\
**Post date:** [February 10, 2016, 5:55pm UTC](https://forum.liquibase.org/t/run-migrator-pulling-changelogs-from-a-jar-file-spring-boot/3323/2 "2016-02-10T17:55:00Z")

</div>

I believe this is possible, but I am not certain of the exact commands and where in the jar file the changelogs should be located. It would most likely involve listing the jar with the changelogs as part of the classpath.

Steve Donie  
Principal Software Engineer  
Datical, Inc. [http://www.datical.com/](http://www.datical.com/)

---

<div class="post-metadata">

**Author:** ![un1382561729492r88id](https://avatars.discourse-cdn.com/v4/letter/u/c4cdca/32.png) [@un1382561729492r88id](https://forum.liquibase.org/u/un1382561729492r88id)\
**Post date:** [February 10, 2016, 5:55pm UTC](https://forum.liquibase.org/t/run-migrator-pulling-changelogs-from-a-jar-file-spring-boot/3323/3 "2016-02-10T17:55:00Z")

</div>

Excellent - seeing what you actually did and what errors happened is super helpful.&nbsp;

The problem you are habing now is because the mysql driver jar is not on the classpath. You would need to do something like this:

java -jar liquibase.jar --driver=com.mysql.jdbc.Driver --classpath=myapplication.jar; **mysqldriver.jar** --changeLogFile=/liquibase/current-changelog.xml &nbsp;--url=jdbc:mysql://localhost/liquibase --username=root --password=root updateSQL \> /tmp/script.sql

Inside your myapplication.jar, I think you would need to have (root)/liquibase/current-changelog.xml

Solving the first problem will get you further and may reveal other issues.&nbsp;

Steve Donie Principal Software Engineer Datical, Inc. [http://www.datical.com/](http://www.datical.com/)

---

<div class="post-metadata">

**Author:** ![un1382561729492r88id](https://avatars.discourse-cdn.com/v4/letter/u/c4cdca/32.png) [@un1382561729492r88id](https://forum.liquibase.org/u/un1382561729492r88id)\
**Post date:** [February 10, 2016, 5:55pm UTC](https://forum.liquibase.org/t/run-migrator-pulling-changelogs-from-a-jar-file-spring-boot/3323/4 "2016-02-10T17:55:00Z")

</div>

Can you show me the command that you used? In general, whenever reporting a problem, you should always include three things:

1. This is what I did

2. This is what actually happened

3. This is what I expected to happen

“It doesn’t work” isn’t super helpful, because I don’t know what “It” is.

In this case, if “It” is the exact command I gave you, then the problem could be the separator used in that command - rather than a semicolon, it might need to be a colon (if you are on unix-like OS).&nbsp;

Steve Donie  
Principal Software Engineer  
Datical, Inc. [http://www.datical.com/](http://www.datical.com/)

---

<div class="post-metadata">

**Author:** ![un1416214967681r32id](https://avatars.discourse-cdn.com/v4/letter/u/a698b9/32.png) [@un1416214967681r32id](https://forum.liquibase.org/u/un1416214967681r32id)\
**Post date:** [February 10, 2016, 5:55pm UTC](https://forum.liquibase.org/t/run-migrator-pulling-changelogs-from-a-jar-file-spring-boot/3323/5 "2016-02-10T17:55:00Z")

</div>

I tried the following :

java -jar liquibase.jar --driver=com.mysql.jdbc.Driver --classpath=myapplication.jar --changeLogFile=/liquibase/current-changelog.xml &nbsp;--url=jdbc:mysql://localhost/liquibase --username=root --password=root updateSQL \> /tmp/script.sql

And I got the error :

Cannot find database driver: com.mysql.jdbc.Driver

---

<div class="post-metadata">

**Author:** ![un1416214967681r32id](https://avatars.discourse-cdn.com/v4/letter/u/a698b9/32.png) [@un1416214967681r32id](https://forum.liquibase.org/u/un1416214967681r32id)\
**Post date:** [February 10, 2016, 5:55pm UTC](https://forum.liquibase.org/t/run-migrator-pulling-changelogs-from-a-jar-file-spring-boot/3323/6 "2016-02-10T17:55:00Z")

</div>

Hi Steve

It doesn’t work

I got :

mysql-connector-java-5.1.34.jar: command not found

Any ideas?

---

<div class="post-metadata">

**Author:** ![un1416214967681r32id](https://avatars.discourse-cdn.com/v4/letter/u/a698b9/32.png) [@un1416214967681r32id](https://forum.liquibase.org/u/un1416214967681r32id)\
**Post date:** [February 10, 2016, 5:55pm UTC](https://forum.liquibase.org/t/run-migrator-pulling-changelogs-from-a-jar-file-spring-boot/3323/7 "2016-02-10T17:55:00Z")

</div>

Hi Steve,

Now It works with :

java -jar liquibase.jar --driver=com.mysql.jdbc.Driver --classpath=myapplication.jar: **mysqldriver.jar** &nbsp;--changeLogFile=/liquibase/current-changelog.xml &nbsp;--url=jdbc:mysql://localhost/liquibase --username=root --password=root updateSQL \> /tmp/script.sql

Thx a lot
