Working with a large multi-module maven project. Want to run phases as follows
mvn clean install -DskipTests
Then run unit tests. But this fails, even though code is already compiled
mvn surefire:test
I ran the mvn command to my mulesoft project but it cannot detect anything.
I doubt if it is possible analyze the mulesoft projects with sonarqube.
can you help me?
mvn sonar:sonar -Dsonar.projectKey=jde -Dsonar.host.url=http://localhost:9000 -Dsonar.login=XXXXXXXXXXX
mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent test -Dmaven.test.failure.ignore=true -Dtest="" -=automation-credentials.properties && mvn install && mvn sonar:sonar
it'll help you to test the application
I am looking to just run jacoco as maven target instead of running clean install
I have been using following commamd with cobertura. Is there a similar way to run the jacoco.
mvn cobertura:cobertura
Regards
Lalit Kumar
I am trying run cucumber tests using maven with following command
mvn test -Dcucumber.options="--tag #debug1"
This command works fine, however if i try something like following, i get error
mvn test -Dcucumber.options="--tag #debug1 #debug2"
Is there a way to pass in multiple tag names with cucumber run-time options?
To run scenarios with #debug1 and #debug2:
Old version of Cucumber-jvm:
mvn test -Dcucumber.options="--tags #debug1 --tags #debug2"
Actual version of Cucumber-jvm:
mvn test -Dcucumber.options="--tags '#debug1 and #debug2'"
To run scenarios with #debug1 or #debug2:
Old version of Cucumber-jvm:
mvn test -Dcucumber.options="--tags #debug1,#debug2"
Actual version of Cucumber-jvm:
mvn test -Dcucumber.options="--tags '#debug1 or #debug2'"
In Cucumber 6, property name has changed. Use:
mvn verify -Dcucumber.filter.tags="#debug1 or #debug2"
For me what was working with surefire plugin:
mvn clean test -D"cucumber.filter.tags=#tag1 or #tag2"
When I tried with this version:
mvn clean test -Dcucumber.filter.tags="not #MyTag"
I got this exception:
io.cucumber.core.exception.CucumberException: Failed to parse 'cucumber.filter.tags' with value '"not #MyTag"'
Caused by: io.cucumber.tagexpressions.TagExpressionException: Tag expression '"not #MyTag"' could not be parsed because of syntax error: expected operator
Little late to the party, but I am using something like:
mvn test -D tags="debug1 and debug2"
I am on Cucumber 2.4.
The # symbol is optional. You can use a tags Maven property. And you can use boolean logic to hook up multiple tags - official docs.
Reduces the amount of typing little bit.
I using this commandline to run multiple tags
mvn test -Dcucumber.options="--tags '#tag1 or #tag2' --plugin io.qameta.allure.cucumber4jvm.AllureCucumber4Jvm --plugin rerun:rerun/failed_scenarios.txt"
Cucumber version 4.2.6
In cucumber v5.X, only mvn test -Dcucumber.options="--tags '#debug1 or #debug2'"
is supported and working.
mvn test -Dcucumber.options="--tags '#debug1 and #debug2'" is not working and either scenarios won't get executed
for version 6.10.2 Cucumber and Junit 4.12
mvn test "-Dcucumber.filter.tags= (#Tag1 or #Tag2) and not #Tag3"
where "or" is equal to "and".... for no reason (thanks Cucumber...)
for cucumber 6 use: mvn clean test -D"cucumber.filter.tags=#smoke or #dev"
for cucumber 4 use: mvn clean test -D"cucumber.options.tags=#smoke or #dev"
mvn clean verify -D tags="tagName"
I have seen sonar builds failing if I run mvn package or mvn verify as build goals, however if I change it to mvn install it passes.
Can you explain why maven install goal is needed for sonar to work properly?
In a multi-module build an aggregator plugin can't resolve dependencies from target folder. So you have two options:
mvn clean install && mvn sonar:sonar as two separate processes
mvn clean package sonar:sonar as a single reactor