package com.github.forax.pro.example.springboot;

import java.util.Set;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class DemoApplication {

	public static void main(String[] args) {
	  // spring boot component scan fails if modules are linked with jlink
	  // i.e. are not loaded by the application classloader 
		//SpringApplication.run(DemoApplication.class, args);
	  
	  // explicitly register the REST controller
	  SpringApplication app = new SpringApplication(DemoApplication.class);
	  app.setSources(Set.of(ModuleController.class.getName()));
	  app.run(args);
	}
}

@@ -47,30 +47,8 @@
 t;%0A%0A
-import java.util.Set;%0A
 impo
@@ -144,54 +144,295 @@
 ure.
-SpringBootApplication;%0A%0A@S
+EnableAutoConfiguration;%0Aimport org.springframework.context.annotation.Configuration;%0Aimport org.springframework.context.annotation.Import;%0A%0A@Configuration%0A@EnableAutoConfiguration%0A@Import(%7B ModuleController.class %7D)   // s
 pring
-BootApplication
+ boot component scan fails if modules are linked with jlink
 %0Apub
@@ -459,17 +459,16 @@
 ation %7B%0A
-%0A
 %09public 
@@ -508,386 +508,53 @@
 %0A%09  
-// spring boot component scan fails if modules are linked with jlink%0A%09  // i.e. are not loaded by the application classloader %0A%09%09//SpringApplication.run(DemoApplication.class, args);%0A%09  %0A%09  // explicitly register the REST controller%0A%09  SpringApplication app = new SpringApplication(DemoApplication.class);%0A%09  app.setSources(Set.of(ModuleController.class.getName()));%0A%09  app.run(
+SpringApplication.run(DemoApplication.class, 
 args

use @Import instead of the programmatic API to specify the REST controller