I am using middlegen and hibernate to generate hbm.xml files and java files from an existing database. My ant script runs middlegen and all the output files from that process are written to the build dir. Consequently an "ant clean" will remove all that generated code. I would like to keep this behaviour as that is what you would expect a clean to do. What I want to do is skip the middlgen target if the database has not changed. Any suggestions on how to do this? I have looked at the ant "uptodate" task but I can't see how to effectively use that. I noticed in the example above there is a unless="middlegen.skip" and thought maybe you have figured out a way to do what I want to do. Thanks for any input. Craig Duncan