I am writing web application and am wondering what the recommended way is to populate initial data. This is JPA/Hibernate and Spring application and is built by maven. Up to now I've used script wich populate database with initial data, started by hand.
Unit tests work with theirs own data, created in code before each test. My test classes extends org.springframework.test.jpa.AbstractJpaTests.
Finally I'd like to have a maven build which create database form entities (now I need to run application first time to create database, then run script) then populates initial/dictionary data and run unit and integration tests. This process should be fully automated to put this build in CI server (hudson), crating new database from scratch is also appreciate.
Additional requirement: Database agnostic solution will be most valuable.
EDIT: Best example of what I'm looking for is init closure in BootStrap.groovy.