spring-guides / gs-rest-service

Building a RESTful Web Service :: Learn how to create a RESTful web service with Spring.

Home Page:https://spring.io/guides/gs/rest-service/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Spring boot caanot be resolved to a type errors are coming after using all spring boot dependcies used as suggested in given exmple

gregturn opened this issue · comments

Per @akhi9195:

Spring boot 'cannot be resolved to a type' errors are coming though spring boot dependencies are copy pasted from given example.

My Error in Application class :
' org.springframework.boot.SpringApplication' cannot be Resolved
'org.springframework.boot.autoconfigure.SpringBootApplication' cannot be Resolved.
etc

My Pom.xml : (copy pasted from given exm)

<?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>org.springframework</groupId>
	<artifactId>gs-rest-service</artifactId>
	<version>0.1.0</version>

	<parent>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-parent</artifactId>
		<version>1.5.3.RELEASE</version> <!-- tried with 1.5.2.RELEASE also-->
	</parent>
	<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>
		<dependency>
			<groupId>com.jayway.jsonpath</groupId>
			<artifactId>json-path</artifactId>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<properties>
		<java.version>1.8</java.version>
	</properties>


	<build>
		<plugins>
			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
			</plugin>
		</plugins>
	</build>

	<repositories>
		<repository>
			<id>spring-releases</id>
			<url>https://repo.spring.io/libs-release</url>
		</repository>
	</repositories>
	<pluginRepositories>
		<pluginRepository>
			<id>spring-releases</id>
			<url>https://repo.spring.io/libs-release</url>
		</pluginRepository>
	</pluginRepositories>
</project>

@akhi9195 can you describe the steps you took to run this guide?

Pretty sure this is obsolete