문제

I used the hibernate3-maven-plugin to automatically create a SQL script I can use to create a database schema in a new database. I do this via the hbm2ddl tool. I thought that when I instructed it to write the SQL to a file it would stop cluttering up my maven builds with 50 pages of SQL. Anyway to make it stop writing to the console and only write to the file? Can't find the answer!

도움이 되었습니까?

해결책

Add this to the config for this plugin:

<componentProperties>
  ...
  <console>false</console>
  ...
</componentProperties>

다른 팁

<plugin>
            <!-- run "mvn hibernate3:hbm2ddl" to generate a schema -->
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>hibernate3-maven-plugin</artifactId>
            <version>3.0</version>
            <executions>
                <execution>
                    <id>create-schema</id>
                    <phase>process-test-resources</phase>
                    <goals>
                        <goal>run</goal>
                    </goals>
                    <configuration>
                        <hibernatetool>
                            <classpath>
                                <path location="${project.build.directory}/classes" />
                                <path location="${project.basedir}/src/main/resources" />
                            </classpath>

                            <configuration configurationfile="${project.basedir}/src/main/resources/hibernate.cfg.xml"></configuration>
                            <hbm2ddl create="true" export="false" console="false" destdir="${project.basedir}/target" drop="true" outputfilename="mysql.sql" format="true" />
                        </hibernatetool>
                    </configuration>
                </execution>
            </executions>
        </plugin>

There is a property called "console", you just need to set it as "false"

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top