Use the gauge-maven-plugin to execute specifications in your gauge java project and manage dependencies using maven.

Creating a new project from archetype

mvn archetype:generate -DgroupId={projectGroupId}

Set {projectGroupId} and {projectArtifactId} based on your project. See maven docs to understand what groupId and artifactId mean in a maven project.

Gauge maven project creation in IDE

The generated pom.xml in the project will have the gauge-java dependency and a gauge:execute goal defined in the test phase.

<project xmlns="" xmlns:xsi=""




Executing specs using maven

If the execute goal is added for test phase (see above xml) then running maven test phase will also execute gauge specs in the project

mvn test

To only run gauge specs,

mvn gauge:execute -DspecsDir=specs

To only run gauge specs that correspond to a particular test profile in pom.xml,

mvn gauge:execute -P <profile-name>

Execute specs In parallel

mvn gauge:execute -DspecsDir=specs -DinParallel=true

Execute specs by tags

mvn gauge:execute -DspecsDir=specs -Dtags="!in-progress"

Specifying execution environment

mvn gauge:execute -DspecsDir=specs -Denv="dev"

All additional Properties

The following plugin properties can be additionally set:

Property name Usage Description
specsDir -DspecsDir=specs Gauge specs directory path. Required for executing specs
tags -Dtags="tag1 & tag2" Filter specs by specified tags expression
inParallel -DinParallel=true Execute specs in parallel
nodes -Dnodes=3 Number of parallel execution streams. Use with parallel
env -Denv=qa gauge env to run against
dir -Ddir=. Set working directory for gauge. Default is project.basedir.
flags -Dflags="--verbose" Add additional gauge flags to execution

See gauge's command line interface for list of all flags that be used with -Dflags option.

results matching ""

    No results matching ""