【发布时间】:2021-04-03 15:32:32
【问题描述】:
Jersey 服务器似乎已移至 glassfish,但我更改为使用正确的 GAV 值,但我没有任何运气!一个简单的 Jersey helloworld REST 项目不会构建!这是我与泽西岛相关的 Maven 依赖项
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-servlet</artifactId>
<version>2.25</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-server</artifactId>
<version>2.25</version>
</dependency>
这是我得到的错误:
[INFO] Scanning for projects...
[INFO]
[INFO] ---------------------< com.xxxxxxx >----------------------
[INFO] Building xxxxxxx Server 0.0.1-SNAPSHOT
[INFO] --------------------------------[ war ]---------------------------------
Downloading from central: http://repo1.maven.org/maven2/org/glassfish/jersey/containers/jersey-container-servlet/2.25/jersey-container-servlet-2.25.pom
Downloading from central: http://repo1.maven.org/maven2/org/glassfish/jersey/core/jersey-server/2.25/jersey-server-2.25.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.197 s
[INFO] Finished at: 2020-12-25T13:41:38-05:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project restserver: Could not resolve dependencies for project com.xxxxxxx:restserver:war:0.0.1-SNAPSHOT: Failed to collect dependencies at org.glassfish.jersey.co
ntainers:jersey-container-servlet:jar:2.25: Failed to read artifact descriptor for org.glassfish.jersey.containers:jersey-container-servlet:jar:2.25: Could not transfer artifact org.glassfish.jersey.containers:jersey-container-servlet:pom:2.25 from/to central (http://repo1.maven.org/maven2): Failed to transfer file http://repo1.maven.org/maven2/org/glassfish/jersey/containers/jersey-container-serv
let/2.25/jersey-container-servlet-2.25.pom with status code 501 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
【问题讨论】:
-
尝试将
repo1.maven.org/maven2的协议从http切换到https