Getting a simple ServiceLoader to work in Java using 2 supplementary Modules

I am fairly new to using ServiceLoader and I am trying to get a very simple example up and running.

Currently have 4 Modules: BLCore, BLInterface, BLMod1, BLMod2

BLCore depends on: BLInterface, BLMod1, BLMod2
BLInterface depends on: Nonne
BLMod1 depends on: BLInterface
BLMod2 depends on: BLInterface

BLCore contains the main method and contains the following:

import java.util.ServiceLoader;

public class Main {
    public static void main(String[] args) {
        for(BeanInterface val : ServiceLoader.load(BeanInterface.class)){
            System.out.println("You are a "+val.getName());
        }
    }
}

And BLInterface has a single String method that just prints out a name or so.

The structure is as follows:

The code can compile but the ServiceLoader does not detect Module1 and Module2, any ideas?



from Recent Questions - Stack Overflow https://ift.tt/3d5eFFK
https://ift.tt/3rlPzYg

Comments

Popular posts from this blog

Spring Elasticsearch Operations

Network Error and Timeout on Authorize.net JS

Object oriented programming concepts (OOPs)