<?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>your-project</groupId>
<artifactId>your-project</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<maven.compiler.target>1.9</maven.compiler.target>
<maven.compiler.source>1.9</maven.compiler.source>
</properties>
<dependecies>
<!-- Spring -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${org.springframework-version}</version>
</dependency>
</dependencies>
</project>
$org.springframework版本
1.9条
<dependencies>
.然后运行并验证maven构建了所有内容。您的项目缺少依赖项。验证您的版本设置是否正确。