Error when generating Cucumber report in Maven - cucumber-jvm

I use Java and Cucumber to run my test. My test passed and I want to generate a report after running the test by using Cucumber. So I run terminal: mvn clean verify. But I got these error as below:
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running mgl.example.RunTest
#first
Feature: Test drag-drop and scroll options
Scenario: Drag-drop and scroll must be OK # MoveAndScroll.feature:3
Given I move from the root role dialog to choosing picture # AddNewDevice.i_move_from_the_root_role_dialog_to_choosing_picture()
When I Choose picture and click continue # AddNewDevice.i_Choose_picture_and_click_continue()
Then I can drag-drop device and scroll options # AddNewDevice.i_can_drag_drop_device_and_scroll_options()
1 Scenarios (1 passed)
3 Steps (3 passed)
2m12.865s
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 133.918 sec - in mgl.example.RunTest
Results :
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) # Example ---
[INFO] Building jar: /Users/enclaveit/Documents/workspace/Example/target/Example-0.0.1-SNAPSHOT.jar
[INFO]
[INFO] --- maven-cucumber-reporting:0.0.6:generate (execution) # Example ---
About to generate
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:24 min
[INFO] Finished at: 2014-06-17T17:07:09+07:00
[INFO] Final Memory: 16M/200M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal net.masterthought:maven-cucumber-reporting:0.0.6:generate (execution) on project Example: Error Found: BUILD FAILED - Check Report For Details -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal net.masterthought:maven-cucumber-reporting:0.0.6:generate (execution) on project Example: Error Found:
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:108)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:76)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:116)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:361)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Error Found:
at net.masterthought.cucumber.CucumberReportGeneratorMojo.execute(CucumberReportGeneratorMojo.java:86)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 19 more
Caused by: org.apache.maven.plugin.MojoExecutionException: BUILD FAILED - Check Report For Details
at net.masterthought.cucumber.CucumberReportGeneratorMojo.execute(CucumberReportGeneratorMojo.java:82)
... 21 more
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Can somebody help me?

I ran into the same problem. The tests are executed, the report is generated but the BUILD FAILURE. This is the case if there are some validation errors. However, if I run the all-passing test cases then BUILD SUCCESS.
I guess if one of the test cases fails then BUILD FAILURE. If no failure in the run then BUILD SUCCESS. This is what I think.
There are some other questions about the POM:
failIfNoTests>false</failIfNoTests
testFailureIgnore>true</testFailureIgnore
These two lines above need to be inside sure-fire

Related

Maven - doesnt download from https://repo1.maven.org/maven2 but trying to download from http://repo1.maven.org/maven2

