Class IvyModuleComponentResolver
- java.lang.Object
-
- org.apache.tools.ant.ProjectComponent
-
- org.apache.ant.cyclonedx.IvyModuleComponentResolver
-
- All Implemented Interfaces:
java.lang.Cloneable,ComponentResolver
public class IvyModuleComponentResolver extends org.apache.tools.ant.ProjectComponent implements ComponentResolver
Resolver that populates a Component from Ivy module data.Assumes the Ivy file has already been resolved (i.e., the project has run ivy:resolve already). Uses the Ivy engine to resolve dependencies from the Ivy cache.
Strongly influenced by Ivy's dependencytree task.
- Since:
- CycloneDX Antlib 0.2
-
-
Constructor Summary
Constructors Constructor Description IvyModuleComponentResolver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddConfiguredTemplateComponent(Component c)Adds a nested template component.java.util.Collection<Component>resolve(Component component)Resolves the Ivy module and populates the component with its data.voidsetConf(java.lang.String conf)Sets the configurations to include in the SBOM.voidsetExternalConf(java.lang.String externalConf)Marks configurations as external.voidsetOptionalConf(java.lang.String optionalConf)Marks configurations as optional.voidsetPattern(java.lang.String pattern)The retrieve pattern used for retrieving the dependency artifacts.voidsetResolveId(java.lang.String resolveId)Sets the id which was used for a previous resolve.voidsetSettingsRef(org.apache.tools.ant.types.Reference ref)Sets a reference is a different Ivy settings file than the default shall be used.
-
-
-
Method Detail
-
setConf
public void setConf(java.lang.String conf)
Sets the configurations to include in the SBOM.Defaults to the configurations resolved by the last resolve call, or
*if no resolve was explicitly called- Parameters:
conf- comma separated list of the configurations to retrieve or*.
-
setResolveId
public void setResolveId(java.lang.String resolveId)
Sets the id which was used for a previous resolve.Defaults to
[org].[module].- Parameters:
resolveId- id which was used for a previous resolve
-
setSettingsRef
public void setSettingsRef(org.apache.tools.ant.types.Reference ref)
Sets a reference is a different Ivy settings file than the default shall be used.Defaults to
ivy.instance.- Parameters:
ref- A reference to Ivy settings that must be used by this component
-
setOptionalConf
public void setOptionalConf(java.lang.String optionalConf)
Marks configurations as optional.Any module that is included in the SBOM because it is required by on of the configurations given in
setConf(java.lang.String)and only is included because of configurations listed here is marked optional. Including configurations that are not part ofsetConf(java.lang.String)doesn't have any effect.*is no supported. The default is to have no optional components.- Parameters:
optionalConf- comma separated list of the configurations to mark optional.
-
setExternalConf
public void setExternalConf(java.lang.String externalConf)
Marks configurations as external.Any module that is included in the SBOM because it is required by on of the configurations given in
setConf(java.lang.String)and only is included because of configurations listed here is marked external. Including configurations that are not part ofsetConf(java.lang.String)doesn't have any effect.*is no supported. The default is to have no external components.- Parameters:
externalConf- comma separated list of the configurations to mark external.
-
setPattern
public void setPattern(java.lang.String pattern)
The retrieve pattern used for retrieving the dependency artifacts.Defaults to
${ivy.retrieve.pattern}.- Parameters:
pattern- retrieve pattern used
-
addConfiguredTemplateComponent
public void addConfiguredTemplateComponent(Component c)
Adds a nested template component.- Parameters:
c- nested template component
-
resolve
public java.util.Collection<Component> resolve(Component component) throws java.io.IOException, org.apache.tools.ant.BuildException
Resolves the Ivy module and populates the component with its data.- Specified by:
resolvein interfaceComponentResolver- Parameters:
component- the component to populate- Returns:
- additional components that are (transitive) dependencies of this component
- Throws:
java.io.IOException- if resolution failsorg.apache.tools.ant.BuildException
-
-