Migrating Add-On without data model to Jmix 1.5.0

I’m trying to start migration of add-ons from Jmix 1.4.4 to 1.5.0.

That first add-on does neither define any entities nor it contains screens or a menu. Compiling works fine but running the contextLoad test fails because some liquibase resource is expected.

I tried to create a completely new add-on (without adding entities, screens/views) and the same happens. The newly created add-on contains a standard liquibase root file but the test also fails.

The migration notes telling about a new property main.liquibase.change-log for application.properties - not for module.properties.

What is the correct migration path for non-entity add-ons?


contextLoads() FAILED
    java.lang.IllegalStateException: Failed to load ApplicationContext
        at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:98)
...
Caused by:
        org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jmix_Liquibase' defined in class path resource [io/jmix/autoconfigure/data/JmixLiquibaseAutoConfiguration.class]: Invocation of init method failed; nested exception is liquibase.exception.UnknownChangelogFormatException: Cannot find parser that supports
            at app//org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1804)
...
Caused by:
            liquibase.exception.UnknownChangelogFormatException: Cannot find parser that supports
                at app//liquibase.parser.ChangeLogParserFactory.getParser(ChangeLogParserFactory.java:55)
                at app//liquibase.Liquibase.getDatabaseChangeLog(Liquibase.java:368)
                at app//liquibase.Liquibase.lambda$update$1(Liquibase.java:224)
                at app//liquibase.Scope.lambda$child$0(Scope.java:180)
                at app//liquibase.Scope.child(Scope.java:189)
                at app//liquibase.Scope.child(Scope.java:179)
                at app//liquibase.Scope.child(Scope.java:158)
                at app//liquibase.Liquibase.runInScope(Liquibase.java:2405)
                at app//liquibase.Liquibase.update(Liquibase.java:211)
                at app//liquibase.Liquibase.update(Liquibase.java:197)
                at app//liquibase.integration.spring.SpringLiquibase.performUpdate(SpringLiquibase.java:314)
                at app//liquibase.integration.spring.SpringLiquibase.afterPropertiesSet(SpringLiquibase.java:269)
                at app//org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1863)
                at app//org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1800)
                ... 104 more

P.S. I managed to pass the test by adding the resource path to the quite empty change-log root file in the module property file but I still wonder, if that is the correct migration path for an add-on without entities.

  1. module.properties:
main.liquibase.change-log=com/company/jmix/addon/core/liquibase/changelog.xml
jmix.core.availableLocales=de,de_DE,en,en_US
  1. liquibase/changelog.xml:
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog
        xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
                      http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.8.xsd">
    <!-- DO NOT REMOVE. This is a master changelog that runs all other changelogs. -->
    <include file="/io/jmix/data/liquibase/changelog.xml"/>
    <includeAll path="/com/company/jmix/addon/jmix/core/liquibase/changelog"/>
</databaseChangeLog>
  1. empty directory: liquibase/changelog
1 Like

Hi,

Templates for the new add-on will be fixed in the upcoming 1.5.1 release. Here is the issue: Default test in add-on fails because of invalid Liquibase configuration · Issue #1533 · jmix-framework/jmix · GitHub

In your existing add-on you can create a special properties file for tests, e.g. test-app.properties:

main.liquibase.change-log=com/company/flowtest2/liquibase/changelog.xml

Then in the Configuration class used by tests add the following class annotation:

@PropertySource("classpath:/com/company/flowtest2/test-app.properties")