Quantcast
Channel: Liquibase Forums
Viewing all articles
Browse latest Browse all 2993

includeAll not working for multimodule project with spring

$
0
0
As in title. If i place changelogs in module different than the one launched with application context includeAll is not working when i run application from jar file. Everything works fine if i run application normally (by maven command not jar file). Or put chagelogs in module with spring application context.


Module2 is starting module with application context, i'm using spring boot for running application. Module1 is child of module2 in other words module2 includes the first one. I'm using most recent version of liquibase core namely 3.4.2

Here is application context
  1. <bean id="liquibase" class="liquibase.integration.spring.SpringLiquibase">
    <property name="dataSource" ref="dataSource"/>
    <property name="changeLog" value="classpath:db-changelog.xml" />
    </bean>

And master changelog

Maybe I would explain it better by directory structure.

 Not working directory structure
      .
      ├── Module1
      │   ├── src
      │   │   └── main
      │   │       └── resources
      │   │           ├── db-changelog.xml
      │   │           └── sql
      │   │               ├── 001-test.sql
      │   │               └── 002-test.sql
      │   └── target
      │       ├── classes
      │       │   ├── db-changelog.xml
      │       │   └── sql
      │       │       ├── 001-test.sql
      │       │       └── 002-test.sql
      │       └── Module1-1.0-SNAPSHOT.jar
      |
      └─ Module2
         ├── src
         │   └── main
         │       └── resources
         │           ├── applicationContext.xml
         │           └── mybatis-config.xml
         └── target
             ├── classes
             │   ├── applicationContext.xml
             │   └── mybatis-config.xml
             └── Module2-1.0-SNAPSHOT.jar
   
INFO 30.11.15 01:05: liquibase: Successfully acquired change log lock
WARNING 30.11.15 01:05: liquibase: included file classpath:db-changelog.xml/ is not a recognized file type
Working
   
      .
      ├── Module1
      │   ├── src
      │   │   └── main
      │   │       └── resources
      │   └── target
      │       ├── classes
      │       │   ── oceniarka
│   └── Module1-1.0-SNAPSHOT.jar │ └── Module2    ├── src    │   └── main    │      └── resources    │      ├── applicationContext.xml    │      ├── db-changelog.xml    │      ├── mybatis-config.xml    │      └── sql    │      ├── 001-test.sql    │          └── 002-test.sql    └── target    ├── classes    │   ├── applicationContext.xml    │   ├── db-changelog.xml    │   ├── mybatis-config.xml    │   └── sql    │   ├── 001-test.sql    │   └── 002-test.sql    └── Module2-1.0-SNAPSHOT.jar
INFO 30.11.15 01:14: liquibase: Successfully acquired change log lock
WARNING 30.11.15 01:14: liquibase: included file classpath:db-changelog.xml/ is not a recognized file type
INFO 30.11.15 01:14: liquibase: Reading from oceniarka.DATABASECHANGELOG
INFO 30.11.15 01:14: liquibase: classpath:db-changelog.xml: sql/002-test.sql::raw::includeAll: Custom SQL executed
INFO 30.11.15 01:14: liquibase: classpath:db-changelog.xml: sql/002-test.sql::raw::includeAll: ChangeSet sql/003-test.sql::raw::includeAll ran successfully in 17ms

This happens for reading sql or xml files both. Problem exists only for running application from jar. I would classify this as a bug because spring properly recognize db-changelog.xml in other module, but master changelog cannot reference sql directory with "include all". I think this is happens because liquibase use some module relative variable for recognizing path.Referencing files from another module by including one-by-one ("include file" instead "includeAll") works fine. I would be very grateful for fixing the bug or some workaround. Also sorry for my english and formatting (it looks like i seriously messed up something in html  ).

Viewing all articles
Browse latest Browse all 2993

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>