2012-08-06 3 views
0

db-unit-maven 플러그인을 사용하여 db의 일부를 내보내려고합니다. 내 구성에서 true로 설정된 정렬 된 플래그를 설정하여 무결성 제약 조건 위반을 피하기 위해 다시 가져올 수 있습니다. 또한 구성 내에서 tables 요소를 사용하여 내보낼 테이블을 지정합니다. 나는 내가하려는 일의 예 아래에 붙여 넣었다. 그러나 제약 조건과 관련없는 추가 테이블을 구성에서 수동으로 선택한 테이블로 내 보냅니다. <ordered>true</order>이 목록을 무시하게합니까? 내가 뭘 놓치고 있니?dbunit maven plugin을 true로 설정하면 테이블을 겉보기에 무시합니다.

<plugin> 
    <groupId>org.codehaus.mojo</groupId> 
    <artifactId>dbunit-maven-plugin</artifactId> 
    <version>1.0-beta-3</version> 
    <dependencies> 
     <dependency> 
      <groupId>com.oracle</groupId> 
      <artifactId>ojdbc6</artifactId> 
      <version>11.2.0.1.0</version> 
     </dependency> 
    </dependencies> 
    <configuration> 
     <driver>oracle.jdbc.OracleDriver</driver> 
     <url>${it.datasource.url}</url> 
     <username>${dbunit.username}</username> 
     <password>${dbunit.password}</password> 
     <dataTypeFactoryName>org.dbunit.ext.oracle.OracleDataTypeFactory</dataTypeFactoryName> 
     <skipOracleRecycleBinTables>true</skipOracleRecycleBinTables> 
    </configuration> 
    <executions> 
     <execution> 
      <id>execute</id> 
      <phase>package</phase> 
      <goals> 
       <goal>export</goal> 
      </goals> 
      <configuration> 
       <schema>${dbunit.username}</schema> 
       <format>xml</format> 
       <dest>target/dbunit/export.xml</dest> 
       <tables> 
        <table name="TABLE_1" /> 
        <table name="TABLE_2" /> 
       </tables> 
       <ordered>true</ordered> 
      </configuration> 
     </execution> 
    </executions> 
</plugin> 

답변

0

구문이 잘못되었습니다. 위의 붙여 넣은 원래 NullPointerException 올바른 구문을 아래에 붙여 넣기 및 내가 알 수있는 한 예상대로 작동합니다 반환합니다.

<plugin> 
    <groupId>org.codehaus.mojo</groupId> 
    <artifactId>dbunit-maven-plugin</artifactId> 
    <version>1.0-beta-3</version> 
    <dependencies> 
     <dependency> 
      <groupId>com.oracle</groupId> 
      <artifactId>ojdbc6</artifactId> 
      <version>11.2.0.1.0</version> 
     </dependency> 
    </dependencies> 
    <configuration> 
     <driver>oracle.jdbc.OracleDriver</driver> 
     <url>${it.datasource.url}</url> 
     <username>${dbunit.username}</username> 
     <password>${dbunit.password}</password> 
     <dataTypeFactoryName>org.dbunit.ext.oracle.OracleDataTypeFactory</dataTypeFactoryName> 
     <skipOracleRecycleBinTables>true</skipOracleRecycleBinTables> 
    </configuration> 
    <executions> 
     <execution> 
      <id>execute</id> 
      <phase>package</phase> 
      <goals> 
       <goal>export</goal> 
      </goals> 
      <configuration> 
       <schema>${dbunit.username}</schema> 
       <format>xml</format> 
       <dest>target/dbunit/export.xml</dest> 
       <tables> 
        <table> 
         <name>TABLE_1</name> 
        </table> 
        <table> 
         <name>TABLE_2</name> 
        </table> 
       </tables> 
       <ordered>true</ordered> 
      </configuration> 
     </execution> 
    </executions> 
</plugin>