Reputation: 51
Could someone please help me convert the ANT scripts in
http://static.springsource.org/docs/Spring-MVC-step-by-step/part5.html
into MVN?
I'm confused do I still have to make .bat files if I'm manually placing the hsqldb into my pom.xml dependency?
Plus can someone please provide specific samples? Since http://mojo.codehaus.org/sql-maven-plugin/usage.html provides no such thing
Thanks :)
Upvotes: 0
Views: 2403
Reputation: 11
Okay I've managed to get chapter 5 done. In your src/test/resources folder place copies of the following files (from previous chapters and this one):
Now these files are on the classpath so we don't have to worry about making them fully qualified.
Instead of creating the ant scripts for creating and populating the database I simply called the create_products.sql
script in the onSetUpInTransaction()
method of the JdbcProductDaoTests
class.
@Override
protected void onSetUpInTransaction() throws Exception{
super.executeSqlScript("classpath:create_products.sql", true);
super.deleteFromTables(new String[] {"products"});
super.executeSqlScript("classpath:load_data.sql", true);
}
In the jdbc.properties under the jdbc.url property set to jdbc:hsqldb:filename;shutdown=true;
After doing this my tests run and I don't have to start the db via the command prompt, I've found filename.script filename.properties for the database but I'm not sure where it is actually storing the data after I insert it to the database.
I guess this is something I can worry about in the next chapter?
Hope this helps.
Upvotes: 1
Reputation: 15204
I hope these links from Spring's developers help you to porting sample project from Ant to Maven (but these articles about Spring 3):
Upvotes: 3