Discussion:
[Cucumber] How to glue step definitions from a .jar file
Van
2015-09-29 21:31:54 UTC
Permalink
Hello!


How can we glue step definition from a .jar file?


For example, i have couple of projects with different feature files. Most
of the step definitions are common. Can i keep these step definitions in a
.jar file and pass the package name to cucumber "--glue" option? I tried
doing it but it says steps are undefined. Is there anyway to use these step
definitions as a common library? so that i do not have to maintain the same
code in different projects?

BTW - I am running them as a Maven command.


Appreciate your help! Please feel free to bug me for more details.


Thanks,
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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Paolo Ambrosio
2015-09-30 06:22:42 UTC
Permalink
Post by Van
Hello!
How can we glue step definition from a .jar file?
For example, i have couple of projects with different feature files. Most of
the step definitions are common. Can i keep these step definitions in a .jar
file and pass the package name to cucumber "--glue" option? I tried doing
it but it says steps are undefined. Is there anyway to use these step
definitions as a common library? so that i do not have to maintain the same
code in different projects?
BTW - I am running them as a Maven command.
Did you try adding the JAR as a dependency and specifying the
classpath (not the jar) in the glue command? Can you paste the pom.xml
snippet you are using?
Post by Van
Appreciate your help! Please feel free to bug me for more details.
Thanks,
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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Van
2015-10-02 07:40:43 UTC
Permalink
Hello Paolo,

I have added the jar as a dependency and that jar along with its packages
is shown in Maven dependency in package explorer view.

For example, i have a project with a packages "com.project.stepdefs" then
the below command works fine:
mvn clean install -Dtest=RunTest test -Dcucumber.options="--tags @xyz
--glue com.project.stepdefs"

But, if i point to same step definitions in a jar (common.jar) under
package "com.common.stepdefs" and try to run with below command:
mvn clean install -Dtest=RunTest test -Dcucumber.options="--tags @xyz
--glue com.common.stepdefs"
It says steps are undefined.

How to specify the classpath in glue command? The common.jar file is in my
local .m2 repository.

Thanks,
V
Post by Van
Post by Van
Hello!
How can we glue step definition from a .jar file?
For example, i have couple of projects with different feature files.
Most of
Post by Van
the step definitions are common. Can i keep these step definitions in a
.jar
Post by Van
file and pass the package name to cucumber "--glue" option? I tried
doing
Post by Van
it but it says steps are undefined. Is there anyway to use these step
definitions as a common library? so that i do not have to maintain the
same
Post by Van
code in different projects?
BTW - I am running them as a Maven command.
Did you try adding the JAR as a dependency and specifying the
classpath (not the jar) in the glue command? Can you paste the pom.xml
snippet you are using?
Post by Van
Appreciate your help! Please feel free to bug me for more details.
Thanks,
V
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google
Groups
Post by Van
"Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send
an
Post by Van
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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Van
2015-10-02 14:46:32 UTC
Permalink
Hi Paolo,

Sorry, here is the dependency snippet from POM file:

<dependency>

<groupId>com.automation.common</groupId>

<artifactId>common</artifactId>

<version>0.0.1</version>

</dependency>

Thanks,
V
Post by Van
Hello Paolo,
I have added the jar as a dependency and that jar along with its packages
is shown in Maven dependency in package explorer view.
For example, i have a project with a packages "com.project.stepdefs" then
--glue com.project.stepdefs"
But, if i point to same step definitions in a jar (common.jar) under
--glue com.common.stepdefs"
It says steps are undefined.
How to specify the classpath in glue command? The common.jar file is in my
local .m2 repository.
Thanks,
V
Post by Van
Post by Van
Hello!
How can we glue step definition from a .jar file?
For example, i have couple of projects with different feature files.
Most of
Post by Van
the step definitions are common. Can i keep these step definitions in a
.jar
Post by Van
file and pass the package name to cucumber "--glue" option? I tried
doing
Post by Van
it but it says steps are undefined. Is there anyway to use these step
definitions as a common library? so that i do not have to maintain the
same
Post by Van
code in different projects?
BTW - I am running them as a Maven command.
Did you try adding the JAR as a dependency and specifying the
classpath (not the jar) in the glue command? Can you paste the pom.xml
snippet you are using?
Post by Van
Appreciate your help! Please feel free to bug me for more details.
Thanks,
V
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google
Groups
Post by Van
"Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send
an
Post by Van
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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Roberto Lo Giacco
2015-09-30 16:04:24 UTC
Permalink
Post by Van
Hello!
How can we glue step definition from a .jar file?
As Paolo said we need more details, but I can assure you it is working for
me.
--
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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Van
2015-10-02 07:47:56 UTC
Permalink
Thanks Roberto ... nice to hear that :)

