0

src/test/resources フォルダーへのアクセスが必要なテスト クラスを生成する (および src/test/java に配置する) コードを実行しようとしています。私はmaven exec:java(exec:execを試しました)も使用していますが、運がありません。

        <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/test/resources を配置する方法/場所です。これにより、TestGenerator への呼び出しのクラスパスで使用されます

ありがとう

ファン

4

1 に答える 1

-1

generate-test-sourcesおそらく、リソース プラグインがsrc/test/resourcesフォルダを にコピーする前に、非常に早い段階で とバインドしていますtarget。クラスパスを使用しようとするのではなく、TestGeneratorを指すようにします。src/test/resources

于 2012-10-03T16:15:54.893 に答える