Maven не может рассчитать путь сборки в Eclipse - PullRequest
1 голос
/ 11 марта 2020

Я очень новичок в использовании Maven, и я пытаюсь следовать онлайн-учебнику по Eclipse, однако, когда я пишу файл Maven, я получаю следующую ошибку:

CoreException: Could not calculate build plan: Plugin org.apache.maven.plugins:maven-compiler-plugin:3.8.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.8.1: ArtifactResolutionException: Failure to transfer org.apache.maven.plugins:maven-compiler-plugin:pom:3.8.1 from http://repo1.maven.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.8.1 from/to central (http://repo1.maven.org/maven2): Failed to transfer http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-compiler-plugin/3.8.1/maven-compiler-plugin-3.8.1.pom. Error code 501, HTTPS Required

Мой pom. xml выглядит следующим образом, а тег плагина подчеркнут красной ошибкой

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.pluralsight</groupId>
  <artifactId>conference</artifactId>
  <version>0.0.1-SNAPSHOT</version>


  <dependencies>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context</artifactId>
        <version>5.2.0.RELEASE</version>
    </dependency>
  </dependencies>

  <build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.8.1</version>
            <configuration>
                <source>8</source>
                <target>8</target>
            </configuration>
        </plugin>
    </plugins>
  </build>

</project>

Я попытался удалить папку репозитория в папке .m2 и обновить проект, но Я еще не нашел никаких исправлений. Кто-нибудь может мне помочь?

1 Ответ

1 голос
/ 11 марта 2020

Ваши версии Maven, вероятно, устарели. Более новые версии должны автоматически go к центральному репозиторию Maven с использованием HTTPS.

Ваша ошибка говорит: Код ошибки 501, требуется HTTPS При попытке go к центральному репо.

Обновление maven до последней версии или, по крайней мере, до 3.2.3.

Загрузите последнюю версию Maven с: https://maven.apache.org/download.cgi

В Eclipse вы можете изменить версию maven следующим образом :

Preferences -> Maven -> Installations -> Add...

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