2012-10-03 34 views
0

我想執行一些代碼,它將生成一個需要訪問src的測試類(並放置在src/test/java中)/test/resources文件夾。我使用maven exec:java(嘗試exec:exec),但是沒有運氣。在使用maven exec時將src/test/resources添加到類路徑中:java

 <plugin> 
      <groupId>org.codehaus.mojo</groupId> 
      <artifactId>exec-maven-plugin</artifactId> 
      <executions> 
       <execution> 
        <id>Generate Derivation Test Cases Test</id> 
        <phase>generate-test-sources</phase> 
        <goals> 
         <goal>java</goal> 
        </goals> 
        <configuration> 
         <classpathScope>test</classpathScope> 
         <mainClass>com.etse.persistence.derivationtestcase.TestGenerator</mainClass> 
         <arguments> 
          <argument>derivationTestCases</argument> 
          <argument>/common-application-context.xml</argument> 
          <argument>/persistence-application-context.xml</argument> 
          <argument>/math-application-context.xml</argument> 
          <argument>/persistence-derivationtestcase-context.xml</argument> 
         </arguments> 
        </configuration> 
       </execution> 
      </executions> 
     </plugin> 

我在這裏的問題是如何/我在哪裏放置{BASEDIR}/src目錄/測試/資源,以便在classpath用於調用TestGenerator

感謝

胡安

回答

0

您很早就與generate-test-sources綁定,可能在資源插件可以將src/test/resources文件夾複製到target之前。我會嘗試將TestGenerator指向src/test/resources,而不是嘗試使用類路徑。

相關問題