我是Maven的新手。我需要生成一个更多的hibernate.cfg.xml --我不知道。在这个链接(http://mojohaus.org/hibernate3-maven-plugin)中,我不明白如何配置。有人能帮我吗?谢谢预支。
发布于 2014-02-13 11:30:50
我很抱歉耽搁了,但我有个解决办法。我有两个存档: pom.xml和build.bat (build.xml)。build.xml具有生成hibernate映射的配置。
我使用下面的命令(类似于Gilberto的例子)运行(build.xml) pom.xml。
<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>谢谢。
发布于 2014-01-31 12:59:01
使用你提到的插件,您可以在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>插件将在compile阶段之后执行。
https://stackoverflow.com/questions/21479958
复制相似问题