How to properly set up Liquibase pro licence key with Spring + Unable to resolve xml entity http://www.liquibase.org/xml/ns/pro/liquibase-pro-latest.xsd

Hello,

I have a Spring project using an existing Oracle DB.
To set up Liquibase for my DB: I add liquibase in my pom.xml:

<dependency>
     <groupId>org.liquibase</groupId>
     <artifactId>liquibase-core</artifactId>
     <version>4.18.0</version>
</dependency>

A liquibase bean is declare in my application-context.xml:

<bean id="liquibase" class="liquibase.integration.spring.SpringLiquibase">
	<property name="dataSource" ref="dataSource" />
 	<property name="changeLog" value="classpath:liquibase/master.xml" />
</bean>

My liquibase.properties file is placed in src/ressources

changeLogFile=liquibase/master.xml
liquibase.command.url=jdbc:oracle:thin:@localhost:1521/orcl
liquibase.command.username: admin
liquibase.command.password: admin
liquibase.command.referenceUrl: jdbc:oracle:thin:@localhost:1521/orcl
liquibase.command.referenceUsername: admin
liquibase.command.referencePassword: admin
liquibase.licenseKey: <my pro licence key>

when I compile my application, I have an error:

liquibase.parser.core.xml.XSDLookUpException: Unable to resolve xml entity http://www.liquibase.org/xml/ns/pro/liquibase-pro-latest.xsd. liquibase.secureParsing is set to ‘true’ which does not allow remote lookups. Check for spelling or capitalization errors and missing extensions such as liquibase-commercial in your XSD definition. Or, set it to ‘false’ to allow remote lookups of xsd files.

Has anyone encountered this problem? How should I resolve it and properly configured Liquibase for my application?

Hello @thutran.
The error message indicates that the “liquibase.secureParsing” option is “true”, which means Liquibase will not access the network to retrieve the XSD. However, since the XSD is included in the liquibase-commercial jar as part of Liquibase Pro, you can add it as a dependency to your POM:

<dependency>
     <groupId>org.liquibase</groupId>
     <artifactId>liquibase-commercial</artifactId>
     <version>4.18.0</version>
</dependency>

The alternative is to set “liquibase.secureParsing” in liquibase.properties to “false”. Note that the machine must be connected to the internet to retrieve the XSD if this property is set to false.

Hope this helps.

Thank you a lot for your answer! Adding the dependency works well to resolve the error of xsd.

Now my bigger problem is that liquibase.properties file is not properly loaded: the alternative of setting “liquibase.secureParsing” to false does not work and the pro license key is not recognised. Simply placing the liquibase.properties file in src/ressources may be is not enough.

Change Type 'pro:createPackageBody' is not allowed without a valid Liquibase Pro License.
To purchase or renew a Liquibase Pro license key, please contact sales@liquibase.com or
go to https://www.liquibase.com/pricing

Could you tell me what I should add to properly configure Liquibase in my Spring app? (It’s a legacy app so unfortunately I can not use Spring boot)