我使用的是 com.sun.jersey-server/json/client 的旧版本(1.5),它必须是这个版本,所以请不要建议使用更新的版本。
在我的 pom.xml 中,我引用它:
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-server</artifactId>
<version>1.5</version>
<type>jar</type>
<scope>compile</scope>
<exclusions>
<exclusion>
<!-- version conflicts with explicit direct dependency -->
<groupId>org.codehaus.jettison</groupId>
<artifactId>jettison</artifactId>
</exclusion>
</exclusions>
</dependency>
编译给出此输出,但有错误:
[INFO] Scanning for projects...
[INFO]------------------------------------------------------------------------
[INFO] Building MediaAssistantWebService
[INFO] task-segment: [clean, install]
[INFO]------------------------------------------------------------------------
[...]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
Downloading: http://repositories.dai-labor.de/extern/content/repositories/dai-open/com/sun/jersey/jersey-server/1.5/jersey-server-1.5.pom
[INFO] Unable to find resource 'com.sun.jersey:jersey-server:pom:1.5' in repository dai-open (http://repositories.dai-labor.de/extern/content/repositories/dai-open)
Downloading: http://download.java.net/maven/2//com/sun/jersey/jersey-server/1.5/jersey-server-1.5.pom 10K downloaded (jersey-server-1.5.pom)
Downloading: http://maven.glassfish.org/content/groups/glassfish/com/sun/jersey/jersey-project/1.5/jersey-project-1.5.pom 185b downloaded (jersey-project-1.5.pom)
[WARNING] *** CHECKSUM FAILED - Checksum failed on download: local = '6c9fd3d150b8a5f0ca676f49b8ed603793cabebb'; remote = '<html><head><title>301' - RETRYING
Downloading: http://maven.glassfish.org/content/groups/glassfish/com/sun/jersey/jersey-project/1.5/jersey-project-1.5.pom185b downloaded (jersey-project-1.5.pom)
[WARNING] *** CHECKSUM FAILED - Checksum failed on download: local '6c9fd3d150b8a5f0ca676f49b8ed603793cabebb'; remote = '<html><head><title>301' - IGNORING
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).
Project ID: null:jersey-server:bundle:null
Reason: Cannot find parent: com.sun.jersey:jersey-project for project: null:jersey-server:bundle:null for project null:jersey-server:bundle:null
在寻找解决方案后,我将此存储库添加到我的 pom 中,因此 maven 会首先查看:
<repository>
<id>maven2-repository.dev.java.net</id>
<name>Java.net Repository for Maven</name>
<url>http://download.java.net/maven/2/</url>
<layout>default</layout>
</repository>
但这并没有做任何事情。我删除了.m2/jersey
文件夹并mvn clean compile
再次尝试。它仍然尝试从 glassfish-404 存储库下载它。
有谁知道我必须更改什么才能正确下载?