On 15.07.2014 00:41, Ari King wrote:
> Thanks for the clarification and links regarding running migrations
> outside of an app jar. Have you used any of those plugins? If yes, how
> was your experience with them/it? I use gradle more so these days, so
> I'd be interested in reviews of that plugin in particular.
I've been using the Maven and Gradle plugins before and they work as
advertised.
In the context of Dropwizard I didn't like the duplication of the
database settings and credentials in the build system as neither Maven
nor Gradle support YAML for external property files. In my opinion
database migrations should always happen from within the application
itself and not at build time.
> For ad hoc trial/error tests and integration tests (usually within an
> IDE), I need to have the db schema setup, hence the need to run
> liquibase outside of an app jar.
It's relatively easy to run Liquibase migrations before a running JUnit
test in a method annotated with @BeforeClass, see [1] for an example.
If there's the need for it, you could probably also extract a JUnit Rule
[2] from it.
[1]:
http://blog.javaforge.net/post/35193958835/database-driven-unit-tests-with-liquibase
[2]:
https://github.com/junit-team/junit/wiki/Rules
Cheers,
Jochen