Построение репо с помощью Karaf features-maven-plugin с зависимостью CXF вызывает бесконечный цикл - PullRequest
0 голосов
/ 05 августа 2020

Сборка репозитория с помощью плагина-maven-plugin Karaf с зависимостью CXF вызывает бесконечное l oop.

Я использую версию 2.3.12 организации. apache .karaf.tooling / features- maven-plugin.

похоже, это началось с CXF версии 3.2.x, когда была добавлена ​​циклическая зависимость между cxf-core и cxf-командами.

Он выводит сотни таких, затем выдает исключение переполнения стека:

[INFO] Adding contents for feature: cxf-core/3.2.14
[INFO] Adding contents for feature: cxf-commands/3.2.14
[INFO] Adding contents for feature: cxf-core/3.2.14
[INFO] Adding contents for feature: cxf-commands/3.2.14

вот раздел плагина pom моего pom:

                <groupId>org.apache.karaf.tooling</groupId>
                <artifactId>features-maven-plugin</artifactId>
                    <version>2.4.4</version>
                    <extensions>true</extensions>
                    <dependencies>
                        <dependency>
                            <groupId>org.apache.maven.wagon</groupId>
                            <artifactId>wagon-http-lightweight</artifactId>
                            <version>3.4.1</version>
                        </dependency>
                    </dependencies>
                <executions>
                    <execution>
                        <id>add-features-to-repo</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>add-features-to-repo</goal>
                        </goals>
                        <configuration>
                            <features>
                                <feature>cxf-core/3.2.14</feature>
                            </features>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

вот оскорбительный бит функций cxf - обратите внимание, что «cxf- core "имеет условную зависимость от функции" cxf-commands ", а функция" cxf-commands "жестко зависит от" cxf-core ". Мне это кажется НЕПРАВИЛЬНЫМ, и я не вижу способа сказать плагину, чтобы он не попадал в бесконечный l oop.

    <feature name="cxf-core" version="3.2.14">
        <feature version="3.2.14">cxf-specs</feature>
        <bundle start-level="30" dependency="true">mvn:org.apache.ws.xmlschema/xmlschema-core/2.2.5</bundle>
        <bundle start-level="25" dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.xmlresolver/1.2_5</bundle>
        <bundle start-level="30" dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.fastinfoset/1.2.13_1</bundle>
        <bundle start-level="40">mvn:org.apache.cxf/cxf-core/3.2.14</bundle>
        <bundle start-level="40">mvn:org.apache.cxf/cxf-rt-management/3.2.14</bundle>
        <conditional>
            <condition>shell</condition>
            <feature version="3.2.14">cxf-commands</feature>
        </conditional>
    </feature>
    <feature name="cxf-commands" version="3.2.14">
        <feature>shell</feature>
        <feature version="3.2.14">cxf-core</feature>
        <bundle start-level="40">mvn:org.apache.cxf.karaf/cxf-karaf-commands/3.2.14</bundle>
    </feature>

1 Ответ

0 голосов
/ 13 августа 2020

ну, как оказалось, плагин features-maven был заменен. Этот плагин работает!

                <groupId>org.apache.karaf.tooling</groupId>
                <artifactId>karaf-maven-plugin</artifactId>

просто измените цель на: features-add-to-repository и убедитесь, что оно установлено. это нормальный:

<repository>target/features-repo</repository>

и он распознает и поддерживает условную функциональность!

...