The problem of the classpath of the introduced jar package

I have a module that is common-api

There is a GlobalConfig class in the

module that gets classpath

    Class<GlobalConfig> clazz = GlobalConfig.class;
    String classPath = clazz.getResource("/").getPath();
    System.out.println(classPath);
    

when this module is packaged as a jar package and referenced by other modules
this classPath belongs to other modules, not the common-api "s own
how to get its own classPath? in this case

Mar.28,2021
Menu