参见解决方案:
https://blog.youkuaiyun.com/u011194983/article/details/78124006
加载别人的项目出现,证明是版本问题,
版本和JUnuit 包不造成的。
更换版本解决。
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.neo</groupId>
<artifactId>spring-boot-hello</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<name>spring-boot-hello</name>
<description>Demo project for Spring Boot</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.3.5.RELEASE</version>
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
http://localhost:8080/hello 访问:页面

本文介绍了一次在加载他人项目时遇到的版本冲突问题,具体表现为JUnit包与项目版本不匹配。通过调整Maven配置文件中的依赖版本,成功解决了这一问题。文中提供了修改后的pom.xml文件示例,包括Spring Boot、JUnit和其他相关依赖的具体版本。

被折叠的 条评论
为什么被折叠?



