百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
T

tools-java

> 编程语言
开源

使用 Spdx-Java-Library 的 SPDX 命令行工具

99 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

使用 Spdx-Java-Library 的 SPDX 命令行工具

SPDX Tools

A command-line utility for creating, converting, comparing, and validating SPDX documents across multiple formats.

The Software Package Data Exchange (SPDX) specification is a standard format for communicating the components, licenses and copyrights associated with a software package.

  • SPDX License List
  • SPDX Vocabulary Specification

These tools are published by the SPDX Workgroup, see

Versions Supported

This utility supports versions 2.0, 2.1, 2.2, 2.3 and 3.0.1 of the SPDX specification.

Code quality badges

Getting Starting

The SPDX Tools 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 you are a developer, there are examples in the examples folder.

Syntax

The command line interface of the SPDX Tools can be used like this:

java -jar tools-java-2.0.7-jar-with-dependencies.jar  

SPDX format converters

The following converter tools support SPDX format:

  • Tag
  • RDF/XML
  • XLSX Spreadsheet
  • XLS Spreadsheet
  • JSON
  • XML
  • YAML
  • JSON-LD (SPDX spec version 3.0.1)

Example to convert a SPDX file from Tag to RDF format:

java -jar tools-java-2.0.7-jar-with-dependencies.jar Convert ../testResources/SPDXTagExample-v2.2.spdx TagToRDF.rdf

The file formats can optionally be provided as the 3rd and 4th parameter for the input and output formats respectively. An optional 5th option excludeLicenseDetails will not copy the listed license properties to the output file. The following example will copy a JSON format to an RDF Turtle format without including the listed license properties:

java -jar tools-java-2.0.7-jar-with-dependencies.jar Convert ../testResources/SPDXTagExample-v2.2.spdx TagToRDF.ttl TAG RDFTTL excludeLicenseDetails

To convert from SPDX 2 to SPDX 3.0.1:

  • use the file extension .spdx3.json or .jsonld.json or .jsonld;

  • or add the options for the from and to file types:

    java -jar tools-java-2.0.7-jar-with-dependencies.jar Convert hello.spdx hello.spdx.json TAG JSONLD

Compare utilities

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 tools-java-2.0.7-jar-with-dependencies.jar CompareDocs 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 tools-java-2.0.7-jar-with-dependencies.jar CompareDocs output.xlsx /home/me/spdxdocs

SPDX Viewer

The following tool can be used to "Pretty Print" an SPDX document.

  • SPDXViewer

Sample usage:

java -jar tools-java-2.0.7-jar-with-dependencies.jar SPDXViewer ../testResources/SPDXRdfExample-v2.2.spdx.rdf

Verifier

The following tool can be used to verify an SPDX document:

  • Verify

Sample usage:

java -jar tools-java-2.0.7-jar-with-dependencies.jar Verify ../testResources/SPDXRdfExample-v2.2.spdx.rdf

Generators

The following tool can be used to generate an SPDX verification code from a directory of source files:

  • GenerateVerificationCode sourceDirectory

    Sample usage:

      java -jar tools-java-2.0.7-jar-with-dependencies.jar GenerateVerificationCode sourceDirectory [ignoredFilesRegex]

SPDX Validation Tool

The SPDX Workgroup provides an online interface to validate, compare, and convert SPDX documents in addition to the command line options above.

The SPDX Online Tools is an all-in-one portal to upload and parse SPDX documents for validation, comparison and conversion and search the SPDX license list.

License

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

Development

Build

You need Apache Maven to build the project:

mvn clean install

Contributing

See the file CONTRIBUTING.md for information on making contributions to the SPDX tools.

Issues

Report any security related issues by sending an email to [email protected]

Non-security related issues should be added to the SPDX Tools issues list

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Java

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言