Jonah Downs
Jonah Downs

Reputation: 33

Maven can not calculate build path in Eclipse

I am very new to using Maven, and I'm trying to follow along with an online tutorial using Eclipse, however when I'm writing the Maven file, I get the following Error:

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

My pom.xml looks like this, and the plugin tag is underlined with a red error

<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>

I've tried deleting the repository folder in my .m2 folder, and updating my project, but I haven't found any fix yet. Can someone help me out?

Upvotes: 1

Views: 648

Answers (1)

Wesley De Keirsmaeker
Wesley De Keirsmaeker

Reputation: 1025

Your Maven versions is probably out of date. Newer versions should automatically go to the central maven repo using HTTPS.

Your error is saying: Error code 501, HTTPS Required When trying to go to the central repo.

Update maven to the latest version or atleast to 3.2.3.

Download the latest Maven version from: https://maven.apache.org/download.cgi

In Eclipse you can change the maven version like this:

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

Now select the Maven you just installated

Upvotes: 1

Related Questions