Domanda

I'm newbie with Maven. I need generate a hibernate.cfg.xml more I don't idea about this. In this link (http://mojohaus.org/hibernate3-maven-plugin) I don't understand how configures. Somebody can help-me? Thanks a advance.

È stato utile?

Soluzione 2

I sorry for delay, but I have a solution. I have two archive, being: pom.xml and build.bat (build.xml). The build.xml has my configuration for generate the mapping of the hibernate.

I got it run (build.xml) through of pom.xml with below command (something similar the example of the Gilberto Torrezan).

<plugin>
  <groupId>org.codehaus.mojo</groupId>
  <artifactId>exec-maven-plugin</artifactId>
  <version>1.1</version>
  <executions>
     <execution>
     <phase>generate-sources</phase>
     <goals> 
            <goal>exec</goal>
     </goals>
     </execution>
  </executions>
  <configuration>
     <executable>ant/build_hibernate.bat</executable>
   </configuration>
 </plugin>

Thanks.

Altri suggerimenti

Using the plugin you mentioned, you can set these properties in you pom.xml:

<project>
  ...
  <build>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>hibernate3-maven-plugin</artifactId>
        <version>3.0</version>
        <executions>
            <execution>
                <goal>hbm2cfgxml</goal>
            </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  ...
</project>

The plugin will be executed after the compile phase.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top