I build a project using Maven that refers to artifacts from 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.
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.
<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/).
Is Artifactory calling jcenter.bintray to get details of the library? If that is the case, how can we configure Artifactory to use the https URL or to understand the http redirect?