Я пытаюсь создать проект Maven в Eclipse Oxygen, но возникли ошибки. Вот шаги, которые я сделал:
- Выберите Файл -> Создать -> Проект Maven.
- Во всплывающем окне установите флажок «Создать простой проект (пропустите выбор архетипа») и установите флажок «Использовать местоположение рабочей области по умолчанию» (оставив поле расположения пустым).
- Нажмите Далее.
- Введите "com.xyz" для "Group Id", "test" для "Artifact Id", "0.0.1-SNAPSHOT" для "Version" и "jar" для "Packaging".
- Оставив пустыми остальные поля, нажмите Готово.
Проект создан с ошибками. В журнале рабочей области я вижу следующее:
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
Итак, как мне исправить эту ошибку пути сертификации?