Page History
...
Warning | ||
---|---|---|
| ||
This proprietary Maven plugin has been deprecated in favour favor of a new open-source plugin maintained by the open-source community; this means that no new features will be added to this plugin. The two plugins are not compatible, so you should plan the migration to the new open-source plugin. The open-source Maven plugin has a broader feature set and users are recommended to give it a try; support for the open-source plugin should be handled through the respective GitHub project, and is in line with regular open-source projects. In other words, users can report issues, ideas, but they are also ncouraged encouraged to make contributions. There is no SLA whatsoever for issues raised on this open-source project, as issues will be handled on a best effort by the community itself. |
Table of Contents |
---|
Warninginfo | |||||
---|---|---|---|---|---|
| |||||
Starting in version 1.1.1, beware that the repository URL changed to https://maven.getxray.app:443 You must update the repository to the following:
|
...
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 | ||
---|---|---|
| ||
The user present in the properties below must exist in the JIRA instance and have permission to Create Test and Test Execution Issues |
...
Info | ||
---|---|---|
| ||
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) | Description | Support for multipart endpoint |
---|---|---|
JUNIT | JUnit XML output format (more information regarding its endpoints here) | |
TESTNG | TestNG XML output format (more information regarding its endpoints here) |
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 | ||||
---|---|---|---|---|
| ||||
<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 | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
<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
- 1.0.0 - 9 May 2017
- Import JUnit results: You can import the JUnit results to Xray either as an XML file or a folder with multiple XML files.
- 1.1.0 - xx xx 2019
- Import TestNG results: You can import the TestNG results to Xray either as an XML file or a folder with multiple XML files;
- Support for JUnit and TestNG multipart endpoints.
- 1.1.1 - 17 December 2021
- Bump log4j to version 2.16.0 due to critical security vulnerabilities:
- 1.1.2 - 20 December 2021
- Bump log4j to version 2.17.0 due to critical security vulnerability: