Source properties from core module
The sourcing of application.yml from the core
module is not working in other modules.
Sample code that has to work (renamed core
properties to application-common.yml
, just in case):
package cz.muni.pa165.movie.rest;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
@Configuration
@PropertySource("classpath:application-common.yml")
public class Conf {
@Value("${rest.path.api}")
private String apiPath;
}
EDIT: application.yml
is not even working in core
. The problem is probably that core
does not have @SpringBootApplication
. But it still should be fixable. And it is needed even more now that we call endpoints from one microservice into another.
Edited by Filip Karniš