Не удалось найти компонент: ComponentReportAssistant: java.util.NoSuchElementException - PullRequest
0 голосов
/ 26 декабря 2018

Я использую плагин maven -forcer для проверки уязвимостей моего проекта maven.Когда я запускаю maven clean packge, он не работает.

Очень странно, что на некоторых машинах (Ubuntu 14.04) это работает.В других машинах (Ubuntu 14.04) происходит сбой.

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-enforcer-plugin</artifactId>
    <version>3.0.0-M1</version> <!--$NO-MVN-MAN-VER$-->
    <executions>
        <!-- Make sure no dependencies are used for which known vulnerabilities exist. -->
        <execution>
            <id>vulnerability-checks</id>
            <phase>validate</phase>
            <goals>
                <goal>enforce</goal>
            </goals>
            <configuration>
                <!-- Just generate warnings for now -->
                <fail>false</fail>
                <rules>
                    <requireJavaVersion>
                        <version>1.8.0</version>
                    </requireJavaVersion>
                    <!-- Disabled for now as it breaks the ability to build single modules -->
                    <!--reactorModuleConvergence/-->
                    <banVulnerable implementation="org.sonatype.ossindex.maven.enforcer.BanVulnerableDependencies"/>
                </rules>
            </configuration>
        </execution>
    </executions>
    <dependencies>
        <dependency>
            <groupId>org.sonatype.ossindex.maven</groupId>
            <artifactId>ossindex-maven-enforcer-rules</artifactId>
            <version>1.0.0</version>
        </dependency>
    </dependencies>
</plugin>

Ошибка вывода:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:3.0.0-M2:enforce (vulnerability-checks) on project root: Execution vulnerability-checks of goal org.apache.maven.plugins:maven-enforcer-plugin:3.0.0-M2:enforce failed: Failed to lookup component: ComponentReportAssistant: java.util.NoSuchElementException
[ERROR] role: org.sonatype.ossindex.maven.common.ComponentReportAssistant
[ERROR] roleHint:
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
...