Setting a DB Migrator Version
The Java Stack manages the DB Migrator version automatically. Meaning, if your project inherits from stack-master, the version of DB Migrator is managed for you. Whenever you upgrade your project to inherit from the latest stack-master version, the DB Migrator version will be set to the latest version of DB Migrator (with a few exceptions - see intermediate releases section below). To upgrade a DB Migrator project that is not shared with a Java project, follow the upgrade notes paying attention to any steps related to DB Migrator. Then change the version number of stack-master in the "parent" element to the latest version.
In this example, the top-level pom.xml is set to use stack-master version 3.2.5 as it's parent, which will use DB Migrator version 4.0.10, the latest as of September 6th 2012. Check or announcement thread for the latest verison...
<parent> <groupId>org.lds.stack</groupId> <artifactId>stack-master</artifactId> <version>3.2.5</version> </parent>
If your DB module is sharing a project with the Java module, coordinate your upgrade efforts with the developers and follow all instructions in the upgrade notes.
If you have previously specified the stackDBMigrator property in your top-level or db pom.xml, remove that property.
Confirm by looking at the version number in the DB Migrator output. You can run the stack-db:status goal if you don't want any scripts to execute.
DB Migrator may have intermediate releases to make bug fixes or new functionality available before a Java Stack release. In many cases it is adequate to wait for a Stack release to get the DB Migrator changes. This is the preferred and recommended way.
However, if you need a specific version of DB Migrator you can specify that version in your pom.xml. Follow these steps to properly set the version...
- Add this property to the properties section of your top-level pom.xml changing x.x.x for the version you are targeting
- Make sure the same property is not specified in your db sub-module's POM. If it is, remove it. It will not be honored by the ALM module but will apply to other executions causing inconsistent behavior.