gpt4 book ai didi

Maven 故障安全插件不运行 testNG XML 套件

转载 作者:行者123 更新时间:2023-12-02 02:11:23 25 4
gpt4 key购买 nike

我正在使用 Maven 来运行我在 TestNG 套件中的集成测试。在 eclipse 下运行套件时,我的测试套件成功运行。当运行“mvn verify”来运行我的集成测试时,我看到故障安全插件配置调试打印包括 suite.xml 文件和我编译的类的正确路径,但它不执行我的测试(构建过程成功完成)。

我尝试运行相同的 pom 配置但使用 surefire 插件而不是故障安全插件并且我的测试成功执行。

        <build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.12.3</version>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>src/test/resources/MyTestNgSuiteFile.xml</suiteXmlFile>
</suiteXmlFiles>
<argLine>-Xmx1024m</argLine>
</configuration>
<executions>
<execution>
<id>integration-test</id>
<phase>integration-test</phase>
<goals>
<goal>integration-test</goal>
</goals>
</execution>
<execution>
<id>verify</id>
<phase>verify</phase>
<goals>
<goal>verify</goal>
</goals>
</execution>
</executions>

</plugin>

这里是相关的控制台输出:

[DEBUG] Excluded: org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1 [DEBUG] Excluded: junit:junit:jar:3.8.1 [DEBUG] Excluded: org.apache.maven:maven-core:jar:2.0.9 [DEBUG] Excluded: org.apache.maven:maven-plugin-parameter-documenter:jar:2.0.9 [DEBUG]
Excluded: org.apache.maven:maven-repository-metadata:jar:2.0.9 [DEBUG] Excluded: org.apache.maven:maven-error-diagnostics:jar:2.0.9 [DEBUG]
Excluded: org.apache.maven:maven-plugin-descriptor:jar:2.0.9 [DEBUG]
Excluded: org.apache.maven:maven-monitor:jar:2.0.9 [DEBUG] Excluded: classworlds:classworlds:jar:1.1 [DEBUG] Excluded: org.apache.maven:maven-toolchain:jar:2.0.9 [DEBUG] Configuring mojo org.apache.maven.plugins:maven-failsafe-plugin:2.12.3:integration-test from plugin realm ClassRealm[plugin>org.apache.maven.plugins:maven-failsafe-plugin:2.12.3, parent: sun.misc.Launcher$AppClassLoader@121ab80] [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-failsafe-plugin:2.12.3:integration-test' with basic configurator --> [DEBUG] (s) argLine = -Xmx1024m [DEBUG] (s) basedir = PathToMyDir\MyProject [DEBUG] (s) childDelegation = false [DEBUG] (s) classesDirectory = PathToMyDir\MyProject\target\classes [DEBUG] (s) disableXmlReport = false [DEBUG] (s) enableAssertions = true [DEBUG] (s) forkMode = once [DEBUG] (s) junitArtifactName = junit:junit [DEBUG] (s) localRepository = id: local url: file:///..../.m2/repository/ layout: none

[DEBUG] (f) parallelMavenExecution = false [DEBUG] (s) perCoreThreadCount = true [DEBUG] (s) pluginArtifactMap = {org.apache.maven.plugins:maven-failsafe-plugin=org.apache.maven.plugins:maven-failsafe-plugin:maven-plugin:2.12.3:, org.apache.maven.surefire:surefire-booter=org.apache.maven.surefire:surefire-booter:jar:2.12.3:compile, org.apache.maven.surefire:surefire-api=org.apache.maven.surefire:surefire-api:jar:2.12.3:compile, org.apache.maven.surefire:maven-surefire-common=org.apache.maven.surefire:maven-surefire-common:jar:2.12.3:compile, org.apache.commons:commons-lang3=org.apache.commons:commons-lang3:jar:3.1:compile, org.apache.maven.shared:maven-common-artifact-filters=org.apache.maven.shared:maven-common-artifact-filters:jar:1.3:compile, org.codehaus.plexus:plexus-utils=org.codehaus.plexus:plexus-utils:jar:3.0.5:compile, org.apache.maven.reporting:maven-reporting-api=org.apache.maven.reporting:maven-reporting-api:jar:2.0.9:compile, org.apache.maven.plugin-tools:maven-plugin-annotations=org.apache.maven.plugin-tools:maven-plugin-annotations:jar:3.1:compile} [DEBUG] (f) pluginDescriptor = Component Descriptor: role: 'org.apache.maven.plugin.Mojo', implementation: 'org.apache.maven.plugin.failsafe.HelpMojo', role hint: 'org.apache.maven.plugins:maven-failsafe-plugin:2.12.3:help' role: 'org.apache.maven.plugin.Mojo', implementation: 'org.apache.maven.plugin.failsafe.IntegrationTestMojo', role hint: 'org.apache.maven.plugins:maven-failsafe-plugin:2.12.3:integration-test' role: 'org.apache.maven.plugin.Mojo', implementation: 'org.apache.maven.plugin.failsafe.VerifyMojo', role hint: 'org.apache.maven.plugins:maven-failsafe-plugin:2.12.3:verify' --- [DEBUG] (s) printSummary = true [DEBUG] (s) projectArtifactMap = {All Artifacts Here} [DEBUG] (s) redirectTestOutputToFile = false [DEBUG] (s) remoteRepositories = [ id: central url: http://repo1.maven.org/maven2 layout: default snapshots: [enabled => false, update => daily] releases: [enabled => true, update => never] ] [DEBUG] (s) reportFormat = brief [DEBUG] (s) reportsDirectory = PathToMyDir\MyProject\target\failsafe-reports [DEBUG] (s) runOrder = filesystem [DEBUG] (s) skip = false [DEBUG] (s) skipTests = false [DEBUG] (s) suiteXmlFiles = [PathToMyDir\MyProject\src\test\resources\MyTestNgSuiteFile.xml] [DEBUG] (s) summaryFile = PathToMyDir\MyProject\target\failsafe-reports\failsafe-summary.xml [DEBUG] (s) testClassesDirectory = PathToMyDir\MyProject\target\test-classes [DEBUG] (s) testNGArtifactName = org.testng:testng [DEBUG] (s) testSourceDirectory = PathToMyDir\MyProject\src\test\java [DEBUG]
(s) trimStackTrace = true [DEBUG] (s) useFile = true [DEBUG] (s) useManifestOnlyJar = true [DEBUG] (s) useSystemClassLoader = true [DEBUG] (s) useUnlimitedThreads = false [DEBUG] (s) workingDirectory = PathToMyDir\MyProject [DEBUG] (s) project = MavenProject: MyParentProject:MyProject:0.0.1-SNAPSHOT @ PathToMyDir\MyProject\pom.xml [DEBUG]
(s) session = org.apache.maven.execution.MavenSession@bffe59 [DEBUG] -- end configuration -- [WARNING] File encoding has not been set, using platform encoding Cp1255, i.e. build is platform dependent! [INFO] [INFO] --- maven-failsafe-plugin:2.12.3:verify (verify) @ MyProject --- [DEBUG] Configuring mojo org.apache.maven.plugins:maven-failsafe-plugin:2.12.3:verify from plugin realm ClassRealm[plugin>org.apache.maven.plugins:maven-failsafe-plugin:2.12.3, parent: sun.misc.Launcher$AppClassLoader@121ab80] [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-failsafe-plugin:2.12.3:verify' with basic configurator --> [DEBUG] (s) basedir = PathToMyDir\MyProject [DEBUG] (s) reportsDirectory = PathToMyDir\MyProject\target\failsafe-reports [DEBUG] (s) skip = false [DEBUG] (f) summaryFile = PathToMyDir\MyProject\target\failsafe-reports\failsafe-summary.xml [DEBUG] (s) testClassesDirectory = PathToMyDir\MyProject\target\test-classes [DEBUG] (s) testFailureIgnore = false [DEBUG] -- end configuration -- [INFO] Failsafe report directory: PathToMyDir\MyProject\target\failsafe-reports [WARNING] File encoding has not been set, using platform encoding Cp1255, i.e. build is platform dependent!

它看起来像 "Forking command line: cmd.exe/X/C "C:\Program Files (x86)\Java\jdk1.7.0_04..." 命令丢失并且没有被执行。如果有任何帮助,我将不胜感激。

最佳答案

我遇到了类似的问题,将故障安全插件降级到 2.11 对我有用。

关于Maven 故障安全插件不运行 testNG XML 套件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12561791/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com