|
1 | | -# Overview |
| 1 | +# SPDX Tools |
| 2 | + |
| 3 | +[](https://javadoc.io/doc/org.spdx/tools-java) |
| 4 | + |
| 5 | +A command-line utility for creating, converting, comparing, |
| 6 | +and validating SPDX documents across multiple formats. |
| 7 | + |
2 | 8 | The Software Package Data Exchange (SPDX) specification is a standard format for communicating the components, licenses and copyrights associated with a software package. |
3 | 9 |
|
4 | | - * [SPDX License List](http://spdx.org/licenses/) |
5 | | - * [SPDX Vocabulary Specification](http://spdx.org/rdf/terms) |
| 10 | +* [SPDX License List](https://spdx.org/licenses/) |
| 11 | +* [SPDX Vocabulary Specification](https://spdx.org/specifications) |
6 | 12 |
|
7 | | -These tools are published by the SPDX Workgroup |
8 | | -see [http://spdx.org/](http://spdx.org/) |
| 13 | +These tools are published by the SPDX Workgroup, |
| 14 | +see <https://spdx.org/> |
9 | 15 |
|
10 | 16 | ## Versions Supported |
| 17 | + |
11 | 18 | This utility supports versions 2.0, 2.1, 2.2, 2.3 and 3.0.1 of the SPDX specification. |
12 | 19 |
|
13 | | -# Code quality badges |
| 20 | +## Code quality badges |
14 | 21 |
|
15 | | -| [](https://sonarcloud.io/dashboard?id=tools-java) | [](https://sonarcloud.io/dashboard?id=tools-java) | [](https://sonarcloud.io/dashboard?id=tools-java) | [](https://sonarcloud.io/dashboard?id=tools-java) | |
| 22 | +[](https://sonarcloud.io/dashboard?id=tools-java) |
| 23 | +[](https://sonarcloud.io/dashboard?id=tools-java) |
| 24 | +[](https://sonarcloud.io/dashboard?id=tools-java) |
| 25 | +[](https://sonarcloud.io/dashboard?id=tools-java) |
16 | 26 |
|
17 | 27 | ## Getting Starting |
18 | 28 |
|
19 | | -The SPDX Tool binaries can be downloaded from the [releases page](https://github.com/spdx/tools-java/releases) under the respective release. The package is also available in [Maven Central](https://search.maven.org/artifact/org.spdx/tools-java) (organization org.spdx, artifact tools-java). |
| 29 | +The SPDX Tools binaries can be downloaded from the [releases page](https://github.com/spdx/tools-java/releases) under the respective release. The package is also available in [Maven Central](https://search.maven.org/artifact/org.spdx/tools-java) (organization org.spdx, artifact tools-java). |
20 | 30 |
|
21 | 31 | See the Syntax section below for the commands available. |
22 | 32 |
|
23 | 33 | If you are a developer, there are examples in the [examples folder](examples/org/spdx/examples). |
24 | 34 |
|
25 | | -## Contributing |
26 | | -See the file CONTRIBUTING.md for information on making contributions to the SPDX tools. |
27 | | - |
28 | | -## Issues |
29 | | -Report any security related issues by sending an email to [spdx-tools-security@lists.spdx.org](mailto:spdx-tools-security@lists.spdx.org) |
30 | | - |
31 | | -Non-security related issues should be added to the [SPDX tools issues list](https://github.com/spdx/tools-java/issues) |
32 | | - |
33 | 35 | ## Syntax |
34 | | -The command line interface of the spdx tools can be used like this: |
35 | 36 |
|
36 | | - java -jar tools-java-2.0.0-RC2-jar-with-dependencies.jar <function> <parameters> |
| 37 | +The command line interface of the SPDX Tools can be used like this: |
| 38 | + |
| 39 | + java -jar tools-java-2.0.0-jar-with-dependencies.jar <function> <parameters> |
37 | 40 |
|
38 | 41 | ## SPDX format converters |
39 | | -The following converter tools support spdx format: |
40 | 42 |
|
41 | | - * Tag |
42 | | - * RDF/XML |
43 | | - * XLSX Spreadsheet |
44 | | - * XLS Spreadsheet |
45 | | - * JSON |
46 | | - * XML |
47 | | - * YAML |
48 | | - * JSON-LD (SPDX spec version 3.0.1) |
| 43 | +The following converter tools support SPDX format: |
49 | 44 |
|
50 | | -Example to convert a SPDX file from tag to rdf format: |
| 45 | +* Tag |
| 46 | +* RDF/XML |
| 47 | +* XLSX Spreadsheet |
| 48 | +* XLS Spreadsheet |
| 49 | +* JSON |
| 50 | +* XML |
| 51 | +* YAML |
| 52 | +* JSON-LD (SPDX spec version 3.0.1) |
51 | 53 |
|
52 | | - java -jar tools-java-2.0.0-RC2-jar-with-dependencies.jar Convert ../testResources/SPDXTagExample-v2.2.spdx TagToRDF.rdf |
| 54 | +Example to convert a SPDX file from Tag to RDF format: |
| 55 | + |
| 56 | + java -jar tools-java-2.0.0-jar-with-dependencies.jar Convert ../testResources/SPDXTagExample-v2.2.spdx TagToRDF.rdf |
53 | 57 |
|
54 | 58 | 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: |
55 | 59 |
|
56 | | - java -jar tools-java-2.0.0-RC2-jar-with-dependencies.jar Convert ../testResources/SPDXTagExample-v2.2.spdx TagToRDF.ttl TAG RDFTTL excludeLicenseDetails |
| 60 | + java -jar tools-java-2.0.0-jar-with-dependencies.jar Convert ../testResources/SPDXTagExample-v2.2.spdx TagToRDF.ttl TAG RDFTTL excludeLicenseDetails |
57 | 61 |
|
58 | 62 | To convert from SPDX 2 to SPDX 3.0.1: |
| 63 | + |
59 | 64 | * use the file extension `.jsonld.json` or `.jsonld`; |
60 | 65 | * or add the options for the from and to file types: |
61 | | -``` |
62 | | -java -jar tools-java-2.0.0-RC2-jar-with-dependencies.jar Convert hello.spdx hello.spdx.json TAG JSONLD |
63 | | -``` |
| 66 | + |
| 67 | + java -jar tools-java-2.0.0-jar-with-dependencies.jar Convert hello.spdx hello.spdx.json TAG JSONLD |
64 | 68 |
|
65 | 69 | ## Compare utilities |
66 | | -The following tools can be used to compare one or more SPDX documents: |
67 | 70 |
|
68 | | - * CompareMultipleSpdxDocs with files |
| 71 | +The following tools can be used to compare one or more SPDX documents: |
69 | 72 |
|
70 | | - Example to compare multiple SPDX files provided in rdf format and provide a spreadsheet with the results: |
| 73 | +* CompareMultipleSpdxDocs with files |
71 | 74 |
|
72 | | - java -jar tools-java-2.0.0-RC2-jar-with-dependencies.jar CompareDocs output.xlsx doc1 doc2 ... docN |
| 75 | + Example to compare multiple SPDX files provided in RDF format and provide a spreadsheet with the results: |
73 | 76 |
|
74 | | - * CompareMultipleSpdxDocs with directory |
| 77 | + java -jar tools-java-2.0.0-jar-with-dependencies.jar CompareDocs output.xlsx doc1 doc2 ... docN |
| 78 | + |
| 79 | +* CompareMultipleSpdxDocs with directory |
75 | 80 |
|
76 | 81 | Example to compare all SPDX documents in a directory "/home/me/spdxdocs" and provide a spreadsheet with the results: |
77 | 82 |
|
78 | | - java -jar tools-java-2.0.0-RC2-jar-with-dependencies.jar CompareDocs output.xlsx /home/me/spdxdocs |
| 83 | + java -jar tools-java-2.0.0-jar-with-dependencies.jar CompareDocs output.xlsx /home/me/spdxdocs |
79 | 84 |
|
80 | 85 | ## SPDX Viewer |
| 86 | + |
81 | 87 | The following tool can be used to "Pretty Print" an SPDX document. |
82 | 88 |
|
83 | | - * SPDXViewer |
| 89 | +* SPDXViewer |
84 | 90 |
|
85 | 91 | Sample usage: |
86 | 92 |
|
87 | | - java -jar tools-java-2.0.0-RC2-jar-with-dependencies.jar SPDXViewer ../testResources/SPDXRdfExample-v2.2.spdx.rdf |
| 93 | + java -jar tools-java-2.0.0-jar-with-dependencies.jar SPDXViewer ../testResources/SPDXRdfExample-v2.2.spdx.rdf |
88 | 94 |
|
89 | 95 | ## Verifier |
| 96 | + |
90 | 97 | The following tool can be used to verify an SPDX document: |
91 | 98 |
|
92 | | - * Verify |
| 99 | +* Verify |
93 | 100 |
|
94 | 101 | Sample usage: |
95 | 102 |
|
96 | | - java -jar tools-java-2.0.0-RC2-jar-with-dependencies.jar Verify ../testResources/SPDXRdfExample-v2.2.spdx.rdf |
| 103 | + java -jar tools-java-2.0.0-jar-with-dependencies.jar Verify ../testResources/SPDXRdfExample-v2.2.spdx.rdf |
97 | 104 |
|
98 | 105 | ## Generators |
| 106 | + |
99 | 107 | The following tool can be used to generate an SPDX verification code from a directory of source files: |
100 | 108 |
|
101 | | - * GenerateVerificationCode sourceDirectory |
| 109 | +* GenerateVerificationCode sourceDirectory |
102 | 110 |
|
103 | 111 | Sample usage: |
104 | 112 |
|
105 | | - java -jar tools-java-2.0.0-RC2-jar-with-dependencies.jar GenerateVerificationCode sourceDirectory [ignoredFilesRegex] |
| 113 | + java -jar tools-java-2.0.0-jar-with-dependencies.jar GenerateVerificationCode sourceDirectory [ignoredFilesRegex] |
106 | 114 |
|
107 | 115 | ## SPDX Validation Tool |
| 116 | + |
108 | 117 | 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](https://tools.spdx.org/app/validate/) is an all-in-one portal to upload and parse SPDX documents for validation, comparison and conversion and search the SPDX license list. |
109 | 118 |
|
110 | | -# License |
| 119 | +## License |
| 120 | + |
111 | 121 | A complete SPDX file is available including dependencies is available in the bintray and Maven repos. |
112 | 122 |
|
113 | | - SPDX-License-Identifier: Apache-2.0 |
114 | | - PackageLicenseDeclared: Apache-2.0 |
| 123 | + SPDX-License-Identifier: Apache-2.0 |
| 124 | + PackageLicenseDeclared: Apache-2.0 |
| 125 | + |
| 126 | +## Development |
115 | 127 |
|
116 | | -# Development |
| 128 | +### Build |
117 | 129 |
|
118 | | -## Build |
119 | 130 | You need [Apache Maven](http://maven.apache.org/) to build the project: |
120 | 131 |
|
121 | 132 | mvn clean install |
122 | 133 |
|
| 134 | +## Contributing |
| 135 | + |
| 136 | +See the file [CONTRIBUTING.md](./CONTRIBUTING.md) for information on |
| 137 | +making contributions to the SPDX tools. |
| 138 | + |
| 139 | +## Issues |
| 140 | + |
| 141 | +Report any security related issues by sending an email to [spdx-tools-security@lists.spdx.org](mailto:spdx-tools-security@lists.spdx.org) |
| 142 | + |
| 143 | +Non-security related issues should be added to the [SPDX Tools issues list](https://github.com/spdx/tools-java/issues) |
0 commit comments