Auto domain
Auto domain
Version required: 2023.1.4
Trigger point
When clicking on the left side of the method, if no domain is configured, it will be automatically created.
Project name
The project name is taken from the api module name
Why? For example, there are two modules' APIs under the project, Module-1
and Module-2
. If the domain name value of Module-1
is already stored and when clicking the on the left of the API method under Module-2
, the old version cannot automatically switch the project name.
It is recommended not to manually add the project name later because the plugin cannot find the mapping relationship, which may easily result in using the domain name of Module-1
instead of the domain name of Module-2
when saving the API of Module-2
.
Therefore, another benefit of auto domain name is the automatic switching of API domain names. If it does not exist, it will be automatically generated. If there is a need for improvement, developers only need to modify the domain name value! The plugin will automatically adapt!
Configuration file parsing logic
- Read
application.yml
orbootstrap.yml
. If the configurationserver.port
orserver.servlet.context-path
can be found, take the configuration. - If the above configuration files cannot find
server.port
orserver.servlet.context-path
, readspring.profiles.active
as the variableenv
. Then look forapplication-env.yml
orbootstrap-env.yml
to find the configurationserver.port
orserver.servlet.context-path
. - The logic for
properties
files is similar. - If the above configurations cannot be found, use
port=8080, context-path=/
. - The project name is taken from the
module name
. spring.profiles.active
does not support Maven variables parse, for examplespring.profiles.active=@active.env@
.