Resolve maven properties when starting from class
已回答
As soon as I modify a Spring propertie, let say application.yml, and start the application from the main class (without any specific run configuration), a new properties file is generated in target, as expected, and the application start by using it.
But when this file is containing maven variables, like @foo@, those variables are not resolved automatically.
In other words, each time I modify the application.yml, I have to run :
mvn resources:resources
We could add this command "before" starting the application by using the configuration runner, but this is not out of the box and we would have to do that for each project. A new developer should be able to start the app from main class without any special configuration.
Ideally I would like something coming from the project itself, but it seems not possible.
Another acceptable solution would be to configure the IDE globally, is there such a solution with Intellij ?
Thank
请先登录再写评论。
1. You can create run configuration and share it through VCS.
2. Try Generate Sources and Update Folders ... action in Maven tool window before running the application: