Skip to content

Installing the Spring Initializer Frontend Plugin#

This guide will help you install and set up the Spring Initializer frontend plugin in your Backstage instance.

Prerequisites#

  • Backstage application
  • Node.js and npm/yarn
  • Access to Spring Initializer API (start.spring.io or self-hosted)
  • Backend module installed (see Backend Installation)

Installation Steps#

  1. Install the plugin package:
# Using yarn
yarn --cwd packages/app add @terasky/backstage-plugin-spring-initializer
  1. The plugin uses the new Frontend System and auto-discovers field extensions, so no additional registration is needed in your App.tsx.

  2. Configure the proxy in your app-config.yaml to avoid CORS issues:

proxy:
  endpoints:
    '/spring-initializer':
      target: 'https://start.spring.io'
      changeOrigin: true
  1. (Optional) Configure a custom Spring Initializer endpoint:
springInitializer:
  endpoint: 'https://start.spring.io'  # default
  proxyPath: '/spring-initializer'      # default proxy path
  1. Add the field extension to your software template:
apiVersion: scaffolder.backstage.io/v1beta3
kind: Template
metadata:
  name: spring-boot-template
  title: Spring Boot Application
  description: Create a new Spring Boot application
spec:
  type: service
  parameters:
    - title: Spring Boot Configuration
      properties:
        springConfig:
          title: Spring Configuration
          type: object
          ui:field: SpringInitializer
    - title: Repository Location
      required:
        - repoUrl
      properties:
        repoUrl:
          title: Repository Location
          type: string
          ui:field: RepoUrlPicker
          ui:options:
            allowedHosts:
              - github.com
  steps:
    - id: generate-spring
      name: Generate Spring Boot Project
      action: terasky:spring-initializer
      input:
        type: ${{ parameters.springConfig.type }}
        language: ${{ parameters.springConfig.language }}
        bootVersion: ${{ parameters.springConfig.bootVersion }}
        groupId: ${{ parameters.springConfig.groupId }}
        artifactId: ${{ parameters.springConfig.artifactId }}
        name: ${{ parameters.springConfig.name }}
        description: ${{ parameters.springConfig.description }}
        packageName: ${{ parameters.springConfig.packageName }}
        packaging: ${{ parameters.springConfig.packaging }}
        javaVersion: ${{ parameters.springConfig.javaVersion }}
        dependencies: ${{ parameters.springConfig.dependencies }}
    - id: publish
      name: Publish to Repository  
      action: publish:github
      input:
        description: ${{ parameters.springConfig.description }}
        repoUrl: ${{ parameters.repoUrl }}
        defaultBranch: main

Verification#

To verify the installation:

  1. Navigate to your software templates
  2. Create a new component using a template with the SpringInitializer field
  3. Verify that you can:
  4. See the Spring Boot configuration form load
  5. Select different Spring Boot versions
  6. See dependencies change based on version selection
  7. Configure project metadata
  8. Select and deselect dependencies
  9. See dependency counts update
  10. Submit the form successfully

Troubleshooting#

Common issues and solutions:

  1. Form Not Loading / CORS Errors
  2. Verify proxy configuration in app-config.yaml
  3. Check that /spring-initializer endpoint is accessible
  4. Ensure changeOrigin: true is set in proxy config
  5. Check browser console for specific error messages

  6. Dependencies Not Showing

  7. Verify Spring Initializer API is accessible
  8. Check that metadata is being fetched successfully
  9. Look for error panels in the form
  10. Verify Spring Boot version is selected

  11. Incompatible Dependencies Selected

  12. This should not happen - check browser console for errors
  13. Verify version comparison logic is working
  14. Check that dependency versionRange is being parsed

  15. Backend Action Fails

  16. Verify backend module is installed
  17. Check backend logs for detailed error messages
  18. Ensure selected dependencies are compatible
  19. Verify Spring Initializer API is accessible from backend

Next Steps#

After installation:

  1. Configure your proxy settings:
  2. Set up secure proxy configuration
  3. Configure custom endpoints if needed

  4. Create templates:

  5. Design templates using the SpringInitializer field
  6. Test with different Spring Boot versions
  7. Verify dependency selection works

  8. Customize:

  9. Override default Spring Initializer endpoint
  10. Configure proxy paths
  11. Set up custom proxy headers if needed

For detailed configuration options, see the Configuration guide.