Skip to content

Refine exception message when ProjectGenerationContext fails to refresh #973

Open
@snicoll

Description

@snicoll

Depending on the contributors on the classpath, refresh of ProjectGenerationContext could fail because a required dependency is not registered. Right now we throw the low-level exception and could use a better handling of it.

Example:

Exception in thread "main" org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'defaultStarterContributor' defined in class path resource [io/spring/initializr/generator/spring/build/BuildProjectGenerationConfiguration.class]: Unsatisfied dependency expressed through method 'defaultStarterContributor' parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'io.spring.initializr.metadata.InitializrMetadata' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:769)
	at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:509)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1321)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions