Archetype without running tests with maven integration
pretep22 opened this issue ยท 1 comments
pretep22 commented
๐ What did you see?
By using the Archetype on the tutorials-page https://cucumber.io/docs/guides/10-minute-tutorial/?lang=java resp. https://github.com/cucumber/docs/blob/main/content/docs/guides/10-minute-tutorial.md I found that the project that was created, could run the test from my IDE.
But running mvn test
did not find any tests.
โ What did you expect to see?
I'd expect that my tests would run if I type mvn test
.
๐ฆ Which tool/library version are you using?
Most actual version from Homepage.
๐ฌ How could we reproduce it?
Call that command on page mentioned above - and try mvn test
.
(I fixed that by adding some (or just one) depandeny to the generated pom.xml... Don't ask, what I nedded to change ;-) )
<dependencies>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-junit-platform-engine</artifactId>
<!-- artifactId>junit-jupiter-engine</artifactId -->
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-suite</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-junit</artifactId>
</dependency>
</dependencies>
mpkorstanje commented
I'm afraid I can't reproduce this.
mpkorstanje@nyx:/tmp/test$ mvn archetype:generate \
"-DarchetypeGroupId=io.cucumber" \
"-DarchetypeArtifactId=cucumber-archetype" \
"-DarchetypeVersion=7.5.0" \
"-DgroupId=hellocucumber" \
"-DartifactId=hellocucumber" \
"-Dpackage=hellocucumber" \
"-Dversion=1.0.0-SNAPSHOT" \
"-DinteractiveMode=false"
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------< org.apache.maven:standalone-pom >-------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] >>> maven-archetype-plugin:3.2.1:generate (default-cli) > generate-sources @ standalone-pom >>>
[INFO]
[INFO] <<< maven-archetype-plugin:3.2.1:generate (default-cli) < generate-sources @ standalone-pom <<<
[INFO]
[INFO]
[INFO] --- maven-archetype-plugin:3.2.1:generate (default-cli) @ standalone-pom ---
[INFO] Generating project in Batch mode
[INFO] Archetype repository not defined. Using the one from [io.cucumber:cucumber-archetype:7.9.0] found in catalog remote
[INFO] ----------------------------------------------------------------------------
[INFO] Using following parameters for creating project from Archetype: cucumber-archetype:7.5.0
[INFO] ----------------------------------------------------------------------------
[INFO] Parameter: groupId, Value: hellocucumber
[INFO] Parameter: artifactId, Value: hellocucumber
[INFO] Parameter: version, Value: 1.0.0-SNAPSHOT
[INFO] Parameter: package, Value: hellocucumber
[INFO] Parameter: packageInPathFormat, Value: hellocucumber
[INFO] Parameter: package, Value: hellocucumber
[INFO] Parameter: groupId, Value: hellocucumber
[INFO] Parameter: artifactId, Value: hellocucumber
[INFO] Parameter: version, Value: 1.0.0-SNAPSHOT
[INFO] Project created from Archetype in dir: /tmp/test/hellocucumber
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.255 s
[INFO] Finished at: 2022-12-16T14:50:19+01:00
[INFO] ------------------------------------------------------------------------
mpkorstanje@nyx:/tmp/test$ cd hellocucumber/
mpkorstanje@nyx:/tmp/test/hellocucumber$ mvn test
[INFO] Scanning for projects...
[INFO]
[INFO] --------------------< hellocucumber:hellocucumber >---------------------
[INFO] Building hellocucumber 1.0.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ hellocucumber ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /tmp/test/hellocucumber/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.10.1:compile (default-compile) @ hellocucumber ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ hellocucumber ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.10.1:testCompile (default-testCompile) @ hellocucumber ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 2 source files to /tmp/test/hellocucumber/target/test-classes
[INFO]
[INFO] --- maven-surefire-plugin:3.0.0-M7:test (default-test) @ hellocucumber ---
[INFO] Using auto detected provider org.apache.maven.surefire.junitplatform.JUnitPlatformProvider
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running hellocucumber.RunCucumberTest
Scenario: The example # hellocucumber/example.feature:3
Given an example scenario # hellocucumber.StepDefinitions.anExampleScenario()
When all step definitions are implemented # hellocucumber.StepDefinitions.allStepDefinitionsAreImplemented()
Then the scenario passes # hellocucumber.StepDefinitions.theScenarioPasses()
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Share your Cucumber Report with your team at https://reports.cucumber.io โ
โ Activate publishing with one of the following: โ
โ โ
โ src/test/resources/cucumber.properties: cucumber.publish.enabled=true โ
โ src/test/resources/junit-platform.properties: cucumber.publish.enabled=true โ
โ Environment variable: CUCUMBER_PUBLISH_ENABLED=true โ
โ JUnit: @CucumberOptions(publish = true) โ
โ โ
โ More information at https://cucumber.io/docs/cucumber/environment-variables/ โ
โ โ
โ Disable this message with one of the following: โ
โ โ
โ src/test/resources/cucumber.properties: cucumber.publish.quiet=true โ
โ src/test/resources/junit-platform.properties: cucumber.publish.quiet=true โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.144 s - in hellocucumber.RunCucumberTest
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.918 s
[INFO] Finished at: 2022-12-16T14:50:35+01:00
[INFO] ------------------------------------------------------------------------