用IDEA构建一个简单的微服务,用spring-boot-maven-plugin插件的run目标(goal)构建工程,报错如下:
工程的pom文件如下:
解决方法4.0.0 com.zswang license-service 1.0-SNAPSHOT jar Eagle-eye Licensing Service Licensing Service org.springframework.boot spring-boot-starter-parent 1.4.4.RELEASE org.springframework.boot spring-boot-starter-web org.springframework.boot spring-boot-starter-actuator 2.0.4.RELEASE org.springframework.boot spring-boot-maven-plugin
首先观察报错内容,主要是actuate出错:
根据横云断岭这篇分析,这个错误来自于springboot2更改类名,但是我这儿用的是springboot1啊(不信你看这个工程的pom继承的pom的版本是1.4.4.RELEASE)。后来仔细一看发现,我的spring-boot-starter-actuator用的版本是2.0.4.RELEASE。原来如此,果断改成1.4.4.RELEASE,spingboot:run成功了!



