Does this spec support to describe the transitivity and scope of dependencies #524
-
In java's ecosystem, with maven as build tool. when a project specify it depends on some libraries, those libraries can also depends on other libraries. for example:
for project P, only lib A is called direct dependency, while B and C are called transitive dependencies. and dependencies can have scope, for example a project P may depends on lib B, but only for running unit tests.
what's the corresponding concepts in CycloneDX specs ? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
for (transitive) dependencies, see an example here: https://cyclonedx.org/use-cases/#dependency-graph graph TD;
acme-app --> pkg:maven/org.acme/web-framework
acme-app --> pkg:maven/org.acme/persistence
pkg:maven/org.acme/web-framework --> pkg:maven/org.acme/common-util
pkg:maven/org.acme/persistence --> pkg:maven/org.acme/common-util
<?xml version="1.0" encoding="UTF-8"?>
<bom xmlns="http://cyclonedx.org/schema/bom/1.6"
serialNumber="urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79"
version="1">
<metadata>
<!-- The component for which this BOM describes -->
<component type="application" bom-ref="acme-app">
<name>Acme Application</name>
<version>9.1.1</version>
</component>
</metadata>
<components>
<component type="framework" bom-ref="pkg:maven/org.acme/web-framework@1.0.0">
<group>org.acme</group>
<name>web-framework</name>
<version>1.0.0</version>
<purl>pkg:maven/org.acme/web-framework@1.0.0</purl>
</component>
<component type="library" bom-ref="pkg:maven/org.acme/persistence@3.1.0">
<group>org.acme</group>
<name>persistence</name>
<version>3.1.0</version>
<purl>pkg:maven/org.acme/persistence@3.1.0</purl>
</component>
<component type="library" bom-ref="pkg:maven/org.acme/common-util@3.0.0">
<group>org.acme</group>
<name>common-util</name>
<version>3.0.0</version>
<purl>pkg:maven/org.acme/common-util@3.0.0</purl>
</component>
</components>
<dependencies>
<!-- Direct dependencies of the main application -->
<dependency ref="acme-app">
<dependency ref="pkg:maven/org.acme/web-framework@1.0.0"/>
<dependency ref="pkg:maven/org.acme/persistence@3.1.0"/>
</dependency>
<!-- All other dependency relationships -->
<dependency ref="pkg:maven/org.acme/web-framework@1.0.0">
<dependency ref="pkg:maven/org.acme/common-util@3.0.0"/>
</dependency>
<dependency ref="pkg:maven/org.acme/persistence@3.1.0">
<dependency ref="pkg:maven/org.acme/common-util@3.0.0"/>
</dependency>
<dependency ref="pkg:maven/org.acme/common-util@3.0.0"/>
</dependencies>
</bom> |
Beta Was this translation helpful? Give feedback.
-
for scopes, see component's scope: https://cyclonedx.org/docs/1.6/json/#components_items_scope
|
Beta Was this translation helpful? Give feedback.
for scopes, see component's scope: https://cyclonedx.org/docs/1.6/json/#components_items_scope