Tanzu Platform SaaS

Create a new app by using an Application Accelerator

Last Updated February 19, 2025

This topic tells you how to bootstrap a new app using an Application Accelerator.

Before you begin

Before you can bootstrap an app using an accelerator, you must:

Generate a new project

Generate a new project either by using the IntelliJ IDE or the accelerator Tanzu CLI plug-in.

Generate a new project by using the IntelliJ IDE

To generate a new project by using the IntelliJ IDE:

  1. Open the New Project Wizard in IntelliJ.

  2. Under Generators on the left side, click Tanzu Application Accelerator. The first step of the wizard opens and shows a loading indicator as it attempts to fetch a list of accelerators. If successful, accelerators are displayed.

  3. Click on an accelerator and then click Next.

  4. Use the default option values for the accelerator or edit them, and then click Next.

  5. (Optional) Your home directory is the default location in which to generate the new project. Change this location to the path for the workspace where you keep your source code.

    Screen capture of the accelerator options window.

  6. Review the selections in the next step, and then click Next to generate the project.

    You can save the options used for generating a project as a JSON file. This file can later be used with the Tanzu CLI accelerator plug-in generate command to generate a new project from the CLI.

  7. A message appears indicating that the project was generated. Click Create to open the project. The newly generated project appears in the IDE.

Generate a new project by using the accelerator Tanzu CLI plug-in

To generate a new project by using the accelerator Tanzu CLI plug-in:

  1. Ensure that the Accelerator Local Server engine is running either as a separate process or as part of the Tanzu Platform Developer Tools plug-in for IntelliJ IDE.

  2. If you have not done so already, get an active Tanzu context for the Tanzu CLI and set the Tanzu UCP Project to use.

  3. Listing the available accelerators by running:

    tanzu accelerator list
    

    A list similar to this appears:

    NAME                 TAGS                                   DISPLAY NAME
    spring-ai-chat       [java spring web ai tanzu]             Tanzu Spring AI RAG App
    spring-music         [java spring cloud music tanzu]        Spring Music
    tanzu-java-web-app   [java spring gradle maven web tanzu]   Tanzu Java Web App
    
  4. Review the available options for an accelerator by running:

    tanzu accelerator get tanzu-java-web-app
    

    Options available for the accelerator appear:

    name: tanzu-java-web-app
    description: A sample Spring Boot web application for Tanzu Platform for Kubernetes
    displayName: Tanzu Java Web App
    sourceURL: https://github.com/vmware-tanzu/application-accelerator-samples/tree/main/tanzu-java-web-app
    tags:
    - java
    - spring
    - gradle
    - maven
    - web
    - tanzu
    options:
    - name: buildTool
     label: Build Tool
     required: true
     inputType: select
     dataType: string
     defaultValue: maven
     choices:
     - text: Maven (https://maven.apache.org/)
       value: maven
     - text: Gradle (https://gradle.org/)
       value: gradle
    - name: javaVersion
     label: Java version to use
     inputType: select
     dataType: string
     defaultValue: "17"
     choices:
     - text: Java 17
       value: "17"
     - text: Java 21
       value: "21"
    - name: includeBuildToolWrapper
     label: Include Build Tool wrapper support
     inputType: checkbox
     dataType: boolean
     defaultValue: true
    

    The generate command takes the following flags:

    Flags:
         --extract               extract the generated content in output-dir
     -f, --force                 force overwrite of zip file or generated content directory
     -h, --help                  help for generate
         --options string        options JSON string (default "{}")
         --options-file string   path to file containing options JSON string
     -o, --output-dir string     directory that the zip file or generated content will be written to
    
  5. Generate a new project by running:

    tanzu accelerator generate tanzu-java-web-app --extract --options-file ./my-options.json
    

    Here is an example of an options file named my-options.json:

    {
     "includeBuildToolWrapper" : true,
     "javaVersion" : "21",
     "buildTool" : "maven",
     "projectName" : "my-java-web-app"
    }
    

    You only need to provide options where you want to override the default values.

    This command creates the project directory my-java-web-app under the current directory. The directory is named based on the projectName option. To use a different name for the project directory, use the --output-dir flag. If you omit the --extract flag, the project is generated as a ZIP file named with the projectName option.

    When using the generate command you can either:

    • Provide the options in a JSON file with the --options-file flag, as in the command here.
    • Provide the options as a JSON-formatted string by using the --options flag.

    The IntelliJ plug-in has a feature for saving options provided for generating a new project as a JSON file. This file can now be used with the generate command.