license

licenses can be attached to components in CycloneDX SBOMs. The license elements can be used as top-level elements and be given an id so they can be later referred to via the refid attribute - see the Ant manual.

Attributes

Attribute Description Required
licenseId The id of the license. Must be a valid SPDX identifier. One of the three is required
name The name of the license.
expression The license expression.
since CycloneDX Antlib 0.2

Since CycloneDX Antlib 0.2 the Antlib will try to guess the SPDX license from its name if the name attribute is used.

Nested elements

url

At most one nested url-resource named url can be used to specify the URL of the license.

Examples

Below is a license referencing the license of this Antlib itself.

      <cdx:license
        licenseId="Apache-2.0"
        id="apache-2"
        xmlns:cdx="antlib:org.apache.ant.cyclonedx">
        <url url="https://www.apache.org/licenses/LICENSE-2.0.txt"/>
      </cdx:license>