I have a Java Cucumber project which I have to run via an executable jar (java -jar) instead of maven (mvn).
I am trying to add the Trivago Cluecumber report plugin (https://github.com/trivago/cluecumber-report-plugin) into it but it only works when I call it via the maven command:
mvn cluecumber-report:reporting
When I run the project via java -jar I can see that the plugin creates the .json file but does not create the reports with the html,css,js page.
Is there a way I can fire this plugin from my java code instead of the maven plugin in the pom.xml?
Or is there a way I can hook this plugin execution after the java cucumber framework runs?
Thanks
As Cluecumber in its current form is a Maven project, it needs to be invoked via Maven. Future versions of Cluecumber may also be usable without Maven.
Related
I created a Maven project following the quickstart template as described in the Maven doc site. I can build it. However I'm confused: I can't find any instructions for executing an application built with Maven. I did find the suggestion I type java -cp target/Mus-1.0-SNAPSHOT.jar app.App or something similar, but this fails when I added an external dependency to my Maven project.
Surely there must be some kind of Maven command for executing an App.
I have inherited a codebase whereby we have a maven project of component tests that use junit as the framework that runs the tests.
Everything runs OK, but the problem is that these tests must be compiled into a jar-with-dependencies so that they can be run on a standalone computer with very limited outwards connectivity (e.g does not have access to maven central).
I have managed to create a runnable jar with dependencies which I can run using junit.jar and the command line like so:
java -cp jar-with-dependencies.jar:junit.jar junit.jar org.junit.runner.JUnitCore com.testsuite.AllTests
This works but the problem is that I also need to output the junit results into XML, like maven's surefire plugin does.
My question is, can I run this jar-with-dependencies using maven such that it creates the junit xml reports?
I can successfully run the tests using exec-maven-plugin which essentially runs the previously stated command
I am trying to write a Maven Plugin. This plugin needs to run a separate java process for a separate jar. How to obtain the maven java runtime?
Thanks.
I've created maven project with selenium and cucumber. I'm trying to use jira X-ray in a continuous integration setup. Basically I take exported feature files and want to execute them on a command line using bamboo.
I think my main problem is I'm not sure how to feed in feature files to a compiled maven project that has the step definitions.
I have features defined in src/test/resources/shouty
If I only want to run the location.feature using Maven, then I can use the command
mvn test -Dcucumber.options="src/test/resources/shouty/location.feature"
What you want to do is to specify the feature in the CI job using Maven as above.
I have a standalone application which I have deployed using the Maven release plugin.
I now need to run it on the remote server...
Would you recommend using the mvn exec plugin?
Otherwise whats the best way of running the app (i.e. working out the correct classpath etc).
Thxs
You can use the Maven Assembly Plugin with jar-with-dependencies descriptor (it's one of default descriptors). It should include all dependencies, allowing you to easily run the jar on the server.
Either the exec plugin, or use the dependencies plugin (or any of the jarjar-/onejar-type utilities) to create an all-in-one jar and just distribute that.