Skip to content

Commit 92094c3

Browse files
committed
v1.5 complete linkable licenses
- add examples for licenses with links - add `bom-ref` to license expressions, so ALL licenses are linkable Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
1 parent 4159dee commit 92094c3

8 files changed

Lines changed: 32 additions & 8 deletions

schema/bom-1.5.schema.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -931,8 +931,8 @@
931931
"maxItems": 1,
932932
"items": [{
933933
"type": "object",
934-
"required": ["expression"],
935934
"additionalProperties": false,
935+
"required": ["expression"],
936936
"properties": {
937937
"expression": {
938938
"type": "string",
@@ -941,6 +941,11 @@
941941
"Apache-2.0 AND (MIT OR GPL-2.0-only)",
942942
"GPL-3.0-only WITH Classpath-exception-2.0"
943943
]
944+
},
945+
"bom-ref": {
946+
"$ref": "#/definitions/refType",
947+
"title": "BOM Reference",
948+
"description": "An optional identifier which can be used to reference the license elsewhere in the BOM. Every bom-ref MUST be unique within the BOM."
944949
}
945950
}
946951
}]

schema/bom-1.5.xsd

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2064,11 +2064,25 @@ limitations under the License.
20642064
<xs:complexType name="licenseChoiceType">
20652065
<xs:choice>
20662066
<xs:element name="license" type="bom:licenseType" minOccurs="0" maxOccurs="unbounded"/>
2067-
<xs:element name="expression" type="xs:normalizedString" minOccurs="0" maxOccurs="1">
2067+
<xs:element name="expression" minOccurs="0" maxOccurs="1">
20682068
<xs:annotation>
20692069
<xs:documentation>A valid SPDX license expression.
20702070
Refer to https://spdx.org/specifications for syntax requirements</xs:documentation>
20712071
</xs:annotation>
2072+
<xs:complexType>
2073+
<xs:simpleContent>
2074+
<xs:extension base="xs:normalizedString">
2075+
<xs:attribute name="bom-ref" type="bom:refType">
2076+
<xs:annotation>
2077+
<xs:documentation>
2078+
An optional identifier which can be used to reference the license elsewhere in the BOM.
2079+
Uniqueness is enforced within all elements and children of the root-level bom element.
2080+
</xs:documentation>
2081+
</xs:annotation>
2082+
</xs:attribute>
2083+
</xs:extension>
2084+
</xs:simpleContent>
2085+
</xs:complexType>
20722086
</xs:element>
20732087
</xs:choice>
20742088
</xs:complexType>

tools/src/test/resources/1.5/valid-license-expression-1.5.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"version": "9.0.14",
1313
"licenses": [
1414
{
15-
"expression": "EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0"
15+
"expression": "EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0",
16+
"bom-ref": "my-license"
1617
}
1718
]
1819
}

tools/src/test/resources/1.5/valid-license-expression-1.5.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
<hash alg="SHA-512">e8f33e424f3f4ed6db76a482fde1a5298970e442c531729119e37991884bdffab4f9426b7ee11fccd074eeda0634d71697d6f88a460dce0ac8d627a29f7d1282</hash>
1616
</hashes>
1717
<licenses>
18-
<expression>EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0</expression>
18+
<expression bom-ref="my-license">
19+
EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
20+
</expression>
1921
</licenses>
2022
<purl>pkg:maven/com.acme/tomcat-catalina@9.0.14?packaging=jar</purl>
2123
</component>

tools/src/test/resources/1.5/valid-license-id-1.5.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
"licenses": [
1414
{
1515
"license": {
16-
"id": "Apache-2.0"
16+
"id": "Apache-2.0",
17+
"bom-ref": "my-license"
1718
}
1819
}
1920
]

tools/src/test/resources/1.5/valid-license-id-1.5.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<hash alg="SHA-512">e8f33e424f3f4ed6db76a482fde1a5298970e442c531729119e37991884bdffab4f9426b7ee11fccd074eeda0634d71697d6f88a460dce0ac8d627a29f7d1282</hash>
1616
</hashes>
1717
<licenses>
18-
<license>
18+
<license bom-ref="my-license">
1919
<id>Apache-2.0</id>
2020
</license>
2121
</licenses>

tools/src/test/resources/1.5/valid-license-name-1.5.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
"licenses": [
1414
{
1515
"license": {
16-
"name": "Apache License 2.0"
16+
"name": "Apache License 2.0",
17+
"bom-ref": "my-license"
1718
}
1819
}
1920
]

tools/src/test/resources/1.5/valid-license-name-1.5.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<hash alg="SHA-512">e8f33e424f3f4ed6db76a482fde1a5298970e442c531729119e37991884bdffab4f9426b7ee11fccd074eeda0634d71697d6f88a460dce0ac8d627a29f7d1282</hash>
1616
</hashes>
1717
<licenses>
18-
<license>
18+
<license bom-ref="my-license">
1919
<name>Apache License 2.0</name>
2020
</license>
2121
</licenses>

0 commit comments

Comments
 (0)