将项目打开为pom.xml时,在intellij中添加src/it/java作为测试文件夹

Jas*_*Jas 5 eclipse maven-2 intellij-idea maven

我有一个名为src/it/java的新测试程序(用于集成测试).我把它添加到我的pom.xml中(在我的简单示例应用程序中)

<build>
<plugins>
  <plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>build-helper-maven-plugin</artifactId>
    <version>1.7</version>
    <executions>
      <execution>
        <id>add-test-source</id>
        <phase>generate-test-sources</phase>
        <goals>
          <goal>add-test-source</goal>
        </goals>
        <configuration>
          <sources>
            <source>src/it/java</source>
          </sources>
        </configuration>
      </execution>
    </executions>
  </plugin>
</plugins>
Run Code Online (Sandbox Code Playgroud)

但是当我在intellij中打开我的项目(通过在intellij中打开pom.xml)时,src/it/java不会被它视为源文件夹.

我应该在我的pom.xml中放置什么才能让intellij将src/it/java识别为源文件夹

谢谢

Cra*_*der 2

对于插件配置的路径,您应该运行“生成源”和“更新文件夹”请参阅常见问题解答