title: generate hibernate dao and ddl with maven plugin
body: <p>I am setting up a project that uses hibernate, and I am writing the classes and adding annotations to avoid writing .hbm.xml files. I am also trying to use maven hibernate3 plugin specifically hbm2dao and hbm2ddl for dao and database creation but I get the error     </p>
  
  <p><code>failed: Unable to load class declared as &lt;mapping class=package.ClassName.....</code></p>
  
  <p>hibernate.cfg.xml follows:</p>
  
  <pre><code>&lt;hibernate-configuration&gt;
      &lt;session-factory name="jndi/composite/SessionFactory"&gt;
          &lt;property name="hibernate.c3p0.max_size"&gt;20&lt;/property&gt;
          &lt;property name="hibernate.c3p0.max_statements"&gt;50&lt;/property&gt;
          &lt;property name="hibernate.c3p0.min_size"&gt;5&lt;/property&gt;
          &lt;property name="hibernate.c3p0.timeout"&gt;1800&lt;/property&gt;
          &lt;property name="hibernate.connection.autocommit"&gt;false&lt;/property&gt;
          &lt;property name="hibernate.connection.driver_class"&gt;com.mysql.jdbc.Driver&lt;/property&gt;
          &lt;property name="hibernate.connection.password"&gt;PASS&lt;/property&gt;
          &lt;property name="hibernate.connection.url"&gt;jdbc:mysql://localhost/DATABASE&lt;/property&gt;
          &lt;property name="hibernate.connection.username"&gt;USER&lt;/property&gt;
          &lt;property name="hibernate.current_session_context_class"&gt;thread&lt;/property&gt;
          &lt;property name="hibernate.dialect"&gt;org.hibernate.dialect.MySQLDialect&lt;/property&gt;
          &lt;property name="hibernate.show_sql"&gt;true&lt;/property&gt;
          &lt;property name="hibernate.transaction.factory_class"&gt;org.hibernate.transaction.JDBCTransactionFactory    &lt;/property&gt;
          &lt;property name="hibernate.use_sql_comments"&gt;true&lt;/property&gt;
          &lt;mapping class="package.....models.User"/&gt;
      &lt;/session-factory&gt;
  &lt;/hibernate-configuration&gt;
  </code></pre>
  
  <p>configuration for the plugin on pom.xml</p>
  
  <pre><code>&lt;configuration&gt;
      &lt;components&gt;            
          &lt;component&gt;
              &lt;name&gt;hbm2dao&lt;/name&gt;
              &lt;implementation&gt;annotationconfiguration&lt;/implementation&gt;
              &lt;outputDirectory&gt;target/generated-sources/hibernate3&lt;/outputDirectory&gt;
          &lt;/component&gt;
      &lt;/components&gt;
      &lt;componentProperties&gt;
          &lt;jdk5&gt;true&lt;/jdk5&gt;
          &lt;ejb3&gt;false&lt;/ejb3&gt;
          &lt;packagename&gt;package......models&lt;/packagename&gt;
          &lt;format&gt;true&lt;/format&gt;
          &lt;haltonerror&gt;true&lt;/haltonerror&gt;
          &lt;scan-classes&gt;true&lt;/scan-classes&gt;
      &lt;/componentProperties&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>Any info that I may be forgetting just ask, thanks.</p>