RT

pom.xml中使用

<parent>
	<groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-starter-parent</artifactId>
	<version>1.5.2.RELEASE</version>
	<relativePath/><!-- lookup parent from repository -->
</parent>
<dependencies>
	<dependency>
		<groupId>org.springframework.cloud</groupId>
		<artifactId>spring-cloud-starter-eureka-server</artifactId>
	</dependency>
</dependencies>	

导致在下载eureka-server相关包时,一直报错,下载失败。
解决方案:将spring-boot-starter-parent的版本号换成1.5.3.RELEASE。
更换后,仍有报错信息:Failed to execute goal org.springframework.boot:Spring-boot-maven-plugin。。。
这是因为在pom.xml中引入了

<plugins>
	<plugin>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-maven-plugin</artifactId>
	</plugin>
</plugins>

因此打包时会去扫描main方法入口,必须在src/main/java下创建一个spring-boot启动类或者将上述的引用注释掉。

Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