maven-surefire-plugin

Is the surefire's forkMode 'never' working with cobertura under Maven 3?

◇◆丶佛笑我妖孽 提交于 2019-12-14 02:44:04
问题 After switching from maven 2 to maven 3 I have found out having 0% test coverage reported by cobertura. I've stated question about which versions of cobertura and surefire to use: What versions of cobertura and surefire plugins work together under maven3? I have, however, investigated problem deeper and found out what of configuration fragment was not working: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>${surefire.plugin.version

Required class is missing: org/codehaus/gmaven/mojo/GroovyMojo when tried to run to generate report and send an email in the Maven Project

荒凉一梦 提交于 2019-12-13 17:01:40
问题 I have Maven JUnit Project, which compiles, builds and tests successfully. Also when I do the mvn site all the tests run successfully and generates the surefire-report at ..\target\site.. directory. Now, I need to send an email this report to given recipients. Here is my POM: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4

Why does this autorun-cmd registry hack affect a java/maven process?

若如初见. 提交于 2019-12-13 06:20:41
问题 The presence of an HKEY_CURRENT_USER\Software\Microsoft\Command Processor\Autorun causes a java test to fail. Github repo to test this out : https://github.com/ajorpheus/final-frontier This is a follow-up question after this happened. Summary : Apparently a registry hack which allows a command to be run every time the cmd prompt is opened, adversely affects the Java process. To begin with I thought, that perhaps it was the fact that 'mvn clean test' actually resolves to 'mvn.bat clean test'.

Change output directory of maven surefire-plugin

筅森魡賤 提交于 2019-12-13 05:48:29
问题 I'm trying to change the output folder for the XML files which get generated by the surefire-plugin in a maven project. I stated the target output folder inside the configuration brackets of the report-plugin as well as in the maven-site-plugin (mentioned in the documentation). I also tried to state the maven-site-plugin within the reporting block but that doesn't seem to work as well. My XML files always get written into the default surefire-reports folder. My pom.xml has following entries:

How to execute scripts before and after SureFire test phase

别来无恙 提交于 2019-12-13 03:15:13
问题 When I invoke mvm test , I want to execute a setup.sql script before Surefire JUnit is invoked and then execute a teardown.sql script after. I know from questions like this how to execute scripts during the test phase, but I have no idea how to define this specific sequence of events. Thank you! 回答1: Not with the surefire plugin but with its sibling the failsafe plugin. They both execute Tests but in different life-cycle phases. The surefire plugin in test and the failsafe plugin in

NoClassDefFoundError: Tests fail during Maven test phase when SureFire forkCount is greater than 0

本秂侑毒 提交于 2019-12-13 00:23:05
问题 Issue Java 9 / Java 10 Module Mode: Tests failing due to initializationError: java.lang.NoClassDefFoundError: Could not initialize class org.springframework.test.context.junit4.SpringRunner when SureFire forkCount > 0 Spring Boot: 2.0.1.RELEASE Java: "10" 2018-03-20 (Vendor: Oracle Corporation) Maven: 3.5.3 maven-compiler-plugin: 3.7.0 maven-surefire-plugin: 2.21.0 macOS: 10.12.6 Relevant stack trace [INFO] --- maven-surefire-plugin:2.21.0:test (default-test) @ turbo --- [INFO] [INFO] -------

Correct maven pom configuration for Cucumber Tests and maven-cucumber-reporting

不羁的心 提交于 2019-12-12 04:49:45
问题 I had this working in a previous project but cannot find it now... I am using Maven to build a java app and I am running tests on the app during the build process. I am using maven-cucumber-reporting plugin v3.0.0 to put together a report of the outcome. I want to: Run the cucumber tests Generate a report (whether or not the cucumber tests fail) Fail a build after generating reports if failed How can I setup my pom with a combo of maven-surefire-plugin , maven-cucumber-reporting plugin, and

What is the TestNG XML report pattern for Jenkins when using Maven with surefire?

Deadly 提交于 2019-12-12 04:11:46
问题 I'm using TestNG Results Plugin. I defined TestNG XML report pattern as: **\target\surefire-reports\testng-results.xml I'm getting this error: TestNG Reports Processing: START Looking for TestNG results report in workspace using pattern: **\target\surefire-reports\testng-results.xml Did not find any matching files. What should be the correct pattern? 回答1: I just fixed this problem! It's because that the current directory was changed to the default Jenkins workspace, something like '/Users

Mono “Hello World” example working, but Java is not

[亡魂溺海] 提交于 2019-12-12 03:44:00
问题 I'm running the Getting Started Examples from the Sauce Labs homepage both with Java and C# Mono. The Mono example works like a charm, but the Java one reports that Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure. I've tried re-writing the Java example to be similar to the Mono example as such: public class WebDriverTest { private WebDriver driver; @Before public void setUp() throws Exception { DesiredCapabilities

Maven Surefire can't instantiate my IReporter class on Jenkins

好久不见. 提交于 2019-12-12 02:37:55
问题 I have a Jenkins project that cannot run due to being unable to instantiate my TestNG IReporter class, CustomReportListener.java (CRL). If I remove all references to it, the project runs just fine, but I am required to return the results via CRL. Lastly, CRL is part of a framework that we include as a JAR, and the test has seemingly no problems using any other class inside that JAR. Main Error [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test (default