Error:java: JDK isn’t specified for module ‘com.springcloud’
删除.idea 并重新打开项目
Error:Module not specified
服务注册中心
Failed to configure a DataSource: ‘url’ attribute is not specified and no embedded datasource could be configured.
因为服务注册中心没有配置数据库,它也不需要数据库。在启动类注解上加上排除语句就行。如下
@SpringBootApplication(exclude= {DataSourceAutoConfiguration.class})
打包错误
配置一下主启动类,以及打包插件
<build><plugins><plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId><configuration><fork>true</fork><mainClass>com.msims.ribbon.Ribbon8010</mainClass><layout>ZIP</layout></configuration><executions><execution><goals><goal>repackage</goal></goals></execution></executions></plugin></plugins></build>
带启动的子模块引用报错
<classifier>exec</classifier> 加上这个实现引用
<build><finalName>${artifactId}</finalName><plugins><plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId><configuration><classifier>exec</classifier><fork>true</fork><mainClass>com.sample.ImportSample8001</mainClass><layout>ZIP</layout></configuration><executions><execution><goals><goal>repackage</goal></goals></execution></executions></plugin></plugins></build>
