kaka
kaka

Reputation: 835

What does the Maven verify command do?

It says in the documentation that the verify phase in the build lifecycle

run any checks on results of integration tests to ensure quality criteria are met

What does this exactly mean?

Upvotes: 29

Views: 42560

Answers (2)

robertomessabrasil
robertomessabrasil

Reputation: 11

Veirfy can also be used by Sonarqube

mvn clean verify sonar:sonar   -Dsonar.projectKey=JWatch   -Dsonar.projectName='JWatch'   -Dsonar.host.url=http://localhost:9000   -Dsonar.token=mytoken

Upvotes: 0

nortontgueno
nortontgueno

Reputation: 2821

The verify phase will indeed verify the integration tests results, if one or more results have failed or not.

How can you run those tests in your Maven?

Usually the maven-failsafe-plugin is used to orchestrate the lifecycle of the integration tests, it has two goals:

  1. failsafe:integration-test runs the integration tests of an application.
  2. failsafe:verify verifies that the integration tests of an application passed.

In the case of the verify goal, as per documentation:

Binds by default to the lifecycle phase: verify.

In the usage section of the documentation you can check some more discussion around the verify for each testing provider it is available

For this particular piece of configuration, the verify will check if some of summary files have any failures:

<execution> 
  <id>verify</id>
  <goals>
    <goal>verify</goal>
  </goals>
  <configuration>
    <summaryFiles>
      <summaryFile>target/failsafe-reports/failsafe-summary-red-bevels.xml</summaryFile>
      <summaryFile>target/failsafe-reports/failsafe-summary-no-bevels.xml</summaryFile>
    </summaryFiles>
  </configuration>
</execution>

Edit 1

Some interesting article can be found in here around the maven configuration for this.

Upvotes: 14

Related Questions