gpt4 book ai didi

maven - 如何解决 pom.xml 中的依赖错误

转载 作者:行者123 更新时间:2023-12-01 13:56:02 26 4
gpt4 key购买 nike

我是 Maven 的新手,在 pom.xml 文件中添加依赖项时出现此错误。下面是我的 pom.xml 文件:

<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>CrunchifyRESTJerseyExample</groupId>
<artifactId>CrunchifyRESTJerseyExample</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<dependencies>
<dependency>
<groupId>asm.jar</groupId>
<artifactId>asm.jar</artifactId>
<version>3.3.1</version>
</dependency>
<dependency>
<groupId>jersey-bundle.jar</groupId>
<artifactId>jersey-bundle.jar</artifactId>
<version>1.18.1</version>
</dependency>
<dependency>
<groupId>json.jar</groupId>
<artifactId>json.jar</artifactId>
<version>20140107</version>
</dependency>
<dependency>
<groupId>jersey-core.jar</groupId>
<artifactId>jersey-core.jar</artifactId>
<version>1.18.1</version>
</dependency>
<dependency>
<groupId>jersey-bundle</groupId>
<artifactId>jersey-bundle</artifactId>
<version>1.18.1</version>
</dependency>
</dependencies>
</project>

对于每个依赖项,都会显示错误

Missing artifact json.jar:json.jar:jar:20140107
Missing artifact asm.jar:asm.jar:jar:3.3.1
Missing artifact jersey-bundle.jar:jersey-bundle.jar:jar:1.18.1
Missing artifact jersey-bundle:jersey-bundle:jar:1.18.1
Missing artifact jersey-core.jar:jersey-core.jar:jar:1.18.1

请帮我解决这个问题。

谢谢!!

最佳答案

不能直接写jar的名字。大多数时候 groupId 指的是“packages”,而 artifactId 指的是依赖项的名称。如需示例,请转至 http://mvnrepository.com/artifact/com.sun.jersey/jersey-core/1.18.3

关于maven - 如何解决 pom.xml 中的依赖错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28011972/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com