The Software Package Data Exchange (SPDX) specification is a standard format for communicating the components, licenses and copyrights associated with a software package.
These tools are published by the SPDX Workgroup see http://spdx.org/
The SPDX Tool binaries can be downloaded from the releases page under the respective release. The package is also available in Maven Central (organization org.spdx, artifact tools-java).
See the Syntax section below for the commands available.
If are a developer, there are examples in the examples folder.
See the file CONTRIBUTING.md for information on making contributions to the SPDX tools.
Report any security related issues by sending an email to spdx-tools-security@lists.spdx.org
Non-security related issues should be added to the SPDX tools issues list
The command line interface of the spdx tools can be used like this:
java -jar spdx-tools-jar-with-dependencies.jar <function> <parameters>
The following converter tools support spdx format:
- Tag
- RDF/XML
- XLSX Spreadsheet
- XLS Spreadsheet
- JSON
- XML
- YAML
Example to convert a SPDX file from tag to rdf format:
java -jar spdx-tools-jar-with-dependencies.jar Convert Examples/SPDXTagExample.tag TagToRDF.rdf
The following tools can be used to compare one or more SPDX documents:
-
CompareMultipleSpdxDocs with files
Example to compare multiple SPDX files provided in rdf format and provide a spreadsheet with the results:
java -jar spdx-tools-jar-with-dependencies.jar CompareMultipleSpdxDocs output.xlsx doc1 doc2 ... docN
-
CompareMultipleSpdxDocs with directory
Example to compare all SPDX documents in a directory "/home/me/spdxdocs" and provide a spreadsheet with the results:
java -jar spdx-tools-jar-with-dependencies.jar CompareMultipleSpdxDocs output.xlsx /home/me/spdxdocs
The following tool can be used to "Pretty Print" an SPDX document.
- SPDXViewer
Sample usage:
java -jar spdx-tools-jar-with-dependencies.jar SPDXViewer TestFiles/SPDXRdfExample.rdf
The following tool can be used to verify an SPDX document:
- Verify
Sample usage:
java -jar spdx-tools-jar-with-dependencies.jar Verify TestFiles/SPDXRdfExample.rdf
The following tool can be used to generate an SPDX verification code from a directory of source files:
- GenerateVerificationCode sourceDirectory
Sample usage:
java -jar spdx-tools-jar-with-dependencies.jar GenerateVerificationCode sourceDirectory [ignoredFilesRegex]
The SPDX Workgroup provides an online interface to validate, compare, and convert SPDX documents in addition to the command line options above. The SPDX Validation Tool is an all-in-one portal to upload and parse SPDX documents for validation, comparison and conversion and search the SPDX license list.
A complete SPDX file is available including dependencies is available in the bintray and Maven repos.
SPDX-License-Identifier: Apache-2.0
PackageLicenseDeclared: Apache-2.0
You need Apache Maven to build the project:
mvn clean install
To update Spdx-Tools-Library, the following is a very brief checklist:
- Update the properties files in the org.spdx.tag package for any new tag values
- Update the org.spdx.tag.CommonCode.java for any new or changed tag values. This will implement both the rdfToTag and the SPDXViewer applications.
- Update the org.spdx.tag.BuildDocument to implement changes for the TagToRdf application
- Update the HTML template (resources/htmlTemplate/SpdxHTMLTemplate.html) and contexts in org.spdx.html to implement changes for the SpdxToHtml application
- Update the related sheets and RdfToSpreadsheet.java file in the package org.spdx.spreadsheet
- Update the sheets for SPDX compare utility