2
votes

I tried configuring spring framework in eclipse. And try building a sample. It is giving me the following error.

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project springBootHelloWorld: Compilation failure

[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?

[ERROR] Failed to execute goal on project springBootHelloWorld: Could not resolve dependencies for project com.javaInUse:springBootHelloWorld:jar:0.0.1-SNAPSHOT: The following artifacts could not be resolved: org.springframework:spring-core:jar:5.0.10.RELEASE, org.xmlunit:xmlunit-core:jar:2.5.1: Could not transfer artifact org.springframework:spring-core:jar:5.0.10.RELEASE from/to central (https://repo.maven.apache.org/maven2): C:\Users\jkalansrayan.m2\repository\org\springframework\spring-core\5.0.10.RELEASE\aether-f4279e83-b0c7-471b-8dca-f684b2238c2d-spring-core-5.0.10.RELEASE.jar-in-progress (The system cannot find the file specified) -> [Help 1]

POM FILE

<?xml version="1.0" encoding="UTF-8"?>
<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.javaInUse</groupId>
<artifactId>springBootHelloWorld</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>

<name>springBootHelloWorld</name>
<description>Demo project for Spring Boot</description>

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.1.0.RELEASE</version>
    <relativePath/> <!-- lookup parent from repository -->
</parent>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <java.version>1.8</java.version>
</properties>

<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
    </plugins>
</build>
</project>
1
I dont know why, just by adding <version>1.1.4.RELEASE</version> it worked :(user10478566

1 Answers

2
votes
  1. Check internet connectivity because it may be proxy issue.

  2. Remove local maven .m2 reposiotory folder and do mvn clean install again will resolve the issue.

If above solutions don't work then attach the pom.xml file in the question.