I am new to Spring / Spring Boot, so I apologize if what I ask is trivial.
I created a Spring boot application that provides a REST endpoint:
package com.atomic.contentguard;
...
@Controller
@RequestMapping("/rest")
public class AcgController {
@RequestMapping(value="/acg-status",method=RequestMethod.GET)
@ResponseBody
public String getStatus(){
return "Hi there!";
}
}
Everything works fine, when you run it as a standalone Spring application to load, the endpoint can be verified by going to http: // localhost: 8080 / rest / acg-status .
What I want to achieve is to “bring it” to another application that will include my application as a dependency in pom.xml, waiting for this REST endpoint to appear.
What I have done so far includes it in another pom.xml project like:
</dependencies>
...
<dependency>
<groupId>com.atomic</groupId>
<artifactId>contentguard</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
</dependencies>
And then included it in this other @ComponentScan application in the configuration file section:
@Configuration
@EnableWebMvc
@ComponentScan(basePackages = {"com.atomic.contentguard"})
public class EnvInfoWebConfig extends WebMvcConfigurerAdapter {
}
, :
No mapping found for HTTP request with URI [/other-application-context/rest/acg-status] in DispatcherServlet with name 'envinfo-dispatcher'
/- ?