Spring boot messed run configuration

Answered

Hi,

I'm testing IntellJ IDEA under Ubuntu while learning Spring Boot.

To keep projects clean, I've created a directory called SpringBootProjects, and I've created inside it a first Spring Initilizr project with web dependency, setting project location as: ~/SpringBootProjects/profiles.

I've written a simple web application, tested, all ok.

Then I've created a new Spring Initializr project with web dependency, setting project location as: ~/SpringBootProjects/demo.

I've written another simple application. It runs, i.e. I have no errors, but in console I have:

Mapped "{[/hello/{name}],methods=[GET]}" onto public java.lang.String com.example.demo.TestController.hello(java.lang.String)

While application is mapped on / and is called demo:

package com.example.demo;

import ...

@SpringBootApplication
public class DemoApplication {

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


@RestController
@RequestMapping(path = "/")
class TestController {

    @RequestMapping(value = "hello/{name}", method = RequestMethod.GET)
    public String hello(@PathVariable(value = "name") String name) {
        return "Hello " + name;
    }
}

This mapping is from the first application (profiles).

How can I clean configuration or solve this problem?

0
1 comment

Are these different projects you open in IntelliJ IDEA or do you use multiple modules in the same project?

Maybe you could share the entire projects tree per https://intellij-support.jetbrains.com/hc/articles/206869619 or provide the exact steps to reproduce it?

0

Please sign in to leave a comment.