Ошибка пути сертификации при создании проекта Maven в Eclipse - PullRequest
0 голосов
/ 10 мая 2018

Я пытаюсь создать проект Maven в Eclipse Oxygen, но возникли ошибки. Вот шаги, которые я сделал:

  1. Выберите Файл -> Создать -> Проект Maven.
  2. Во всплывающем окне установите флажок «Создать простой проект (пропустите выбор архетипа») и установите флажок «Использовать местоположение рабочей области по умолчанию» (оставив поле расположения пустым).
  3. Нажмите Далее.
  4. Введите "com.xyz" для "Group Id", "test" для "Artifact Id", "0.0.1-SNAPSHOT" для "Version" и "jar" для "Packaging".
  5. Оставив пустыми остальные поля, нажмите Готово.

Проект создан с ошибками. В журнале рабочей области я вижу следующее:

    Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6

Когда я открывал вновь созданный файл pom.xml, я вижу ошибку:

Multiple annotations found at this line:
- CoreException: Could not calculate build plan: Plugin org.apache.maven.plugins:maven-compiler-plugin:3.1 or one of its dependencies could not be 
 resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-compiler-plugin:jar:3.1: ArtifactResolutionException: Failure to transfer 
 org.apache.maven.plugins:maven-compiler-plugin:pom:3.1 from https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be 
 reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.maven.plugins:maven-
 compiler-plugin:pom:3.1 from/to central (https://repo.maven.apache.org/maven2): sun.security.validator.ValidatorException: PKIX path building failed: 
 sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
- Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:3.1:testCompile (execution: default-
 testCompile, phase: test-compile)
- Failure to transfer org.apache.maven.plugins:maven-resources-plugin:pom:2.6 from https://repo.maven.apache.org/maven2 was cached in the local 
 repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact 
 org.apache.maven.plugins:maven-resources-plugin:pom:2.6 from/to central (https://repo.maven.apache.org/maven2): repo.maven.apache.org
- Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (execution: default-compile, 
 phase: compile)

Ниже приведено то, что я ранее поместил в файл settings.xml, в котором содержатся настройки прокси-сервера, поскольку я нахожусь за брандмауэром.

    <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                              https://maven.apache.org/xsd/settings-1.0.0.xsd">
    <localRepository/>
    <interactiveMode/>
    <usePluginRegistry/>
    <offline/>
    <pluginGroups/>
    <servers/>
    <mirrors/>
    <proxies>
            <proxy>
                    <id>example-proxy</id>
                    <active>true</active>
                    <protocol>http</protocol>
                    <host>xx.xx.xx.xx</host>
                    <port>80</port>
                    <username>xxxxxxxx</username>
                    <password>xxxxxxxx</password>
                    <nonProxyHosts>localhost|127.0.0.1</nonProxyHosts>
            </proxy>
    </proxies>
    <profiles/>
    <activeProfiles/>
</settings>

Похоже, что моя основная проблема связана с путем сертификации, как показано в следующей строке, которую я извлек из описанных выше ошибок.

sun.security.validator.ValidatorException: PKIX path building failed: 
 sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

Итак, как мне исправить эту ошибку пути сертификации?

1 Ответ

0 голосов
/ 10 мая 2018

Проблемы с использованием Maven и SSL за прокси

Вот тема, похожая на вашу проблему, где вы пытаетесь подключиться к удаленному хранилищу https - "https://repo.maven.apache.org/maven2/". В основном сертификат для поддержки соединений HTTPS не включен в файл cacerts.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...