kumuluz / kumuluzee

Lightweight open-source framework for developing microservices using standard Java EE technologies and migrating Java EE to cloud-native architecture.
https://ee.kumuluz.com
MIT License
291 stars 71 forks source link

Added support for configurable classpath scanning #123

Closed urbim closed 5 years ago

urbim commented 5 years ago

Libraries that need to be scanned can now be specified through common configuration:

kumuluzee:
  dev:
    scan-libraries:
      - lib-1.0.0-SNAPSHOT.jar
      - lib2

The search is first performed using full library JAR name (-.jar) and if not found only with artefact name.

Additionally, an extension can specify a list of libraries that need to be scanned in the scanLibraries() method:

@EeExtensionDef(name = "SimpleExt", group = "Test")
public class SimpleExtension implements Extension {
    @Override
    public void load() {
    }

    @Override
    public void init(KumuluzServerWrapper kumuluzServerWrapper, EeConfig eeConfig) {
    }

    @Override
    public List<String> scanLibraries() {
        return Collections.singletonList("extTest");
    }
}

The same matching rules apply as for common configuration.