You need to bind the execution of the hbm2ddl
goal to a maven lifecycle phase. You could bind to install
phase, but in case of ddl generation I'd recommend generate-sources
phase (this will allow you to package generated ddl in built artifact before install if required).
eg add like
<executions>
<execution>
<id>execute-hbm2ddl</id>
<phase>generate-sources</phase>
<goals>
<goal>hbm2ddl</goal>
</goals>
... <!-- configuration here -->
</execution>
</executions>
to get
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>hibernate3-maven-plugin</artifactId>
<version>2.2</version>
<executions>
<execution>
<id>execute-hbm2ddl</id>
<phase>generate-sources</phase>
<goals>
<goal>hbm2ddl</goal>
</goals>
<configuration>
<components>
<component>
<name>hbm2ddl</name>
<implementation>jpaconfiguration</implementation>
</component>
</components>
<componentProperties>
<persistenceunit>Default</persistenceunit>
<outputfilename>schema.ddl</outputfilename>
<drop>false</drop>
<create>true</create>
<export>false</export>
<format>true</format>
</componentProperties>
</configuration>
</execution>
</executions>
</plugin>