Thank's.
I've tried to use Ant Tasks and Maven Plugin but i've no success. So I'm using EJB3Configuration deprecated class.
Code:
public class SchemaExportUtils {
public static void export(String persistenceUnit, String exportFileName) {
Ejb3Configuration cfg = new Ejb3Configuration();
Ejb3Configuration configured = cfg.configure(persistenceUnit,
new HashMap<String, Object>());
Configuration hbmcfg = cfg.getHibernateConfiguration();
SchemaExport schemaExport = new SchemaExport(hbmcfg);
schemaExport.setOutputFile(exportFileName);
schemaExport.setFormat(false);
schemaExport.setDelimiter(";");
schemaExport.drop(true, true);
schemaExport.create(true, true);
}
}