Interface ApplicationModuleSourceFactory


public interface ApplicationModuleSourceFactory
SPI to allow build units contribute additional ApplicationModuleSources in the form of either declaring them directly via getModuleBasePackages() and getApplicationModuleSources(Function, boolean) or via provided getRootPackages() and subsequent resolution via getApplicationModuleSources(JavaPackage, ApplicationModuleDetectionStrategy, boolean) for each of the packages provided. Implementations would need to be registered in META-INF/spring.factories for the org.springframework.modulith.core.ApplicationModuleSourceFactory key.
The following snippet would register ApplicationModuleSources for com.acme.foo and com.acme.bar directly:
 
 class MyCustomFactory implements ApplicationModuleSourceFactory {

 	@Override
 	public List<String> getModuleBasePackages() {
 		return List.of("com.acme.foo", "com.acme.bar");
 	}
 }
 
 
The following snippet would register all modules located underneath com.acme found via the ApplicationModuleDetectionStrategy.explicitlyAnnotated() strategy:
 
 class MyCustomFactory implements ApplicationModuleSourceFactory {

 	&#64;Override
 	public List<String> getRootPackages() {
 		return List.of("com.acme");
 	}

 	&#64;Override
 	ApplicationModuleDetectionStrategy getApplicationModuleDetectionStrategy() {
 		return ApplicationModuleDetectionStrategy.explicitlyAnnotated();
 	}
 }
 
 
Since:
1.3
Author:
Oliver Drotbohm