Class BillOfMaterials

java.lang.Object
io.spring.initializr.metadata.BillOfMaterials

public class BillOfMaterials extends Object
Define a Bill Of Materials to be represented in the generated project if a dependency refers to it.
Author:
Stephane Nicoll
  • Constructor Details

    • BillOfMaterials

      public BillOfMaterials()
  • Method Details

    • getGroupId

      public String getGroupId()
    • setGroupId

      public void setGroupId(String groupId)
    • getArtifactId

      public String getArtifactId()
    • setArtifactId

      public void setArtifactId(String artifactId)
    • getVersion

      public String getVersion()
      Return the version of the BOM. Can be null if it is provided via a mapping.
      Returns:
      the version of the BOM or null
    • setVersion

      public void setVersion(String version)
    • getVersionProperty

      public VersionProperty getVersionProperty()
      Return the VersionProperty to use to externalize the version of the BOM. When this is set, a version property is automatically added rather than setting the version in the BOM declaration itself.
      Returns:
      the version property
    • setVersionProperty

      public void setVersionProperty(VersionProperty versionProperty)
    • setVersionProperty

      public void setVersionProperty(String versionPropertyName)
    • getOrder

      public Integer getOrder()
      Return the relative order of this BOM where lower values have higher priority. The default value is Integer.MAX_VALUE, indicating lowest priority. The Spring Boot dependencies BOM has an order of 100.
      Returns:
      the relative order of this BOM
    • setOrder

      public void setOrder(Integer order)
    • getAdditionalBoms

      public List<String> getAdditionalBoms()
      Return the BOM(s) that should be automatically included if this BOM is required. Can be null if it is provided via a mapping.
      Returns:
      the additional BOMs
    • setAdditionalBoms

      public void setAdditionalBoms(List<String> additionalBoms)
    • getRepositories

      public List<String> getRepositories()
      Return the repositories that are required if this BOM is required. Can be null if it is provided via a mapping.
      Returns:
      the repositories
    • setRepositories

      public void setRepositories(List<String> repositories)
    • getMappings

      public List<BillOfMaterials.Mapping> getMappings()
    • validate

      public void validate()
    • updateCompatibilityRange

      public void updateCompatibilityRange(VersionParser versionParser)
    • resolve

      public BillOfMaterials resolve(Version bootVersion)
      Resolve this instance according to the specified Spring Boot Version. Return a BillOfMaterials instance that holds the version, repositories and additional BOMs to use, if any.
      Parameters:
      bootVersion - the Spring Boot version
      Returns:
      the bill of materials
      Throws:
      InvalidInitializrMetadataException - if no suitable mapping is found for that version
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • create

      public static BillOfMaterials create(String groupId, String artifactId)
    • create

      public static BillOfMaterials create(String groupId, String artifactId, String version)