Discussion:
[Cucumber] Create executable JAR in Cucumber/Java project in Intellij/idea
Vegard Nyeng
2014-08-12 10:58:19 UTC
Permalink
I need to create an executable JAR for my Javabased Cucumber project.

This is my folder structure:

Loading Image...

(The Bellyclass in main/java/skeleton is also not used). All the feature
steps are in the resources/skeleton folder and all *step definitions* are
under *test/java/skeleton*

the files that are not displayed are: - gitignore, build.xml,
cucumber-java-skeleton.iml, pom.xml and README.md

I've tried to do some research, but struggled finding out what I should
include in my pom.xml file. I have currently ran my project using Intellij,
but I need to hand it over to someone that can easily run the project on
iOS/Mac.

Best regards, V.
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/d/optout.
aslak hellesoy
2014-08-12 12:12:29 UTC
Permalink
Post by Vegard Nyeng
I need to create an executable JAR for my Javabased Cucumber project.
Why do you need to do this?

Aslak
Post by Vegard Nyeng
https://imagizer.imageshack.us/v2/229x373q90/674/EiXWux.png
(The Bellyclass in main/java/skeleton is also not used). All the feature
steps are in the resources/skeleton folder and all *step definitions* are
under *test/java/skeleton*
the files that are not displayed are: - gitignore, build.xml,
cucumber-java-skeleton.iml, pom.xml and README.md
I've tried to do some research, but struggled finding out what I should
include in my pom.xml file. I have currently ran my project using Intellij,
but I need to hand it over to someone that can easily run the project on
iOS/Mac.
Best regards, V.
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/d/optout.
Vegard Nyeng
2014-08-12 12:42:23 UTC
Permalink
I thought it would be the easiest way for the person to run the
feature-files from his Mac.

Vegard
Post by aslak hellesoy
Post by Vegard Nyeng
I need to create an executable JAR for my Javabased Cucumber project.
Why do you need to do this?
Aslak
Post by Vegard Nyeng
https://imagizer.imageshack.us/v2/229x373q90/674/EiXWux.png
(The Bellyclass in main/java/skeleton is also not used). All the feature
steps are in the resources/skeleton folder and all *step definitions* are
under *test/java/skeleton*
the files that are not displayed are: - gitignore, build.xml,
cucumber-java-skeleton.iml, pom.xml and README.md
I've tried to do some research, but struggled finding out what I should
include in my pom.xml file. I have currently ran my project using Intellij,
but I need to hand it over to someone that can easily run the project on
iOS/Mac.
Best regards, V.
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/d/optout.
Robert
2014-08-14 04:17:48 UTC
Permalink
Vegard,
Post by Vegard Nyeng
I thought it would be the easiest way for the person to run the
feature-files from his Mac.
Vegard
As Aslak noted, I think the easiest way to handle this is with Maven. We
currently support our projects on Windows and Mac using Maven. In fact, I
should also add Linux to that mix, since our CI server runs our tests from
a Linux box. :-)
Post by Vegard Nyeng
Post by aslak hellesoy
Post by Vegard Nyeng
I need to create an executable JAR for my Javabased Cucumber project.
Why do you need to do this?
Aslak
Post by Vegard Nyeng
https://imagizer.imageshack.us/v2/229x373q90/674/EiXWux.png
(The Bellyclass in main/java/skeleton is also not used). All the feature
steps are in the resources/skeleton folder and all *step definitions* are
under *test/java/skeleton*
the files that are not displayed are: - gitignore, build.xml,
cucumber-java-skeleton.iml, pom.xml and README.md
I've tried to do some research, but struggled finding out what I should
include in my pom.xml file. I have currently ran my project using Intellij,
but I need to hand it over to someone that can easily run the project on
iOS/Mac.
Best regards, V.
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google
Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send
For more options, visit https://groups.google.com/d/optout.
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/d/optout.
Michaes S
2014-08-14 06:38:32 UTC
Permalink
I use Cucumber-JVM's command line interface (cli) to run the features. I
pack all dependent libraries (including cucumber jvm & gherkin) using maven
assembly plugin into single jar. I provide the user with only single jar
and they run it through command line. They just need java for that. (no
need of maven, as it is still an alien to some people :)) Checkout earlier
posts by Aslak where he mentions how to run features using cli.

