You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(spdx-reporter): Report detected root licenses for packages
The SPDX `licenseDeclared` field for a package [1] is not a declared
license in the ORT sense (which means that it must originate from package
metadata only), but should list any "licenses that have been declared by
the authors of the package" in any way, including as part of a `LICENSE`
file, which in the ORT sense would be a detected license.
To account for that, also use licenses detected in root license files as
licenses "declared" for the package. This solves the concrete case for Go
packages that so far did not have any `licenseDeclared` set, as they are
just pointers to Git repositories which have no metadata associated.
[1]: https://spdx.github.io/spdx-spec/v2.2.2/package-information/#715-declared-license-field
Signed-off-by: Sebastian Schuberth <[email protected]>
Copy file name to clipboardExpand all lines: plugins/reporters/spdx/src/funTest/assets/spdx-document-reporter-expected-output.spdx.json
+8-8Lines changed: 8 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -46,7 +46,7 @@
46
46
"filesAnalyzed" : false,
47
47
"homepage" : "first package's homepage URL",
48
48
"licenseConcluded" : "BSD-2-Clause AND BSD-3-Clause AND MIT",
49
-
"licenseDeclared" : "BSD-3-Clause AND (MITOR GPL-2.0-only)",
49
+
"licenseDeclared" : "Apache-2.0 AND BSD-2-Clause AND BSD-2-Clause AND BSD-2-Clause AND BSD-2-Clause AND BSD-3-Clause AND BSD-3-Clause AND BSD-3-Clause AND BSD-3-Clause AND BSD-3-Clause AND BSD-3-Clause AND (GPL-2.0-only OR MIT) AND (GPL-2.0-only OR MIT) AND (GPL-2.0-only OR MIT) AND MIT AND MIT AND MIT",
50
50
"name" : "first-package",
51
51
"summary" : "A package with all supported attributes set, with a VCS URL containing a user name, and with two scan results for the VCS containing copyright findings matched to a license finding.",
52
52
"versionInfo" : "0.0.1"
@@ -63,7 +63,7 @@
63
63
"hasFiles" : [ "SPDXRef-File-1" ],
64
64
"homepage" : "first package's homepage URL",
65
65
"licenseConcluded" : "NOASSERTION",
66
-
"licenseDeclared" : "BSD-3-Clause AND (MITOR GPL-2.0-only)",
66
+
"licenseDeclared" : "Apache-2.0 AND BSD-2-Clause AND BSD-2-Clause AND BSD-2-Clause AND BSD-2-Clause AND BSD-3-Clause AND BSD-3-Clause AND BSD-3-Clause AND BSD-3-Clause AND BSD-3-Clause AND BSD-3-Clause AND (GPL-2.0-only OR MIT) AND (GPL-2.0-only OR MIT) AND (GPL-2.0-only OR MIT) AND MIT AND MIT AND MIT",
"licenseDeclared" : "BSD-3-Clause AND (MITOR GPL-2.0-only)",
90
+
"licenseDeclared" : "Apache-2.0 AND BSD-2-Clause AND BSD-2-Clause AND BSD-2-Clause AND BSD-2-Clause AND BSD-3-Clause AND BSD-3-Clause AND BSD-3-Clause AND BSD-3-Clause AND BSD-3-Clause AND BSD-3-Clause AND (GPL-2.0-only OR MIT) AND (GPL-2.0-only OR MIT) AND (GPL-2.0-only OR MIT) AND MIT AND MIT AND MIT",
91
91
"name" : "first-package",
92
92
"summary" : "A package with all supported attributes set, with a VCS URL containing a user name, and with two scan results for the VCS containing copyright findings matched to a license finding.",
93
93
"versionInfo" : "0.0.1"
@@ -103,7 +103,7 @@
103
103
"filesAnalyzed" : false,
104
104
"homepage" : "NONE",
105
105
"licenseConcluded" : "NOASSERTION",
106
-
"licenseDeclared" : "MIT AND NOASSERTION",
106
+
"licenseDeclared" : "MIT",
107
107
"name" : "fourth-package",
108
108
"summary" : "A package with partially mapped declared license.",
109
109
"versionInfo" : "0.0.1"
@@ -119,7 +119,7 @@
119
119
"filesAnalyzed" : false,
120
120
"homepage" : "NONE",
121
121
"licenseConcluded" : "NOASSERTION",
122
-
"licenseDeclared" : "NOASSERTION",
122
+
"licenseDeclared" : "NONE",
123
123
"name" : "second-package",
124
124
"summary" : "A package with minimal attributes set.",
125
125
"versionInfo" : "0.0.1"
@@ -135,7 +135,7 @@
135
135
"filesAnalyzed" : false,
136
136
"homepage" : "NONE",
137
137
"licenseConcluded" : "NOASSERTION",
138
-
"licenseDeclared" : "NOASSERTION",
138
+
"licenseDeclared" : "GPL-3.0-only",
139
139
"name" : "seventh-package",
140
140
"summary" : "A package with a source artifact scan result.",
0 commit comments