在maven中添加外部依赖时出错

get error, when add external dependency in maven

我想向项目(jsoup 库)添加依赖项,但出现错误

我的pom.xml

<?xml version="1.0" encoding="UTF-8"?>

4.0.0

<groupId>org.example</groupId>
<artifactId>training</artifactId>
<version>1.0-SNAPSHOT</version>





<properties>
    <maven.compiler.source>17</maven.compiler.source>
    <maven.compiler.target>17</maven.compiler.target>
</properties>


<dependencies>
    <!-- https://mvnrepository.com/artifact/org.jsoup/jsoup -->
    <dependency>
        <groupId>org.jsoup</groupId>
        <artifactId>jsoup</artifactId>
        <version>1.14.2</version>
    </dependency>

</dependencies>

错误

求求你帮忙

我根据你的问题创建了一个 pom.xml。

当我输入 mvn clean package 命令时它运行良好。

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns="http://maven.apache.org/POM/4.0.0"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">

  <modelVersion>4.0.0</modelVersion>
  <groupId>org.example</groupId>
  <artifactId>training</artifactId>
  <version>1.0-SNAPSHOT</version>
  <name>YOUR_NAME</name>
  <description>description</description>

  <properties>
    <maven.compiler.source>17</maven.compiler.source>
    <maven.compiler.target>17</maven.compiler.target>
  </properties>

  <dependencies>
    <dependency>
      <groupId>org.jsoup</groupId>
      <artifactId>jsoup</artifactId>
      <version>1.14.2</version>
    </dependency>
  </dependencies>
  
</project>