自动将其他源目录添加到maven项目的eclipse构建路径

时间:2016-02-08 16:57:19

标签: java eclipse maven maven-3

我有一个符合标准maven目录结构的maven项目,它在src / test / java目录中有许多单元和集成测试。我想

  • 另一个源目录(src / integration-test / java)
  • Eclipse会自动实现这个额外的目录(如果可能)
  • 由surefire运行的单元测试,由failsafe运行的集成测试

我尝试过使用build-helper-maven-plugin的每一种方式,但是eclipse似乎仍然没有在构建路径上看到新目录。

    <plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>build-helper-maven-plugin</artifactId>
    <version>1.10</version>
    <executions>
        <execution>
            <id>add-source</id>
            <phase>generate-sources</phase>
            <goals>
                <goal>add-source</goal>
            </goals>
            <configuration>
                <sources>
                    <source>src/integration-test/java</source>
                </sources>
            </configuration>
        </execution>
    </executions>
</plugin>

0 个答案:

没有答案
相关问题