Like i replied to Paolo ... I have added the jar as a dependency and that
jar along with its packages is shown in Maven dependency in package
explorer view.

For example, i have a project with a package "com.project.stepdefs" then
the below command works fine:
mvn clean install -Dtest=RunTest test -Dcucumber.options="--tags @xyz
--glue com.project.stepdefs"

But, if i point to same step definitions in a jar (common.jar) under
package "com.common.stepdefs" and try to run with below command:
mvn clean install -Dtest=RunTest test -Dcucumber.options="--tags @xyz
--glue com.common.stepdefs"
It says steps are undefined.

The common.jar file is in my local .m2 repository.
Can you please suggest on what i am missing?

Thanks,
V

On Wednesday, September 30, 2015 at 9:04:25 AM UTC-7, Roberto Lo Giacco
Post by Roberto Lo Giacco
Post by Van
Hello!
How can we glue step definition from a .jar file?
As Paolo said we need more details, but I can assure you it is working for
me.
--
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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
George Dinwiddie
2015-10-02 15:42:32 UTC
Permalink
Van,
Post by Van
Thanks Roberto ... nice to hear that :)
Like i replied to Paolo ... I have added the jar as a dependency and
that jar along with its packages is shown in Maven dependency in package
explorer view.
For example, i have a project with a package "com.project.stepdefs" then
--glue com.project.stepdefs"
But, if i point to same step definitions in a jar (common.jar) under
--glue com.common.stepdefs"
It says steps are undefined.
Did you change the package statement in the source code of the step
definitions? If not, then the argument to the '--glue' parameter should
not change. The name of the jar is of no consequence, as long as it's
included in the classpath.

- George
--
----------------------------------------------------------------------
* George Dinwiddie * http://blog.gdinwiddie.com
Software Development http://www.idiacomputing.com
Consultant and Coach http://www.agilemaryland.org
----------------------------------------------------------------------
--
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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Van
2015-10-02 16:13:04 UTC
Permalink
Yes George .. Package name is different in jar file hence i changed in the
"--glue" parameter.

Thanks,
V
Post by George Dinwiddie
Van,
Post by Van
Thanks Roberto ... nice to hear that :)
Like i replied to Paolo ... I have added the jar as a dependency and
that jar along with its packages is shown in Maven dependency in package
explorer view.
For example, i have a project with a package "com.project.stepdefs" then
--glue com.project.stepdefs"
But, if i point to same step definitions in a jar (common.jar) under
--glue com.common.stepdefs"
It says steps are undefined.
Did you change the package statement in the source code of the step
definitions? If not, then the argument to the '--glue' parameter should
not change. The name of the jar is of no consequence, as long as it's
included in the classpath.
- George
--
----------------------------------------------------------------------
* George Dinwiddie * http://blog.gdinwiddie.com
Software Development http://www.idiacomputing.com
Consultant and Coach http://www.agilemaryland.org
----------------------------------------------------------------------
--
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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Roberto Lo Giacco
2015-10-03 11:32:24 UTC
Permalink
Please find the attached projects

To have it working I run *mvn install* within the *stepdefs *project, then
I move into the *project *project and run

*mvn test -Dcucumber.options="--tags @xyz --glue org.agileware.stepdefs"
-Dtest=JUnitWrapper*

