Changelog parameters

Hi Nathan,

A while ago I worked with you to get changelog parameters to work with ant:
http://comments.gmane.org/gmane.comp.db.liquibase.user/476
http://www.mail-archive.com/liquibase-user@lists.sourceforge.net/msg00459.html

Well, I am at a new company and I have the same need for a maven implementation.  Preliminary info:
-  Maven plugin version 1.9.5.0
-  Using property filtering (i.e. maven profiles).  We have multiple environments and need to replace the values in the liquibase.properties file ala http://stackoverflow.com/questions/1149352/using-maven-for-multiple-deployment-environment-production-development (the post by Mike Cornell)
-  I have custom properties in the liquibase.properties file
schema.name
tablespace.data
tablespace.index

Running liquibase through maven just ignores these properties.  Here is the relevant output:
[INFO] Parsing Liquibase Properties File
[INFO]  File: target/classes/liquibase.properties
[INFO]  ‘tablespace.index’ in properties file is not being used by this task.
[INFO]  ‘tablespace.data’ in properties file is not being used by this task.
[INFO]  ‘schema.name’ in properties file is not being used by this task.

So, the plugin is skipping my custom properties.  How can I get these to be recognized by the plugin or have an alternative way to include custom properties?

Cheers,
JF

Hi Nathan,

Do you need some more information from me on this topic?

Cheers,
JF

No, I just haven’t gotten a chance to look at it yet, sorry.  I should have a chance later tonight or tomorrow.  You could try the newest 2.0 RC, too.  It has a lot of bug fixes in it.

Nathan

I am struggling with the same problem.

What does your liquibase xml look like?

Best regards /Lasse

Hi,

I got my thing to work. I do not know if you have the same scenario.

I was defining the url parameter in the properties file like this

    url: jdbc:oracle:thin:@server:port:database

I changed this so that the url is now defined in settings.xml like this

    jdbc:oracle:thin:@server:port:database

and liquibase.properties like this

    url: ${db.url}

Now the maven filtering works. So for me it was not a liquibase problem, rather maven.
It seems that it’s the @ in the database url that bugged me. Maybe that’s not your problem but…

Best regards
/Lasse

Also, what does your maven pom.xml look like?  I’m new to maven, so any suggestions others have would be great too.

Nathan

I will provide that on Monday. Now, weekend!

Have a nice one!

Best regards /Lasse

@JF

I have a solution similar to what you have mentioned above and the liquibase-maven-plugin version used is 2.0.1.
Unfortunately I’m having the same issue you faced when passing values to custom properties through liquibase.properties file.

Were you able to find a solution for this? Appreciate your help in this!

ok … found a solution to my root issue, but not for the issue of passing values to changelog parameters through maven or -D statements.

what i wanted was to pick data types based on dbms type (hsql, mysql, oracle) and my initial changelog statements looks like this.

   
   

But my idea of having a default value and then overriding that value with a dbms specific same name property does not work. By simply having all dbms specific properties, this issue was solve.