Skip to content

Mismatch between tutorial files and spring initializr files #163

@joshdavham

Description

@joshdavham

If we follow the tutorial and generate a project using spring initializr, we get the following file:

src/main/java/com/example/demo/DemoApplication.java:

package com.example.demo;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class DemoApplication {

	public static void main(String[] args) {
		SpringApplication.run(DemoApplication.class, args);
	}

}

However, the tutorial erroneously states that

The Spring Initializr creates an application class for you. In this case, you do not need to further modify the class. The following listing (from src/main/java/com/example/restservice/RestServiceApplication.java) shows the application class:

package com.example.restservice;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class RestServiceApplication {

	public static void main(String[] args) {
		SpringApplication.run(RestServiceApplication.class, args);
	}

}

...but this file doesn't exist.

In order to complete the tutorial, I ended up having to remove the demo file and replace it with the rest service file. This process also ended up adding a bit of unwanted mental load to my first spring boot tutorial haha.


Let me know if there are any questions or if you'd like any help with this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions