Skip to content

Adds a @AdditionalFlywayLocations annotation to support specifying additional locations through spring configuration classes

License

Notifications You must be signed in to change notification settings

gregor-rieble/spring-boot-additional-flyway-locations

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

spring-boot-additional-flyway-locations

Release Build & Deploy SNAPSHOT

Introduction

Adds an @AdditionalFlywayLocations annotation to support specifying additional flyway locations through spring configuration classes

This is mostly useful when writing custom spring boot starters that want to automatically add database initialization scripts that are bundled with the starter library.

Usage

In a custom spring boot starter project, add the following dependency to your pom.xml:

<dependency>
    <groupId>de.gcoding</groupId>
    <artifactId>spring-boot-additional-flyway-locations</artifactId>
    <version>0.0.1</version>
</dependency>

Alternatively, you can also choose to use the provided scope, if you want the user of your starter project to decide whether he wants the scripts to be loaded automatically:

<dependency>
    <groupId>de.gcoding</groupId>
    <artifactId>spring-boot-additional-flyway-locations</artifactId>
    <version>0.0.1</version>
    <scope>provided</scope>
</dependency>

Then create or use an existing spring boot class annotated with @Configuration or @AutoConfiguration and add the @AdditionalFlywayLocations annotation pointing to the flyway scripts used by your starter project:

@Configuration
@AdditionalFlywayLocations("classpath:db/my-project/migrations")
class MyStarterProjectConfiguration {
    // Additional configuration as needed
    // ...
}

Depending on your needs, don't forget to add your configuration class to the META-INF/spring.factories file to make spring boot load it automatically

About

Adds a @AdditionalFlywayLocations annotation to support specifying additional locations through spring configuration classes

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages