@Bean
	public ResourceConfig jerseyApplication(Environment environment, ResourceLoader resourceLoader,
			BeanFactory beanFactory) {

		ClassPathScanningCandidateComponentProvider provider = new ClassPathScanningCandidateComponentProvider(false,
				environment);

		// Filter to include only classes that have a particular annotation.
		//
		provider.addIncludeFilter(new AnnotationTypeFilter(Path.class));
		provider.addIncludeFilter(new AnnotationTypeFilter(Provider.class));

		// Find classes in Eureka packages (or subpackages)
		//
		Set<Class<?>> classes = new HashSet<>();
		for (String basePackage : EUREKA_PACKAGES) {
			Set<BeanDefinition> beans = provider.findCandidateComponents(basePackage);
			for (BeanDefinition bd : beans) {
				Class<?> cls = ClassUtils.resolveClassName(bd.getBeanClassName(), resourceLoader.getClassLoader());
				classes.add(cls);
			}
		}

		// https://javaee.github.io/hk2/spring-bridge

		// Construct the Jersey ResourceConfig
		ResourceConfig rc = new ResourceConfig(classes).property(
				// Skip static content used by the webapp
				ServletProperties.FILTER_STATIC_CONTENT_REGEX, EurekaConstants.DEFAULT_PREFIX + STATIC_CONTENT_PATTERN);

		rc.register(new ContainerLifecycleListener() {
			@Override
			public void onStartup(Container container) {
				ServiceLocator serviceLocator = container.getApplicationHandler()
					.getInjectionManager()
					.getInstance(ServiceLocator.class);
				SpringBridge.getSpringBridge().initializeSpringBridge(serviceLocator);
				serviceLocator.getService(SpringIntoHK2Bridge.class).bridgeSpringBeanFactory(beanFactory);
			}

			@Override
			public void onReload(Container container) {

			}

			@Override
			public void onShutdown(Container container) {

			}
		});

		return rc;
	}
Construct a Jersey {@link jakarta.ws.rs.core.Application} with all the resources
required by the Eureka server.
@param environment an {@link Environment} instance to retrieve classpath resources
@param resourceLoader a {@link ResourceLoader} instance to get classloader from
@return created {@link Application} object
spring-cloud-netflix-eureka-server/src/main/java/org/springframework/cloud/netflix/eureka/server/EurekaServerAutoConfiguration.java