Michaes
Post by Robert
Vegard,
Post by Vegard Nyeng
I thought it would be the easiest way for the person to run the
feature-files from his Mac.
Vegard
As Aslak noted, I think the easiest way to handle this is with Maven. We
currently support our projects on Windows and Mac using Maven. In fact, I
should also add Linux to that mix, since our CI server runs our tests from
a Linux box. :-)
Post by Vegard Nyeng
Post by aslak hellesoy
Post by Vegard Nyeng
I need to create an executable JAR for my Javabased Cucumber project.
Why do you need to do this?
Aslak
Post by Vegard Nyeng
https://imagizer.imageshack.us/v2/229x373q90/674/EiXWux.png
(The Bellyclass in main/java/skeleton is also not used). All the
feature steps are in the resources/skeleton folder and all *step
definitions* are under *test/java/skeleton*
the files that are not displayed are: - gitignore, build.xml,
cucumber-java-skeleton.iml, pom.xml and README.md
I've tried to do some research, but struggled finding out what I should
include in my pom.xml file. I have currently ran my project using Intellij,
but I need to hand it over to someone that can easily run the project on
iOS/Mac.
Best regards, V.
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google
Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send
For more options, visit https://groups.google.com/d/optout.
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/d/optout.
m***@public.gmane.org
2014-08-18 19:11:42 UTC
Permalink
Hi Michaes,
Can you please share me pom.xml used to create executablejar, so that it
jar can be used to run from java instead of maven
For some reason, the jar file created does nt have all dependent jars files

Also, I would like to know how to run from "'maven test""
When I run maven test, cucumber features files are not excuted

Thanks
Mohan
Post by Michaes S
I use Cucumber-JVM's command line interface (cli) to run the features. I
pack all dependent libraries (including cucumber jvm & gherkin) using maven
assembly plugin into single jar. I provide the user with only single jar
and they run it through command line. They just need java for that. (no
need of maven, as it is still an alien to some people :)) Checkout earlier
posts by Aslak where he mentions how to run features using cli.
Michaes
Post by Robert
Vegard,
Post by Vegard Nyeng
I thought it would be the easiest way for the person to run the
feature-files from his Mac.
Vegard
As Aslak noted, I think the easiest way to handle this is with Maven. We
currently support our projects on Windows and Mac using Maven. In fact, I
should also add Linux to that mix, since our CI server runs our tests from
a Linux box. :-)
Post by Vegard Nyeng
Post by aslak hellesoy
Post by Vegard Nyeng
I need to create an executable JAR for my Javabased Cucumber project.
Why do you need to do this?
Aslak
Post by Vegard Nyeng
https://imagizer.imageshack.us/v2/229x373q90/674/EiXWux.png
(The Bellyclass in main/java/skeleton is also not used). All the
feature steps are in the resources/skeleton folder and all *step
definitions* are under *test/java/skeleton*
the files that are not displayed are: - gitignore, build.xml,
cucumber-java-skeleton.iml, pom.xml and README.md
I've tried to do some research, but struggled finding out what I
should include in my pom.xml file. I have currently ran my project using
Intellij, but I need to hand it over to someone that can easily run the
project on iOS/Mac.
Best regards, V.
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google
Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send
For more options, visit https://groups.google.com/d/optout.
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/d/optout.
James Nord
2014-08-28 09:35:03 UTC
Permalink
the following will create an executable jar for you to run assuming you have all of your dependencies setup.


<plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>2.3</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>cucumber.api.cli.Main</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>

/James
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/d/optout.
Vegard Nyeng
2014-08-12 12:20:53 UTC
Permalink
I just need to find the simplest way possible that I can let another person
execute the feature-files from his Mac.

- V
Post by aslak hellesoy
Post by Vegard Nyeng
I need to create an executable JAR for my Javabased Cucumber project.
Why do you need to do this?
Aslak
Post by Vegard Nyeng
https://imagizer.imageshack.us/v2/229x373q90/674/EiXWux.png
(The Bellyclass in main/java/skeleton is also not used). All the feature
steps are in the resources/skeleton folder and all *step definitions* are
under *test/java/skeleton*
the files that are not displayed are: - gitignore, build.xml,
cucumber-java-skeleton.iml, pom.xml and README.md
I've tried to do some research, but struggled finding out what I should
include in my pom.xml file. I have currently ran my project using Intellij,
but I need to hand it over to someone that can easily run the project on
iOS/Mac.
Best regards, V.
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/d/optout.
aslak hellesoy
2014-08-12 12:59:22 UTC
Permalink
Post by Vegard Nyeng
I just need to find the simplest way possible that I can let another
person execute the feature-files from his Mac.
Can't they run `mvn test`?

I don't remember if maven is installed by default on a mac, but if not -
that's certainly easier to install with e.g. homebrew than fiddling with
self-executing jars IMO.

Aslak
Post by Vegard Nyeng
- V
Post by aslak hellesoy
Post by Vegard Nyeng
I need to create an executable JAR for my Javabased Cucumber project.
Why do you need to do this?
Aslak
Post by Vegard Nyeng
https://imagizer.imageshack.us/v2/229x373q90/674/EiXWux.png
(The Bellyclass in main/java/skeleton is also not used). All the feature
steps are in the resources/skeleton folder and all *step definitions* are
under *test/java/skeleton*
the files that are not displayed are: - gitignore, build.xml,
cucumber-java-skeleton.iml, pom.xml and README.md
I've tried to do some research, but struggled finding out what I should
include in my pom.xml file. I have currently ran my project using Intellij,
but I need to hand it over to someone that can easily run the project on
iOS/Mac.
Best regards, V.
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google
Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send
For more options, visit https://groups.google.com/d/optout.
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/d/optout.
Loading...