Skip to content

Commit

Permalink
fix(core): Fix startup when Spring WebMVC is not used
Browse files Browse the repository at this point in the history
Only use SpringwolfUiResourceConfiguration if the required beans are present in the spring context (WebMvcProperties, WebProperties)

Co-authored-by: Timon Back <timonback@users.noreply.github.com>
  • Loading branch information
sam0r040 and timonback committed Jul 26, 2024
1 parent 59b8fe6 commit cf68226
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
// SPDX-License-Identifier: Apache-2.0
package io.github.springwolf.core.configuration;

import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.web.WebProperties;
import org.springframework.boot.autoconfigure.web.servlet.WebMvcProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
@ConditionalOnClass(WebMvcConfigurer.class)
@ConditionalOnBean({WebMvcProperties.class, WebProperties.class})
@Import(SpringwolfUiResourceConfigurer.class)
public class SpringwolfUiResourceConfiguration {}

0 comments on commit cf68226

Please sign in to comment.