This is my first Spring Application ever. I am trying to display Hello,World in my browser. I followed the steps below, but something is wrong with my dependencies. I am using Intellij 1.2017
- Installed zip from https://spring.io/guides/gs/maven/#initial
- copied
initial
directory to my file system
On Intellij:
- Import project
- choose ../initial/pom.xml
- Next -> selected
org.springframework:gs-maven:0.1.0
-> jdk 1.8 -> Finish - run: everything works fine up to here.
Now I want to dispaly Hello, World! in the browser, follwoing the steps here: http://projects.spring.io/spring-boot/
- Added class
SampleController
- Modified pom.xml to be as follows:
<modelVersion>4.0.0</modelVersion> <groupId>org.springframework</groupId> <artifactId>gs-maven</artifactId> <packaging>jar</packaging> <version>0.1.0</version> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.5.2.RELEASE</version> </parent> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId> <version>2.1</version> <executions> <execution> <phase>package</phase> <goals> <goal>shade</goal> </goals> <configuration> <transformers> <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> <mainClass>hello.HelloWorld</mainClass> </transformer> </transformers> </configuration> </execution> </executions> </plugin> </plugins> </build>
- right click on project, and add framework support -> Added spring
- Getting: cannot resolve symbole boot, and : cannot resolve symbole EnableAutoConfiguration
I do not have much experience on maven, and dependencies, hence I am trying to follow the instructions literally. What could be wrong in my steps?