I m trying to run mvn site. I tried even running dependency tree. But still i m getting the following error on console. Ideally it should fetch from https and not from http. How do we get the maven from downloading from https and not from http ?
D:\Junit\junit5-examples-master\junit5-maven>mvn site
[INFO] Scanning for projects...
[INFO]
[INFO] --------------------< com.mkyong.core:junit5-maven >--------------------
[INFO] Building junit5-maven 1.0
[INFO] --------------------------------[ jar ]---------------------------------
Downloading from central: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-surefire-report-plugin/3.0.0-M4/maven-surefire-r
eport-plugin-3.0.0-M4.pom
Downloading from org.source.repo: https://repo1.maven.org/maven2/org/apache/maven/plugins/maven-surefire-report-plugin/3.0.0-M4/maven-s
urefire-report-plugin-3.0.0-M4.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.063 s
[INFO] Finished at: 2020-01-20T17:14:59+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project junit5-maven: Could not resolve dependencies for project com.mkyong.core:junit5-maven:jar:1.0
: Failed to collect dependencies at org.apache.maven.plugins:maven-surefire-report-plugin:jar:3.0.0-M4: Failed to read artifact descrip
tor for org.apache.maven.plugins:maven-surefire-report-plugin:jar:3.0.0-M4: Could not transfer artifact org.apache.maven.plugins:maven-
surefire-report-plugin:pom:3.0.0-M4 from/to central (http://repo1.maven.org/maven2/): Failed to transfer file http://repo1.maven.org/ma
ven2/org/apache/maven/plugins/maven-surefire-report-plugin/3.0.0-M4/maven-surefire-report-plugin-3.0.0-M4.pom with status code 501 -> [
Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
Pl assist.
Regards,

Connection timing out while connecting to Maven repository

I am trying to build my project in my local system using the below command
mvn clean install -Dmaven.test.skip=true
It fails with the below error. It is failing to connect to repo.maven.apache.org.
I pinged to the server repo.maven.apache.org, I can see the response back.
I am using maven 3 version and connecting to maven 2 repo (repo.maven.apache.org).
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building web-order-avpn 1702.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: **https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom**
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 21.778 s
[INFO] Finished at: 2017-01-19T21:21:10-06:00
[INFO] Final Memory: 6M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its
dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.5:
Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.5 from/to central
(https://repo.maven.apache.org/maven2): Connect to repo.maven.apache.org:443 [repo.maven.apache.org/151.101.56.215] failed: Connection timed out: connect -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
Would be great if some one can suggest on what is wrong with my system?
I had this same issue and just like the comments suggested it was the maven proxy. Setup in \conf\settings.xml
http://maven.apache.org/guides/mini/guide-proxies.html

How to run javaee7 sdk samples?

My teacher want me to run javaee7 sdk sample "annotation-war". Then I download the javaee7 sdk from http://www.oracle.com/technetwork/java/javaee/downloads/index.html. But, I don't know how to run it.
I have tried the following steps:
First, I import code into Intelij IDEA, and run mvn cargo:run, but some error happen
"C:\Program Files\Java\jdk1.8.0_101\bin\java" -Dmaven.multiModuleProjectDirectory=C:\zjf\code\IDEA\javaee_samples\servlet\annotation-war -Dmaven.home=C:\zjf\soft\apache-maven-3.3.9 -Dclassworlds.conf=C:\zjf\soft\apache-maven-3.3.9\bin\m2.conf -Didea.launcher.port=7532 "-Didea.launcher.bin.path=C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 2016.3\bin" -Dfile.encoding=UTF-8 -classpath "C:\zjf\soft\apache-maven-3.3.9\boot\plexus-classworlds-2.5.2.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 2016.3\lib\idea_rt.jar" com.intellij.rt.execution.application.AppMain org.codehaus.classworlds.Launcher -Didea.version=2016.3 -s C:\zjf\soft\apache-maven-3.3.9\conf\settings.xml -Dmaven.repo.local=C:\zjf\soft\apache-maven-3.3.9\repo org.codehaus.cargo:cargo-maven2-plugin:1.4.0:run
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building annotation-war 4.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- cargo-maven2-plugin:1.4.0:run (default-cli) # annotation-war ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.422 s
[INFO] Finished at: 2016-12-06T19:12:34+08:00
[INFO] Final Memory: 8M/184M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.4.0:run (default-cli) on project annotation-war: Execution default-cli of goal org.codehaus.cargo:cargo-maven2-plugin:1.4.0:run failed: Cannot create configuration. There's no registered configuration for the parameters (container [id = [glassfish4x], type = [installed]], configuration type [standalone]). Actually there are no valid types registered for this configuration. Maybe you've made a mistake spelling it? -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
Process finished with exit code 1
Then I think may be I have done the wrong thing, so I read the docs in "annotation-war". It's ok to run mvn clean and mvn verify. But when I run mvn cargo:run -Dglassfish.home=C:\zjf\soft\glassfish, I still encounter the same problem:
C:\zjf\code\IDEA\javaee_samples\servlet\annotation-war>mvn cargo:run -Dglassfish.home=C:\zjf\soft\glassfish
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building annotation-war 4.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- cargo-maven2-plugin:1.4.0:run (default-cli) # annotation-war ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.038 s
[INFO] Finished at: 2016-12-06T20:59:57+08:00
[INFO] Final Memory: 8M/184M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.4.0:run (default-cli) on project annotation-war: Execution default-cli of goal org.codehaus.cargo:cargo-maven2-plugin:1.4.0:run failed: Cannot create configuration. There's no registered configuration for the parameters (container [id = [glassfish4x], type = [installed]], configuration type [standalone]). Actually there are no valid types registered for this configuration. Maybe you've made a mistake spelling it? -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
I really don't know how to run javaee SDK samples. Can anyone who know how to run it give me some help?
The simplest way to get it running is to first build the project with mvn install which will output a WAR file. The bottom of the log will tell you the full, absolute path to the WAR file. the install Maven goal will also put copy it to your local repository which is managed by Maven, so you will see two different paths to the same WAR file. Either of these works, e.g:
/path/to/my/app/target/annotation-war-1.0.0-SNAPSHOT.war
You can then use the asadmin tool in GlassFish to deploy the WAR file, first making sure GlassFish is running:
C:\zjf\soft\glassfish\glassfish4\bin\asadmin start-domain
C:\zjf\soft\glassfish\glassfish4\bin\asadmin deploy /path/to/my/app/target/annotation-war-1.0.0-SNAPSHOT.war
This isn't the only way to get it running (there are many) but you may find this is the easiest to undestand, with the fewest things that might go wrong, despite it being a bit long-winded.

Maven install/compile Failure

I am getting below exception , When i compile/install through maven in command prompt / eclipse.
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) # dashboard ---
May 22, 2013 3:55:50 PM org.sonatype.guice.bean.reflect.Logs$JULSink warnWARNING: Error injecting: org.apache.maven.plugin.resources.ResourcesMojo java.lang.NoClassDefFoundError: org/apache/maven/shared/filtering/MavenFiltering
Exception
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2413)
at java.lang.Class.getDeclaredConstructors(Class.java:1855)
at com.google.inject.spi.InjectionPoint.forConstructorOf(InjectionPoint.
java:245)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.050s
[INFO] Finished at: Wed May 22 15:55:50 MDT 2013
[INFO] Final Memory: 9M/111M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:2.5:resources (default-resources) on project dashboard: Execution default-resources of goal org.apache.maven.plugins:maven-resources-plugin:2.5:resources failed: A required class was missing while executing org.apache.maven.plugins:maven-resources-plugin:2.5:resources: org/apache/maven/shared/filtering/MavenFilteringException
I have tried by changing the repository location and also deleting the existing plugins in the repository directory.
Try if another task locks the maven-filtering jar file (.m2/repository/org/apache/maven/shared/maven-filtering/1.xx/maven-filtering-1.xx.jar). In my case Eclipse had locked that file somehow. Kill that task and maven should be ok.

Maven changelog plugin with Mercurial problem

I have configured my Maven2 project to generate a changelog report from a Mercurial repository (accessible via file:// protocol) but the goal execution fails with the following message:
+ Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'changelog'.
[INFO] ------------------------------------------------------------------------
[INFO] Building Phobos3 Prototype
[INFO] task-segment: [changelog:changelog]
[INFO] ------------------------------------------------------------------------
[INFO] [changelog:changelog {execution: default-cli}]
[INFO] Generating changed sets xml to: D:\Documents and Settings\501845922\Workspace\phobos3.prototype\target\changelog.xml
[INFO] EXECUTING: hg log --verbose
[WARNING] Could not figure out: abort: Invalid argument
[ERROR]
EXECUTION FAILED
Execution of cmd : log failed with exit code: -1.
Working directory was:
D:\Documents and Settings\501845922\Workspace\phobos3.prototype
Your Hg installation seems to be valid and complete.
Hg version: 1.4.3+20100201 (OK)
[ERROR] Provider message:
[ERROR]
EXECUTION FAILED
Execution of cmd : log failed with exit code: -1.
Working directory was:
D:\Documents and Settings\501845922\Workspace\phobos3.prototype
Your Hg installation seems to be valid and complete.
Hg version: 1.4.3+20100201 (OK)
[ERROR] Command output:
[ERROR]
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] An error has occurred in Change Log report generation.
Embedded error: An error has occurred during changelog command :
Command failed.
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: An error has occurred in Change Log report generation.
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: An error has occurred in Change Log report generation.
at org.apache.maven.reporting.AbstractMavenReport.execute(AbstractMavenReport.java:79)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
... 17 more
Caused by: org.apache.maven.reporting.MavenReportException: An error has occurred during changelog command :
at org.apache.maven.plugin.changelog.ChangeLogReport.generateChangeSetsFromSCM(ChangeLogReport.java:555)
at org.apache.maven.plugin.changelog.ChangeLogReport.getChangedSets(ChangeLogReport.java:393)
at org.apache.maven.plugin.changelog.ChangeLogReport.executeReport(ChangeLogReport.java:340)
at org.apache.maven.reporting.AbstractMavenReport.generate(AbstractMavenReport.java:98)
at org.apache.maven.reporting.AbstractMavenReport.execute(AbstractMavenReport.java:73)
... 19 more
Caused by: org.apache.maven.plugin.MojoExecutionException: Command failed.
at org.apache.maven.plugin.changelog.ChangeLogReport.checkResult(ChangeLogReport.java:705)
at org.apache.maven.plugin.changelog.ChangeLogReport.generateChangeSetsFromSCM(ChangeLogReport.java:467)
... 23 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3 seconds
[INFO] Finished at: Thu Apr 29 17:10:06 CEST 2010
[INFO] Final Memory: 5M/10M
[INFO] ------------------------------------------------------------------------
What did I miss in a configuration? (I hope it is a configuration problem not a Maven plugins related bug!:) My repository URL seems to be ok (the plugin has been complaining before, I fixed that up), I also set a date format for parsing (also been complaining, also fixed).
target/changelog.xml being promised was not generated at all.
Maven 2.2.1
Mercurial 1.4.3
Windows XP SP3
mvn scm:changelog command provides an expected output.
Thanks for any suggestions, I haven't googled up anything (nor binged up;).
I did a test with a random project (noop, to be precise):
hg clone https://noop.googlecode.com/hg/ noop
And after configuring the dateFormat of the maven-changelog-plugin in the top pom.xml:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-changelog-plugin</artifactId>
<configuration>
<dateFormat>EEE MMM dd hh:mm:ss yyyy Z</dateFormat>
</configuration>
</plugin>
I've been able to run mvn changelog:changelog without troubles. My point is that the plugin seems to work for at least one project (chosen randomly :).
I'd really like to know if hg log --verbose behave correctly as the plugin seems to complain about it not running successfully. If it does, could you try to pass the -X option when running Maven and see if you get more useful information.
Also, please provide the content of your <scm> element.