1. Create Project

We can get access to Spring and download the project. Don’t forget to add ‘Spring Web’ dependency.

After that, we can run the project with IDEA. It’ll take around 20 minutes to download the necessary files. Then, we can follow the guidance from Quick Start to test the installation.

If you got trouble ‘Port 8080 was already in use’, you can create a file ‘/resource/application.yml’, and add the configuration. Note that ‘application.properties’ has the priority.

server:
  port: 8044
  servlet:
    context-path: /
netstat -ano
taskkill -pid 8080 -f

2. Controller

We can add controller ‘/controller/testController.java’ in the same (or sub) directory as Application.

@Controller
public class testController {
    @RequestMapping(value = "/say")
    @ResponseBody
    public String say(){
        return "Hello world!";
    }
}

3. Maven Mirror

“/apache-maven-3.8.4/conf/settings.xml”

4. Configuration

“application.properties” uses the config of “application-dev.properties”

spring.profiles.active=dev