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

Setting classpath option for the liquibase maven plugin.

$
0
0
I run liquibase both via Spring context and via the liquibase maven plugin.

When I ran via Spring context, I refer to the changelog files as:
  1. <include file="classpath:/db/changelog/db.changelog-1.0.xml"/>
If I want to run the same via plugin, I have to edit paths manually:

  1. <include file="src/main/resources/db/changelog/db.changelog-1.0.xml"/>
I'd like to offer 2 options. 
1. Add a possibility to understand the "classpath" name in the path and allow classpath setting in the plugin itself. At the moment my plugin config looks like:

  1.  <plugin>
  2.                 <groupId>org.liquibase</groupId>
  3.                 <artifactId>liquibase-maven-plugin</artifactId>
  4.                 <version>2.0.5</version>
  5.                 <configuration>
  6.                     <!--${env} is set in the app.properties file, in order to work correctly run-->
  7.                     <!--mvn initialize liquibase:updateSQL-->
  8.                     <propertyFile>src/main/resources/db/config/liquibase-gensql-data-access.properties</propertyFile>
  9.                     <changeLogFile>src/main/resources/db/changelog/db.changelog-master.xml</changeLogFile>
  10.                     <migrationSqlOutputFile>src/main/resources/db/gen/migrate.sql</migrationSqlOutputFile>
  11.                     <!--<logging>debug</logging>-->
  12.                     <logging>info</logging>
  13.                     <promptOnNonLocalDatabase>false</promptOnNonLocalDatabase>
  14.                     <!--<verbose>false</verbose>-->
  15.                     <dropFirst>true</dropFirst>
  16.                 </configuration>
  17.             </plugin>
Or, as an alternative opiton, add all maven src folders to the classpath. For example src/main/resources and src/main/java. And allow set changeLogFile, migrationSqlOutputFile and other similar options with "classpath" in the name like "classpath:/somepathtothefile"

Viewing all articles
Browse latest Browse all 2993

Trending Articles



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