spring-projects/spring-boot · error · ReportableException

No type found with build '{this.build}' and format '{this.fo

Error message

No type found with build '{this.build}' and format '{this.format}' check the service capabilities (--list)

What it means

Thrown in detectType mode (no --type set) after filtering the service's project types by the requested --build and --format tags. If the filter leaves zero candidates, the combination is unsupported by the targeted Initializr service, so generation cannot proceed deterministically.

Source

Thrown at cli/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/init/ProjectGenerationRequest.java:385

			if (result == null) {
				throw new ReportableException(
						("No project type with id '" + this.type + "' - check the service capabilities (--list)"));
			}
			return result;
		}
		else if (isDetectType()) {
			Map<String, ProjectType> types = new HashMap<>(metadata.getProjectTypes());
			if (this.build != null) {
				filter(types, "build", this.build);
			}
			if (this.format != null) {
				filter(types, "format", this.format);
			}
			if (types.size() == 1) {
				return types.values().iterator().next();
			}
			else if (types.isEmpty()) {
				throw new ReportableException("No type found with build '" + this.build + "' and format '" + this.format
						+ "' check the service capabilities (--list)");
			}
			else {
				throw new ReportableException("Multiple types found with build '" + this.build + "' and format '"
						+ this.format + "' use --type with a more specific value " + types.keySet());
			}
		}
		else {
			ProjectType defaultType = metadata.getDefaultType();
			if (defaultType == null) {
				throw new ReportableException(("No project type is set and no default is defined. "
						+ "Check the service capabilities (--list)"));
			}
			return defaultType;
		}
	}

	/**

View on GitHub (pinned to 5b2dbdbb8b)

Solutions

  1. Run `spring init --list` and verify the available build/format combinations.
  2. Drop the unsupported --build or --format flag (or change it to an advertised value) so detection yields a match.
  3. If the combination is genuinely required, point --target at an Initializr service version that supports it.

Example fix

// before
$ spring init --build gradle --format whatever myapp
// after
$ spring init --list   # confirm supported build/format pairs
$ spring init --build gradle myapp   # omit invalid --format
Defensive patterns

Strategy: validation

Validate before calling

InitializrServiceMetadata md = InitializrServiceMetadata.forService(request.getServiceUrl());
boolean any = md.getProjectTypes().values().stream().anyMatch(t ->
    (request.getBuild()  == null || request.getBuild().equals(t.getTags().get("build"))) &&
    (request.getFormat() == null || request.getFormat().equals(t.getTags().get("format"))));
if (!any) throw new IllegalArgumentException("No type matches build/format on this service");

Type guard

// Validate the build/format tag pair exists before relying on detection
boolean supported = metadata.getProjectTypes().values().stream()
    .anyMatch(t -> Objects.equals(request.getBuild(), t.getTags().get("build"))
                && Objects.equals(request.getFormat(), t.getTags().get("format")));

Try / catch

try { request.generateUrl(metadata); }
catch (ReportableException ex) {
    if (ex.getMessage().startsWith("No type found with build")) {
        // surface available build/format combos to the user
    } else throw ex;
}

Prevention

When it happens

Trigger: Invoking `spring init --build <b> --format <f>` (or setting request.setBuild()/setFormat() with request.setDetectType(true)) where no advertised ProjectType has matching 'build' and 'format' tags. Also triggered implicitly when the CLI applies defaults that don't exist on a given service.

Common situations: Requesting a Gradle build on a service that only advertises Maven types; requesting a format the service dropped; pointing --target at a minimal/private Initializr that exposes only a subset of types; version mismatch between CLI expectations and service capabilities.

Related errors


AI-assisted analysis of spring-projects/spring-boot@5b2dbdbb8b (2026-08-04). Data as JSON: /data/errors/472b8c9ff522afe0.json. Report an issue: GitHub.