What does the Maven verify command do?
Asked Answered
Q

2

27

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?

Quincy answered 18/12, 2018 at 21:11 Comment(0)
I
13

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.

Incorporating answered 19/12, 2018 at 0:35 Comment(0)
L
0

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
Live answered 20/7 at 17:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.