Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The plugin supports single or multi-module projects and multiple test frameworks. With the execution of a single Maven target com.xpandit.xray:xray-maven-plugin:<goal-name>, the plugin will upload the results of the tests to your Jira instance.

List of Available Properties

Info
titlePlease note

The user present in the properties below must exist in the JIRA instance and have permission to Create Test and Test Execution Issues

...

Info
titlePlease note

You may configure the plugin properties in your project pom.xml, the settings.xml file (see project guidelines below) or via the console with -D option (e.g., -Dxray.projectKey=PROJ).

List of Available Result Formats

Each result format points to a specific Xray REST Endpoint where the results are imported. The result format is configured in the property xray.resultsFormat and is case-sensitive.

Results Format (xray.resultsFormat)

DescriptionSupport for multipart endpoint
JUNITJUnit XML output format (more information regarding its endpoints here) (tick)
TESTNGTestNG XML output format (more information regarding its endpoints here)(tick)

Uploading the results to a specific endpoint

Xray-Maven-Plugin provides two plugin specific goals to upload the results to a specific endpoint:

...

Code Block
mvn com.xpandit.xray:xray-maven-plugin:<goal-name> 

Maven Project Guidelines

There are three options when configuring the properties listed in the 'List of Available Properties': via settings.xml, via the Project's POM file or via the console with -D option (e.g., -Dxray.projectKey=PROJ).

...

  • Generate the Junit XML results file;
  • Upload the results to a JIRA instance with a specific address, based on a specific credential info.
  • Associate the results to a new Test Execution with Fix Version 'V1.0', in the Test Environment 'Android', in an existing Test Plan issue;

Settings.xml

The plugin properties can be specified in the settings.xml file. In this example, in the <properties> tag, we configured the address of the JIRA instance and the credentials of the JIRA user. These properties will be within the Active Profile identified by the id 'MyActiveProfile'.

Code Block
languagexml
title~/.m2/settings.xml
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd" xmlns="http://maven.apache.org/SETTINGS/1.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <!-- OTHER CONFS-->
  <profiles>
    <profile>
	<!-- OTHER CONFS-->
      <properties>
        <xray.jiraURL>http://localhost:8080</xray.jiraURL>
        <xray.username>admin</xray.username>
        <xray.password>password</xray.password>
      </properties>
    <id>MyActiveProfile</id>
    </profile>
  </profiles>
  <activeProfiles>
    <activeProfile>MyActiveProfile</activeProfile>
  </activeProfiles>
</settings>


POM.xml - Simple Project

The plugin properties listed in 'List of Available Properties' can be scoped to a specific Project, by specifying them in the Project's POM.xml.

...

Code Block
mvn clean package surefire:test com.xpandit.xray:xray-maven-plugin:xray

Importing the execution results with user-defined field values

If we wanted to upload the Junit results to a newly created Test Execution Issue and having control over its fields, for instance by creating it with a custom Issue Summary, then the option is to use the multipart endpoint.

...

Code Block
mvn clean package surefire:test com.xpandit.xray:xray-maven-plugin:xray_multipart

POM.xml - Multi-Module Project

The Xray-Maven-Plugin can also be used with Multi-Module Projects.

...

Code Block
languagexml
themeConfluence
titleModuleA.pom
linenumberstrue
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
                             http://maven.apache.org/maven-v4_0_0.xsd">
    <!-- CONF's -->
    <name>Module A</name>

    <properties>
        <!--XRay Properties -->
        <xray.surefire.location>${basedir}/target/surefire-reports</xray.surefire.location>
        <!--End Xray Properties -->
    </properties>
</project>

Troubleshooting

Unable to upload the results file: The process is failing with status code 403

The importing of the execution results file failed and when you check the log, it shows the following:

...

If you are a Jira administrator, you can go to Jira administration > User Management and reset the failed login.


Version History