# Create spring-boot starter

**URL:** <https://forum.liquibase.org/t/create-spring-boot-starter/5577>\
**Category:** Liquibase Development\
**Created:** [June 10, 2021, 12:38pm UTC](https://forum.liquibase.org/t/create-spring-boot-starter/5577 "2021-06-10T12:38:14Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![hohwille](https://avatars.discourse-cdn.com/v4/letter/h/7feea3/32.png) [@hohwille](https://forum.liquibase.org/u/hohwille)\
**Post date:** [June 10, 2021, 12:38pm UTC](https://forum.liquibase.org/t/create-spring-boot-starter/5577/1 "2021-06-10T12:38:14Z")

</div>

Hi there,  
I am used to flyway and wanted to test liquibase as an alternative. In devon4j ([https://devonfw.com](https://devonfw.com)) we also provide full solutions to build apps and IT landscapes following best practices and therefore are about to support liquibase alongside flyway.

With flyway I observed that it has spring-boot integration out of the box:  
You only need to have flyway on your classpath and it is automatically configured in spring-boot.

With liquibase this is however not the case. I researched and found this documentations:  
[https://docs.liquibase.com/tools-integrations/springboot/home.html](https://docs.liquibase.com/tools-integrations/springboot/home.html)

Studying those gives me the impression that this is rather outdated from my PoV as nobody is using spring XML config anymore with spring-boot.

What I am therefore wondering is: Why dont you simply provide a spring-boot-starter-liquibase that projects could add as a dependency to get both the classic liquibase dependency as well as the autoconfiguration and ingeration into spring-boot via spring.factories?  
IMHO this would be a nice improvement to liquibase that can be done extremely easy.

WDYT? I am happy to assist in case you may not be familiar with the details how to build spring-boot starters.

Cheers  
Jörg

---

<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:** [June 18, 2021, 2:52am UTC](https://forum.liquibase.org/t/create-spring-boot-starter/5577/2 "2021-06-18T02:52:31Z")

</div>

The liquibase spring integration works the same as the Flyway version: you simply add Liquibase to the classpath. The [start.spring.io](http://start.spring.io) setup in [Using Liquibase with Spring Boot](https://docs.liquibase.com/tools-integrations/springboot/springboot.html) does that for you in the spring style you need.

The XML example on that page is for the Liquibase changelog which can be in xml, yaml, json, or sql depending on your preference.

Are you having troubles getting it working?

Nathan

---

<div class="post-metadata">

**Author:** ![hohwille](https://avatars.discourse-cdn.com/v4/letter/h/7feea3/32.png) [@hohwille](https://forum.liquibase.org/u/hohwille)\
**Post date:** [June 18, 2021, 9:00am UTC](https://forum.liquibase.org/t/create-spring-boot-starter/5577/3 "2021-06-18T09:00:23Z")

</div>

Hi Nathan,  
thanks for your answer.  
I was referring to XML like that looks pretty much like spring-xml:

```auto
                   <bean id="liquibase" class="liquibase.integration.spring.SpringLiquibase">  

```

When we have this dependency together with spring-boot:

```auto
<dependency>
      <groupId>org.liquibase</groupId>
      <artifactId>liquibase-core</artifactId>
<dependency>

```

We are unable to access liquibase via dependency-injection as it does not seem to be in the spring-context as a “spring-bean”. This works fine for flyway OOTB.

In devon4j we want to add liquibase support but still face such issues:

> <https://github.com/devonfw/devon4j/pull/340>
>
> I have resolved the issue(i.e. Consider liquibase #303). In that I have changed …the configuration of flyway into liquibase.

Kind regards  
Jörg

---

<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:** [June 21, 2021, 4:30pm UTC](https://forum.liquibase.org/t/create-spring-boot-starter/5577/4 "2021-06-21T16:30:34Z")

</div>

Sorry for the slow responses. Was traveling last week…

Looking at the PR you have in devon4j, what is the problem part you are hitting? There’s a lot in there and I’m not sure what is expected code changes and what is unexpected.

Nathan

---

<div class="post-metadata">

**Author:** ![hohwille](https://avatars.discourse-cdn.com/v4/letter/h/7feea3/32.png) [@hohwille](https://forum.liquibase.org/u/hohwille)\
**Post date:** [June 24, 2021, 11:02am UTC](https://forum.liquibase.org/t/create-spring-boot-starter/5577/5 "2021-06-24T11:02:15Z")

</div>

Hi Nathan,  
as written above:  
The problem is that liquibase (liquibase.Liquibase) is not available as spring-bean for injection. We need this e.g. in JUnits to reset DB and avoid side-effects from previous runs.  
This works for flyway (that we can simply receive via “@Inject Flyway flyway”) but not for liquibase ("@Inject Liquibase liquibase" is giving us UnsatisfiedDependencyException).

Any hints or suggestions how to make it work with liquibase?

Thanks  
Jörg

---

<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:** [June 30, 2021, 4:12pm UTC](https://forum.liquibase.org/t/create-spring-boot-starter/5577/6 "2021-06-30T16:12:12Z")

</div>

That liquibase dependency you add should be all you need to do. I’ve seen it working before just fine without needing to specify the bean in a spring xml file.

What version of liquibase is getting included in your project? Perhaps a different dependency is keeping it at strangely old version?
