Catalog Info Generator

The extension provides the ability to generate the catalog-info.yaml file at build time or using the CLI. More specifically, it generates catalog-info.yaml with the following content:

  • Component matching the current project

  • Optional API entries for the detected APIs

  • Labels related to Kubernetes

  • Annotations with SCM information

  • Relations between API(s) and the Component(s)

  • Dependencies to the Component(s) consumed via REST clients

This allows easy registration to Backstage but most importantly, it helps keeping the catalog-info.yaml up-to-date with the project’s metadata.

Generating the catalog-info.yaml at build time

To generate the catalog-info.yaml at build time, add the quarkus-backstage extension to the project.

<dependency>
    <groupId>io.quarkiverse.backstage</groupId>
    <artifactId>quarkus-backstage</artifactId>
    <version>${quarkus-backstage.version}</version>
</dependency>

This feature is enabled out of the box and can be disabled using the following property:

quarkus.backstage.catalog.generation.enabled=false

Alternatively, the extension can be added using the CLI:

quarkus ext add io.quarkiverse.backstage:quarkus-backstage:{project-version}

After adding the extension, the catalog-info.yaml will be generated on each build at the root of the project.

The feature is enabled by default and can be disabled using the following property:

quarkus.backstage.catalog.generation.enabled=false

Rest client dependencies

When the project uses a REST client, a dependency is added to the generated Component for each configured client URL. By default, the dependency is named after the REST client config key. For example, the following configuration:

quarkus.rest-client.blub.url=http://www.blub.info/v1

results in:

spec:
  dependsOn:
    - component:default/blub

The config key is often an internal name that does not match the name of the Component in Backstage. In this case, the name can be set using the quarkus.rest-client."client".name property and used for the dependency by enabling the following property:

quarkus.backstage.catalog.rest-client.use-name=true
quarkus.rest-client.blub.name=blub-api
quarkus.rest-client.blub.url=http://www.blub.info/v1

which results in:

spec:
  dependsOn:
    - component:default/blub-api

Clients without a name (or with a blank one) keep using the config key.

Generating the catalog-info.yaml using the CLI

The catalog-info.yaml can be generated using the CLI without requiring the extension to be added to the project. This requires adding quarkus-backstage CLI plugin to the Quarkus CLI (see [Using the CLI](#using-the-cli)).

quarkus backstage entities generate