How maven pom.xml identifies the testng test cases in a non-standard project structure?

前端 未结 1 1767
长发绾君心
长发绾君心 2021-01-23 12:10

I am completely new to maven and testng. I am using maven as build tool, and testng as my testing framework. I am not following the standard maven project structure. Now I want

相关标签:
1条回答
  • 2021-01-23 12:40

    If you keep this in a single place you need to set the testClassesDirectory argument of the maven-surefire-plugin configuration:

    <project>
      [...]
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.17</version>
            <configuration>
              <testClassesDirectory>path/to/compiled test classes</testClassesDirectory>
            </configuration>
          </plugin>
        </plugins>
      </build>
      [...]
    </project>
    

    All of this is well documented in the Maven Surefire Plugin Documentation

    0 讨论(0)
提交回复
热议问题