【问题标题】:Hibernate 5 plugin does not consider fileName in <outputDirectory/> configurationHibernate 5 插件在 <outputDirectory/> 配置中不考虑文件名
【发布时间】:2017-11-03 11:54:26
【问题描述】:

我正在升级到 Hibernate 5 并找到了这个插件:-

              <plugin>
                    <groupId>de.jpdigital</groupId>
                    <artifactId>hibernate5-ddl-maven-plugin</artifactId>
                    <version>1.0.1-hibernate-5.1.2.Final</version>
                    <configuration>
                        <dialects>
                            <param>SQLSERVER2008</param>
                        </dialects>
                        <packages>
                            <param>com.mypackage</param>
                        </packages>
                        <outputDirectory>${project.build.directory}/hibernate-schema.sql</outputDirectory>
                    </configuration>
                    <executions>
                        <execution>
                            <goals>
                                <goal>gen-ddl</goal>
                            </goals>
                            <phase>package</phase>
                        </execution>
                    </executions>
                </plugin>

但是当我们运行它时,它不会创建名为“hibernate-schema.sql”的文件,而是将其创建为目录,文件名是方言名称“sqlserver2008.sql”。

有什么方法可以配置它来创建名为“hibernate-schema.sql”的文件。

【问题讨论】:

    标签: java hibernate maven-plugin hibernate-5.x


    【解决方案1】:

    用那个插件看起来不可能。

    documentation for the gen-ddl goal 仅显示输出目录是可配置的。

    另外,source code for the mojo 仅具有基于方言构造文件名的代码,除了输出目录之外不读取任何选项。

    您能否更改依赖于某个文件名的代码来查找方言名称?

    【讨论】:

      猜你喜欢
      • 2013-10-09
      • 2018-01-26
      • 2016-04-15
      • 2018-03-15
      • 2016-03-28
      • 2011-11-17
      • 1970-01-01
      • 2015-08-14
      • 2019-02-25
      相关资源
      最近更新 更多