Maven仅下载依赖POM却无法下载JAR包问题求助
依赖引入失败排查:Maven Central上传的Gradle项目无法被解析
我已查阅过类似问题但未找到解决方案。将一个Gradle项目上传至Maven Central后,在另一个项目中引入该依赖时失败,怀疑是签名问题,以下是相关配置及报错信息:
- 引入依赖的pom.xml配置:
<dependency> <groupId>io.github.jplflyer</groupId> <artifactId>Spring-Web-JWT</artifactId> <version>1.0.0</version> </dependency>
Maven Central中的项目位置:可访问Maven Central中该项目的1.0.0版本目录
原Gradle项目的build.gradle配置:
plugins { // 常规插件 id 'net.thebugmc.gradle.sonatype-central-portal-publisher' version '1.1.1' } centralPortal { pom { // `name = project.name`, `description = project.description` 和 `packaging = "jar"` // 会自动应用,但可以在这里覆盖 name = 'Spring Web JWT' description = 'Provides boilerplate for implementing JWT Authentication' url = 'https://github.com/jplflyer/Spring-Web-JWT' licenses { license { name = 'The MIT License' url = 'https://opensource.org/license/mit/' } } developers { developer { id = 'jplflyer' name = 'Joseph Larson' email = 'jpl@showpage.org' } } scm { connection = 'scm:git:git://github.com/jplflyer/Spring-Web-JWT.git' url = 'https://github.com/jplflyer/Spring-Web-JWT' } } }
- ~/.gradle/gradle.properties中的签名及上传信息:
signing.keyId= VALUE signing.password= PASSWORD signing.secretKeyRingFile= PATH centralPortal.username= VALUE centralPortal.password= VALUE
- 执行
mvnw install的报错日志:
$ mvnw install [INFO] Scanning for projects... [INFO] [INFO] ----------------------< org.showpage:AuthorAide >----------------------- [INFO] Building AuthorAide 0.0.1-SNAPSHOT [INFO] from pom.xml [INFO] --------------------------------[ jar ]--------------------------------- Downloading from central: https://repo.maven.apache.org/maven2/io/github/jplflyer/Spring-Web-JWT/1.0.0/Spring-Web-JWT-1.0.0.pom Downloaded from central: https://repo.maven.apache.org/maven2/io/github/jplflyer/Spring-Web-JWT/1.0.0/Spring-Web-JWT-1.0.0.pom (2.3 kB at 8.7 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/io/github/jplflyer/Spring-Web-JWT/1.0.0/Spring-Web-JWT-1.0.0.jar [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 1.002 s [INFO] Finished at: 2024-02-18T14:21:35-06:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal on project AuthorAide: Could not resolve dependencies for project org.showpage:AuthorAide:jar:0.0.1-SNAPSHOT: The following artifacts could not be resolved: io.github.jplflyer:Spring-Web-JWT:jar:1.0.0 (absent): Could not find artifact io.github.jplflyer:Spring-Web-JWT:jar:1.0.0 in central (https://repo.maven.apache.org/maven2) -> [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
- 本地Maven仓库的文件情况:
# cd ~/.m2/repository/io/github/jplflyer/Spring-Web-JWT/1.0.0 $ ls -l total 32 -rw-r--r--@ 1 jpl staff 251 Feb 18 14:21 Spring-Web-JWT-1.0.0.jar.lastUpdated -rw-r--r--@ 1 jpl staff 2275 Feb 18 12:00 Spring-Web-JWT-1.0.0.pom -rw-r--r--@ 1 jpl staff 40 Feb 18 14:21 Spring-Web-JWT-1.0.0.pom.sha1 -rw-r--r--@ 1 jpl staff 174 Feb 18 14:21 _remote.repositories
是否是签名问题?
我怀疑是签名失败导致的,已使用gpg工具上传签名密钥,是否还需要其他操作?恳请提供解决思路。
内容的提问来源于stack exchange,提问作者Joseph Larson
相关产品推荐
相关产品推荐

