Maven Failsafe没有运行任何测试

时间:2018-04-24 20:44:02

标签: maven

使用root pom.xml的Mutimodule项目:

            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>${surefire.failsafe.version}</version>
                <executions>
                    <execution>
                        <id>integration-test</id>
                        <goals>
                            <goal>integration-test</goal>
                            <goal>verify</goal>
                        </goals>
                        <configuration>
                            <includes>
                                <include>**/**IT*.java</include>
                            </includes>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
        </pluginManagement>
   </build>

并在子项目中:

                <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>${surefire.failsafe.version}</version>
            </plugin>
        </plugins>
    </build>
    </project>

使用-X没有任何事情发生在我身上。 我在默认目录中有合法测试,根据文档src/it/java。我尝试过安装,验证和集成测试。

[DEBUG]   (s) reportFormat = brief
[DEBUG]   (s) reportsDirectory = C:\Ws\gitproject\subproject\target\failsafe-reports
[DEBUG]   (f) rerunFailingTestsCount = 0
[DEBUG]   (f) reuseForks = true
[DEBUG]   (s) runOrder = filesystem
[DEBUG]   (f) shutdown = testset
[DEBUG]   (s) skip = false
[DEBUG]   (f) skipAfterFailureCount = 0
[DEBUG]   (s) skipTests = false
[DEBUG]   (s) suiteXmlFiles = []
[DEBUG]   (s) summaryFile = C:\Ws\gitproject\subproject\target\failsafe-reports\failsafe-summary.xml
[DEBUG]   (s) tempDir = surefire
[DEBUG]   (s) testClassesDirectory = C:\Ws\gitproject\subproject\target\test-classes
[DEBUG]   (s) testNGArtifactName = org.testng:testng
[DEBUG]   (s) testSourceDirectory = C:\Ws\gitproject\subproject\src\test\java
[DEBUG]   (s) threadCountClasses = 0
[DEBUG]   (s) threadCountMethods = 0
[DEBUG]   (s) threadCountSuites = 0
[DEBUG]   (s) trimStackTrace = true
[DEBUG]   (s) useFile = true
[DEBUG]   (s) useManifestOnlyJar = true
[DEBUG]   (s) useSystemClassLoader = true
[DEBUG]   (s) useUnlimitedThreads = false
[DEBUG]   (s) workingDirectory = C:\Ws\gitproject\subproject
[DEBUG]   (s) project = MavenProject: com.superchicken.otm:subproject:18.2.1.0-SNAPSHOT @ C:\Ws\gitproject\subproject\pom.xml
[DEBUG]   (s) session = org.apache.maven.execution.MavenSession@306863ac

testSourceDirectory看起来不对我,但到目前为止我一直无法改变它。我会暂时验证一下。

- 校正。这并不是说我无法改变testSourceDirectory,但这样做并不能改善问题。

其他信息:我们也在运行jacoco和fortify。

新信息:src/it/**/*.java中的文件未编译。类文件不会在目标目录中的任何位置结束。

0 个答案:

没有答案