I tried to keep it as simple as possible.
Post by Van
Yes George .. Package name is different in jar file hence i changed in the
"--glue" parameter.
Thanks,
V
Post by Van
Van,
Post by Van
Thanks Roberto ... nice to hear that :)
Like i replied to Paolo ... I have added the jar as a dependency and
that jar along with its packages is shown in Maven dependency in
package
Post by Van
explorer view.
For example, i have a project with a package "com.project.stepdefs"
then
Post by Van
--glue com.project.stepdefs"
But, if i point to same step definitions in a jar (common.jar) under
--glue com.common.stepdefs"
It says steps are undefined.
Did you change the package statement in the source code of the step
definitions? If not, then the argument to the '--glue' parameter should
not change. The name of the jar is of no consequence, as long as it's
included in the classpath.
- George
--
----------------------------------------------------------------------
* George Dinwiddie * http://blog.gdinwiddie.com
Software Development http://www.idiacomputing.com
Consultant and Coach http://www.agilemaryland.org
----------------------------------------------------------------------
--
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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Roberto Lo Giacco
2015-10-06 18:31:56 UTC
Permalink
Did my last email solve your problem?
--
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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Van
2015-10-07 19:57:17 UTC
Permalink
Hey Roberto,

I am sorry ... just saw your message. Still no luck :(
I am not able to download your attachment ... it shows just 1KB. Is it
possible to share the code in *JUnitWrapper?*

Thanks,
V
Post by Roberto Lo Giacco
Did my last email solve your problem?
--
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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Roberto Lo Giacco
2015-10-07 20:09:39 UTC
Permalink
Post by Van
Hey Roberto,
I am sorry ... just saw your message. Still no luck :(
I am not able to download your attachment ... it shows just 1KB. Is it
possible to share the code in *JUnitWrapper?*
It shows 1kB because it is very small...

Anyway, this is my *very complex* JUnitWrapper

package org.agileware;

import org.junit.runner.RunWith;

import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;

@RunWith(Cucumber.class)
@CucumberOptions(features="src/test/resources")
public class JUnitWrapper {

}



this is my feature file

Feature: feature description
@xyz
Scenario: test
Given something
When an event occurs
Then something else happens



and this is my StepDef

package org.agileware.stepdefs;

import cucumber.api.java.en.Given;
import cucumber.api.java.en.Then;
import cucumber.api.java.en.When;

public class StepDef {

@Given("something$")
public void given() {
System.out.println("Given");
}
@When("an event occurs")
public void when() {
System.out.println("When");
}
@Then("something else happens")
public void then() {
System.out.println("Then");
}
}
--
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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Van
2015-10-08 09:43:31 UTC
Permalink
Hi Roberto,

Every thing is same like mine. Not sure what is wrong here. Just for
re-confirmation, your JUnitWraper and Feature files are in one project and
Stepdefs are in a different jar correct?

Thanks,
Pavan
Post by Roberto Lo Giacco
Post by Van
Hey Roberto,
I am sorry ... just saw your message. Still no luck :(
I am not able to download your attachment ... it shows just 1KB. Is it
possible to share the code in *JUnitWrapper?*
It shows 1kB because it is very small...
Anyway, this is my *very complex* JUnitWrapper
package org.agileware;
import org.junit.runner.RunWith;
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
@RunWith(Cucumber.class)
@CucumberOptions(features="src/test/resources")
public class JUnitWrapper {
}
this is my feature file
Feature: feature description
@xyz
Scenario: test
Given something
When an event occurs
Then something else happens
and this is my StepDef
package org.agileware.stepdefs;
import cucumber.api.java.en.Given;
import cucumber.api.java.en.Then;
import cucumber.api.java.en.When;
public class StepDef {
@Given("something$")
public void given() {
System.out.println("Given");
}
@When("an event occurs")
public void when() {
System.out.println("When");
}
@Then("something else happens")
public void then() {
System.out.println("Then");
}
}
--
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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Roberto Lo Giacco
2015-10-08 10:27:38 UTC
Permalink
Post by Van
Hi Roberto,
Every thing is same like mine. Not sure what is wrong here. Just for
re-confirmation, your JUnitWraper and Feature files are in one project and
Stepdefs are in a different jar correct?
Yes Pavan, if you download the file you will find the whole directory
structure and the poms as well. I build and install the stepdefs using one
POM and use the stepdefs in the other project. Obviously the stepdefs
project is a dependency of the features project.

The file I've attached is not a ZIP, but a 7Z, you can use 7Zip to open it.
I double checked and it can be downloaded and opened, the size is correct
as it contains a few text files only.
Post by Van
Post by Roberto Lo Giacco
Post by Van
Hey Roberto,
I am sorry ... just saw your message. Still no luck :(
I am not able to download your attachment ... it shows just 1KB. Is it
possible to share the code in *JUnitWrapper?*
It shows 1kB because it is very small...
Anyway, this is my *very complex* JUnitWrapper
package org.agileware;
import org.junit.runner.RunWith;
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
@RunWith(Cucumber.class)
@CucumberOptions(features="src/test/resources")
public class JUnitWrapper {
}
this is my feature file
Feature: feature description
@xyz
Scenario: test
Given something
When an event occurs
Then something else happens
and this is my StepDef
package org.agileware.stepdefs;
import cucumber.api.java.en.Given;
import cucumber.api.java.en.Then;
import cucumber.api.java.en.When;
public class StepDef {
@Given("something$")
public void given() {
System.out.println("Given");
}
@When("an event occurs")
public void when() {
System.out.println("When");
}
@Then("something else happens")
public void then() {
System.out.println("Then");
}
}
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to a topic in the
Google Groups "Cukes" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/cukes/Rd83aDHSgMA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Van
2015-10-11 03:52:45 UTC
Permalink
Hi Roberto,
Thanks for your time. I am still facing same issue :( I guess some version
or configuration my machine is causing the problem.
Here are the steps i followed:
Downloaded the code.
Built stepdefs-0.0.1-SNAPSHOT.jar
Did a mvn install
Ran it

Please find the output of each command pasted below. Please correct me if i
am doing anything wrong.

******************************************************************************************************************************************************************************
*mvn install:install-file
-Dfile=/Users/Van/Downloads/sample/stepdefs-0.0.1-SNAPSHOT.jar
-DgroupId=org.agileware.cucumber -DartifactId=stepdefs
-Dversion=0.0.1-SNAPSHOT -Dpackaging=jar*
[INFO] Scanning for projects...
[INFO]

[INFO]
------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO]
------------------------------------------------------------------------
[INFO]
[INFO] --- maven-install-plugin:2.4:install-file (default-cli) @
standalone-pom ---
[INFO] Installing /Users/Van/Downloads/sample/stepdefs-0.0.1-SNAPSHOT.jar
to
/Users/Van/.m2/repository/org/agileware/cucumber/stepdefs/0.0.1-SNAPSHOT/stepdefs-0.0.1-SNAPSHOT.jar
[INFO] Installing
/var/folders/4d/hys7608d4b1_3p0zd9n0_pm8jp3v4w/T/mvninstall5662068565063637057.pom
to
/Users/Van/.m2/repository/org/agileware/cucumber/stepdefs/0.0.1-SNAPSHOT/stepdefs-0.0.1-SNAPSHOT.pom
[INFO]
------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 0.386 s
[INFO] Finished at: 2015-10-10T18:04:44-07:00
[INFO] Final Memory: 7M/245M
[INFO]
------------------------------------------------------------------------

******************************************************************************************************************************************************************************

*mvn test -Dcucumber.options="--tags @xyz --glue org.agileware.stepdefs"
-Dtest=JUnitWrapper*
[INFO] Scanning for projects...
[INFO]

[INFO]
------------------------------------------------------------------------
[INFO] Building project 0.0.1-SNAPSHOT
[INFO]
------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @
project ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered
resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ project ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources)
@ project ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered
resources, i.e. build is platform dependent!
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @
project ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ project ---
[INFO] Surefire report directory:
/Users/Van/Downloads/sample/project/target/surefire-reports

-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running org.agileware.JUnitWrapper

1 Scenarios (1 undefined)
3 Steps (3 undefined)
0m0.000s


You can implement missing steps with the snippets below:

@Given("^something$")
public void something() throws Throwable {
// Write code here that turns the phrase above into concrete actions
throw new PendingException();
}

@When("^an event occurs$")
public void an_event_occurs() throws Throwable {
// Write code here that turns the phrase above into concrete actions
throw new PendingException();
}

@Then("^something else happens$")
public void something_else_happens() throws Throwable {
// Write code here that turns the phrase above into concrete actions
throw new PendingException();
}

Tests run: 5, Failures: 0, Errors: 0, Skipped: 4, Time elapsed: 0.332 sec

Results :

Tests run: 5, Failures: 0, Errors: 0, Skipped: 4

[INFO]
------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 1.492 s
[INFO] Finished at: 2015-10-10T20:02:07-07:00
[INFO] Final Memory: 9M/245M
[INFO]
------------------------------------------------------------------------

******************************************************************************************************************************************************************************

*mvn --version*
Apache Maven 3.2.5 (12a6b3acb947671f09b81f49094c53f426d8cea1;
2014-12-14T09:29:23-08:00)
Maven home: /Users/Van/Documents/apache-maven-3.2.5
Java version: 1.7.0_71, vendor: Oracle Corporation
Java home:
/Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.9.5", arch: "x86_64", family: "mac"
******************************************************************************************************************************************************************************


Thanks,
Pavan
Post by Roberto Lo Giacco
Post by Van
Hi Roberto,
Every thing is same like mine. Not sure what is wrong here. Just for
re-confirmation, your JUnitWraper and Feature files are in one project and
Stepdefs are in a different jar correct?
Yes Pavan, if you download the file you will find the whole directory
structure and the poms as well. I build and install the stepdefs using one
POM and use the stepdefs in the other project. Obviously the stepdefs
project is a dependency of the features project.
The file I've attached is not a ZIP, but a 7Z, you can use 7Zip to open
it. I double checked and it can be downloaded and opened, the size is
correct as it contains a few text files only.
Post by Van
Post by Roberto Lo Giacco
Post by Van
Hey Roberto,
I am sorry ... just saw your message. Still no luck :(
I am not able to download your attachment ... it shows just 1KB. Is it
possible to share the code in *JUnitWrapper?*
It shows 1kB because it is very small...
Anyway, this is my *very complex* JUnitWrapper
package org.agileware;
import org.junit.runner.RunWith;
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
@RunWith(Cucumber.class)
@CucumberOptions(features="src/test/resources")
public class JUnitWrapper {
}
this is my feature file
Feature: feature description
@xyz
Scenario: test
Given something
When an event occurs
Then something else happens
and this is my StepDef
package org.agileware.stepdefs;
import cucumber.api.java.en.Given;
import cucumber.api.java.en.Then;
import cucumber.api.java.en.When;
public class StepDef {
@Given("something$")
public void given() {
System.out.println("Given");
}
@When("an event occurs")
public void when() {
System.out.println("When");
}
@Then("something else happens")
public void then() {
System.out.println("Then");
}
}
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to a topic in the
Google Groups "Cukes" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/cukes/Rd83aDHSgMA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Roberto Lo Giacco
2015-10-11 09:35:45 UTC
Permalink
Post by Van
Hi Roberto,
Thanks for your time. I am still facing same issue :( I guess some
version or configuration my machine is causing the problem.
If this is the case than you should run Maven with the -X option and
capture all the console contents in a file, then attach the file
--
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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Van
2015-10-11 14:59:33 UTC
Permalink
Please find it attached.
Post by Roberto Lo Giacco
Post by Van
Hi Roberto,
Thanks for your time. I am still facing same issue :( I guess some
version or configuration my machine is causing the problem.
If this is the case than you should run Maven with the -X option and
capture all the console contents in a file, then attach the file
--
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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Van
2016-01-25 07:52:58 UTC
Permalink
Hi Roberto,

I did not look into this for a while. I just tried on a new mac ... It is
working now. Like i mentioned there might be some configuration issue on my
old mac.

Many thanks for all your help!

Thanks,
Pavan
Post by Van
Please find it attached.
Post by Roberto Lo Giacco
Post by Van
Hi Roberto,
Thanks for your time. I am still facing same issue :( I guess some
version or configuration my machine is causing the problem.
If this is the case than you should run Maven with the -X option and
capture all the console contents in a file, then attach the file
--
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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
s***@xurmo.com
2016-08-23 04:13:26 UTC
Permalink
Roberto/Van,

I stumbled upon the same exact issue. However, it does not work the setpdef
is from a different project when I run via Maven profile it says no
matching steps. But there is another baseclass from that jar which I use
and that works fine for setting up the webdriver.

Anything that I have missed in the pom configuration. Please hep
Post by Van
Hi Roberto,
I did not look into this for a while. I just tried on a new mac ... It is
working now. Like i mentioned there might be some configuration issue on my
old mac.
Many thanks for all your help!
Thanks,
Pavan
Post by Van
Please find it attached.
Post by Roberto Lo Giacco
Post by Van
Hi Roberto,
Thanks for your time. I am still facing same issue :( I guess some
version or configuration my machine is causing the problem.
If this is the case than you should run Maven with the -X option and
capture all the console contents in a file, then attach the file
--
<http://xurmo.com>
Xurmo Technologies Pvt. Ltd., Silver Software Tech Park, Plot No. 23 & 24,
II Floor, EPIP 1st Phase, KIADB, Whitefield, Bangalore - 560 066 |
+918040314000 [T]

<http://xurmo.com>www.xurmo.com

*Disclaimer**: This message contains confidential information and is
intended only for the individual named. If you are not the named addressee
you should not disseminate, distribute or copy this e-mail. Please notify
the sender immediately by e-mail if you have received this e-mail by
mistake, please delete this e-mail from your system. E-mail transmission
cannot be guaranteed to be secure or error-free as information could be
intercepted, corrupted, lost, destroyed, arrive late or incomplete, or
contain viruses. The sender therefore does not accept liability for any
errors or omissions in the contents of this message, which arise as a
result of e-mail transmission.*
--
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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Mahiteja Bollojula
2018-08-02 19:12:36 UTC
Permalink
Hi ,

Can you please let me know how you executed the feature file by reading the
step definitions classes from jar file, Thanks in advance for your support
and help

Thanks
Mahiteja
Post by Van
Hi Roberto,
I did not look into this for a while. I just tried on a new mac ... It is
working now. Like i mentioned there might be some configuration issue on my
old mac.
Many thanks for all your help!
Thanks,
Pavan
Post by Van
Please find it attached.
Post by Roberto Lo Giacco
Post by Van
Hi Roberto,
Thanks for your time. I am still facing same issue :( I guess some
version or configuration my machine is causing the problem.
If this is the case than you should run Maven with the -X option and
capture all the console contents in a file, then attach the file
--
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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Cleber Baldan Jr
2018-08-28 14:05:06 UTC
Permalink
Hello.

I just had this idea, to have common step definitions stored in a jar file.
Anyone had any luck on making this work?

Thanks!
Post by Van
Hello!
How can we glue step definition from a .jar file?
For example, i have couple of projects with different feature files. Most
of the step definitions are common. Can i keep these step definitions in a
.jar file and pass the package name to cucumber "--glue" option? I tried
doing it but it says steps are undefined. Is there anyway to use these step
definitions as a common library? so that i do not have to maintain the same
code in different projects?
BTW - I am running them as a Maven command.
Appreciate your help! Please feel free to bug me for more details.
Thanks,
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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Cleber Baldan Jr
2018-08-28 14:20:14 UTC
Permalink
I'm not actively working on this, but this guy seems to know what he is
talking about:

https://stackoverflow.com/a/43115177/705147
Post by Van
Hello!
How can we glue step definition from a .jar file?
For example, i have couple of projects with different feature files. Most
of the step definitions are common. Can i keep these step definitions in a
.jar file and pass the package name to cucumber "--glue" option? I tried
doing it but it says steps are undefined. Is there anyway to use these step
definitions as a common library? so that i do not have to maintain the same
code in different projects?
BTW - I am running them as a Maven command.
Appreciate your help! Please feel free to bug me for more details.
Thanks,
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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Bill Wright
2018-08-29 13:24:45 UTC
Permalink
I've been doing this sort of thing for years and it's quite easy. First,
you need to have the jar file on your class path (or in your dependencies,
if you use Maven or Gradle to build). Then you just need to reference the
package in your glue parameter that you pass to the CucumberRunner.
Post by Van
Hello!
How can we glue step definition from a .jar file?
For example, i have couple of projects with different feature files. Most
of the step definitions are common. Can i keep these step definitions in a
.jar file and pass the package name to cucumber "--glue" option? I tried
doing it but it says steps are undefined. Is there anyway to use these step
definitions as a common library? so that i do not have to maintain the same
code in different projects?
BTW - I am running them as a Maven command.
Appreciate your help! Please feel free to bug me for more details.
Thanks,
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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...