简体   繁体   English

由于“maven-metadata-bintray-central.xml”文件中的错误,Maven 构建失败

[英]Maven build fails due to error in “maven-metadata-bintray-central.xml” file

I build a project using Maven that refers to artifacts from Artifactory.我使用 Maven 构建了一个项目,该项目引用来自 Artifactory 的工件。 This build setup has worked without issues, but now I am seeing this error every time it gets a new library from Artifactory repo.此构建设置没有问题,但现在每次从 Artifactory 存储库获取新库时我都会看到此错误。

Caused by: org.apache.maven.artifact.repository.metadata.RepositoryMetadataResolutionException: Unable to read local copy of metadata: Cannot read metadata from '/home/user/.m2/repository/com/cc-spring-hibernate/5.1-SNAPSHOT/maven-metadata-bintray-central.xml': end tag name </body> must match start tag name <hr> from line 5 (position: TEXT seen ...</center>\r\n</body>... @6:8)
    at org.apache.maven.artifact.repository.metadata.DefaultRepositoryMetadataManager.resolve(DefaultRepositoryMetadataManager.java:175)
    at org.apache.maven.artifact.transform.AbstractVersionTransformation.resolveVersion(AbstractVersionTransformation.java:65)
    at org.apache.maven.artifact.transform.SnapshotTransformation.transformForResolve(SnapshotTransformation.java:63)
    ... 23 more

When I checked the maven-metadata-bintray-central.xml file, I see that it has this content.当我检查 maven-metadata-bintray-central.xml 文件时,我看到它有这个内容。

<html>
<head><title>302 Found</title></head>
<body bgcolor="white">
<center><h1>302 Found</h1></center>
<hr><center>nginx</center>
</body>
</html>

Upon investigation I found that this appears to be because of Artifactory calling http://jcenter.bintray.com/ to get a dependency, but the HTTP call returns the "302 Found" & nginx message to redirect to HTTPS ( https://jcenter.bintray.com/ ). Upon investigation I found that this appears to be because of Artifactory calling http://jcenter.bintray.com/ to get a dependency, but the HTTP call returns the "302 Found" & nginx message to redirect to HTTPS ( https:// jcenter.bintray.com/ )。

Is Artifactory calling jcenter.bintray to get details of the library? Artifactory 是否调用 jcenter.bintray 来获取库的详细信息? If that is the case, how can we configure Artifactory to use the https URL or to understand the http redirect?如果是这种情况,我们如何配置 Artifactory 以使用 https URL 或了解 http 重定向?

This issue is not related to Artifactory.此问题与 Artifactory无关

It was because there was a reference to http://jcenter.bintray.com in the pom file.这是因为 pom 文件中有对http://jcenter.bintray.com的引用。

<repository>
   <id>bintray-central</id>
   <name>bintray</name>
   <url>https://jcenter.bintray.com</url>
</repository>

I am not sure why it did not fail earlier.我不知道为什么它没有早点失败。 I am assuming there has been a recent change in the jcenter.bintray.com site to redirect all calls for http to https with a 302. Changing the bintray URL to https, like this, deleting the old files in.m2 folder and rebuilding resolved the issue. I am assuming there has been a recent change in the jcenter.bintray.com site to redirect all calls for http to https with a 302. Changing the bintray URL to https, like this, deleting the old files in.m2 folder and rebuilding resolved问题。

<!-- Updated http url -->
<repository>
   <id>bintray-central</id>
   <name>bintray</name>
   <url>https://jcenter.bintray.com</url>
</repository>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Bintray:Maven-Publish with Gradle Bintray 插件不上传 maven-metadata.xml 校验和文件 - Bintray : Maven-Publish with Gradle Bintray Plugin doesn't upload maven-metadata.xml checksum file maven-metadata.xml构建错误 - maven-metadata.xml build error Maven依赖项在中央存储库中没有jar,并且由于没有工件,Maven构建失败 - Maven dependency has no jar in the central repo and the maven build fails due to no artifact 从Maven部署到Bintray失败 - Deploying to bintray from Maven fails 由于UnsupportedClassVersionError,使用JDK 6进行Maven构建失败 - Maven build with JDK 6 fails due to UnsupportedClassVersionError testcontainers-由于测试失败,Maven构建失败 - testcontainers - maven build fails due to test failures jboss和maven:由于库未打开,Maven构建失败 - jboss & maven: maven build fails due to libraries not opening 如何强制Maven从中央存储库下载maven-metadata.xml? - How to force Maven to download maven-metadata.xml from the central repository? Bintray Gradle插件-POM不完整,无法同步到Maven Central吗? - Bintray Gradle Plugin - POM is incomplete, won't sync to Maven Central? Gradle 构建错误:无法从 https://repo1.maven.org/maven2/io/fabric/tools/gradle/maven-metadata.xml 加载 Maven 元数据 - Gradle Build Error: Unable to load Maven meta-data from https://repo1.maven.org/maven2/io/fabric/tools/gradle/maven-metadata.xml
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM