Доступ к войне META-INF / pom.xml от Jar Common-Lib - PullRequest
0 голосов
/ 04 апреля 2019

Я пытаюсь получить доступ к файлу войны war / META-INF / maven / com ..... / application / pom.xml из общей библиотеки jar будет встроен в WEB-INF / lib войны

С классом прямо на войне он работает хорошо, но тот же код в банке, зависимость от войны, он не работает

следующий код находится в обычном jar-модуле:

public static String getServiceStatus() {
    MavenXpp3Reader reader = new MavenXpp3Reader();
    Model model = null;
    try {

        ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
        model = reader.read(new InputStreamReader(classLoader.getResourceAsStream(
                "/META-INF/maven/com.xxx/xxx-" + PropertyResolver.getMicroServiceName() + "/pom.xml")));
    } catch (Exception e) {
        System.out.println(e);
    }
    return model.getVersion();
}

и файл pom.xml находится в файле войны.

Есть идеи? я использую wildfly

...