Nexus Repository Manager logo

Backstage Nexus Repository Manager Plugin

Created by Red Hat

Nexus Repository Manager is a central place to store build artifacts. Teams use it to host and proxy packages and images across formats like Maven, npm, and Docker. It helps speed up builds, keep artifacts in one place, and control access. It is developed by Sonatype and is available as open source or a paid edition.

The Nexus Repository Manager plugin brings those artifacts into Backstage. It adds a Build Artifacts view to your service pages and reads from your existing Nexus instance. You can see versions, repository details, type, manifest or checksum, last modified time, and size in one table. That makes it easy to confirm a new image tag arrived after a pipeline run. It also helps during incident review when you need to check what was shipped. The plugin reduces context switching since you do not have to leave Backstage to browse Nexus.

Common use cases include tracking container image tags for each service, checking library versions that a team publishes, and keeping an audit trail close to the catalog entry. If you manage a self hosted Backstage, this plugin gives your engineers a quick window into the artifacts that matter to their components.

Installation Instructions

These instructions apply to self-hosted Backstage only.

Install the frontend package

  1. From the repository root run

    Copy
    yarn workspace app add @backstage-community/plugin-nexus-repository-manager

Configure the proxy in app config

  1. Open app-config.yaml in the root of your Backstage repo

  2. Add a proxy endpoint for your Nexus Repository Manager

    Copy
    proxy:
      endpoints:
        '/nexus-repository-manager':
          target: 'https://<NEXUS_REPOSITORY_MANAGER_URL>'
          headers:
            X-Requested-With: 'XMLHttpRequest'
            # Uncomment to access a private Nexus Repository Manager using a token
            # Authorization: 'Bearer <YOUR TOKEN>'
          changeOrigin: true
          # Set to false if your Nexus uses a self signed certificate
          secure: true

Optional custom proxy path

  1. If you want a different base path then set a custom path in config

  2. Make the proxy endpoints key match the same path

    Copy
    nexusRepositoryManager:
      proxyPath: /custom-path
    proxy:
      endpoints:
        '/custom-path':
          target: 'https://<NEXUS_REPOSITORY_MANAGER_URL>'
          headers:
            X-Requested-With: 'XMLHttpRequest'
            # Authorization: 'Bearer <YOUR TOKEN>'
          changeOrigin: true
          secure: true

Enable the proxy backend

New backend system

  1. Add the proxy backend package to the backend workspace

    Copy
    yarn workspace backend add @backstage/plugin-proxy-backend
  2. Register the proxy plugin in packages/backend/src/index.ts

    Copy
    // packages/backend/src/index.ts
    import { createBackend } from '@backstage/backend-defaults';
    import { proxy } from '@backstage/plugin-proxy-backend';
    
    const backend = createBackend();
    
    backend.add(proxy());
    
    backend.start();

Old backend system

  1. Add the proxy backend package to the backend workspace

    Copy
    yarn workspace backend add @backstage/plugin-proxy-backend
  2. Create packages/backend/src/plugins/proxy.ts

    Copy
    // packages/backend/src/plugins/proxy.ts
    import { createRouter } from '@backstage/plugin-proxy-backend';
    import { Router } from 'express';
    import { PluginEnvironment } from '../types';
    
    export default async function createPlugin(env: PluginEnvironment): Promise<Router> {
      return await createRouter({
        logger: env.logger,
        config: env.config,
        discovery: env.discovery,
        tokenManager: env.tokenManager,
        httpAuth: env.httpAuth,
      });
    }
  3. Wire the proxy router in packages/backend/src/index.ts Your backend likely has a helper like createEnv plus useHotMemoize along with an apiRouter mounted at path api Mount the proxy router under api proxy

    Copy
    // packages/backend/src/index.ts
    import proxy from './plugins/proxy';
    
    // inside the main bootstrap function
    const proxyEnv = useHotMemoize(module, () => createEnv('proxy'));
    apiRouter.use('/proxy', await proxy(proxyEnv));

Add the Nexus tab to the service entity page

  1. Edit packages/app/src/components/catalog/EntityPage.tsx

  2. Import the page plus the availability checker

  3. Add an EntityLayout route so the tab shows on service entities

    Copy
    // packages/app/src/components/catalog/EntityPage.tsx
    import {
      isNexusRepositoryManagerAvailable,
      NexusRepositoryManagerPage,
    } from '@backstage-community/plugin-nexus-repository-manager';
    
    const serviceEntityPage = (
      <EntityLayout>
        {/* other routes */}
        <EntityLayout.Route
          if={isNexusRepositoryManagerAvailable}
          path="/build-artifacts"
          title="Build Artifacts"
        >
          <NexusRepositoryManagerPage />
        </EntityLayout.Route>
      </EntityLayout>
    );

    You can repeat the same route on other entity pages if you want it for more kinds of components

Annotate your entities

  1. Add an annotation to each entity that should show Nexus data

  2. Commit the catalog file change in your repo

    Copy
    # catalog-info.yaml
    apiVersion: backstage.io/v1alpha1
    kind: Component
    metadata:
      name: my-service
      annotations:
        nexus-repository-manager/docker.image-name: "<ORGANIZATION>/<REPOSITORY>"
    spec:
      type: service
      owner: team-a
      lifecycle: production

Optional experimental annotations

  1. Enable experimental annotations in app-config.yaml

    Copy
    nexusRepositoryManager:
      experimentalAnnotations: true
  2. Swap the import in EntityPage.tsx

    Copy
    import {
      isNexusRepositoryManagerExperimentalAvailable as isNexusRepositoryManagerAvailable,
      NexusRepositoryManagerPage,
    } from '@backstage-community/plugin-nexus-repository-manager';

    Experimental annotations are not thoroughly tested

Changelog

This changelog is produced from commits made to the Nexus Repository Manager plugin since 7 months ago, and based on the code located here. It may not contain information about all commits. Releases and version bumps are intentionally omitted. This changelog is generated by AI.

Breaking changes

  • Require Node.js 22 for local development #3841 4 months ago

Features

  • Switch date formatting to Luxon in formatDate to align with ADR012, no behavior change for callers #4639 2 months ago

Bug fixes

  • Replace internal formatByteSize with a local implementation using the filesize library, keep the same output format #4253 3 months ago

Maintenance

  • Bump Backstage to v1.42.5 #5379 12 days ago
  • Bump Backstage to v1.39.1 #4222 3 months ago
  • Remove product theme from the dev app and dev dependencies #4798 2 months ago
  • Remove support and lifecycle keywords from plugin metadata #4302 3 months ago
  • Update types for Node to v22 #4068 4 months ago
  • Clean up vendor and Janus references in package.json #3476 6 months ago
  • Reduce knip false positives in reports by updating repo tools config #3018 6 months ago

Dependencies

  • Update Hey API openapi ts to v0.82.4 #4917 27 days ago
  • Update Hey API openapi ts to v0.80.5 #4774 1 month ago
  • Update Hey API openapi ts to v0.78.3 #4287 2 months ago
  • Update Hey API openapi ts to v0.72.2 #4023 3 months ago
  • Update Hey API openapi ts to v0.67.3 #3945 4 months ago
  • Update Hey API openapi ts to v0.66.7 #2099 5 months ago
  • Update jest dom to v6.8.0 #5252 20 days ago
  • Update jest dom to v6.7.0 #4988 1 month ago
  • Update jest dom to v6.6.4 #4843 1 month ago
  • Update testing library user event to v14.6.1 #2940 6 months ago

Set up Backstage in minutes with Roadie