1.copy已有微服务项目,修改微服务名字
education-websit
2.修改pom
<artifactId>education-websit</artifactId>
为微服务名字
3.在父项目pom中添加子模块
<modules> <module>education-website</module> </modules> 4.添加gateway网关 bootstrap配置文件(有后缀的三个)
- id: education-website uri: lb://education-website order: 0 predicates: - Path=/website/** filters: - StripPrefix=1 - id: education-website-logic-engine uri: lb://education-website predicates: - Path=/logic-engine/website/** 5.修改启动类名称 EducationWebsiteApplication 6.修改配置文件端口和一些名字为education-website的地方 7.启动项目发现报 java.nio.charset.MalformedInputException: Input length = 1 原因:项目编码与配置文件编码不一致 解决方案:1.项目设置默认编码 2.添加启动参数VM options:-Dfile.encoding=utf-8 注:如果不行就刷新maven,记住,怀疑是缓存的话就重编译项目,刷新maven