2010-06-04 3 views
0

hibernate3-maven-plugin을 사용하여 새로운 데이터베이스에 데이터베이스 스키마를 생성하는 데 사용할 수있는 SQL 스크립트를 자동으로 생성했습니다. hbm2ddl 도구를 통해이 작업을 수행합니다. 필자는 SQL을 파일에 작성하도록 지시했을 때 SQL의 50 페이지로 된 내 maven 빌드를 어수선하게 만들지 않을 것이라고 생각했습니다. 어쨌든 콘솔에 쓰는 것을 멈추고 파일에만 쓰도록 하시겠습니까? 답변을 찾을 수 없습니다!hibernate3-maven-plugin HBM2DDL을 콘솔에서 출력하지 못하게하는 방법

답변

2

이 플러그인에 대한 설정이 추가 :

<componentProperties> 
    ... 
    <console>false</console> 
    ... 
</componentProperties> 
0
<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> 

는 "콘솔"라는 속성이있다, 당신은 단지 "거짓"

로 설정해야합니다
관련 문제