【问题标题】:I'm facing this error when I try to deploy my Maven project to Artifactory当我尝试将 Maven 项目部署到 Artifactory 时遇到此错误
【发布时间】:2020-10-05 15:37:33
【问题描述】:

我已经尝试修复此错误几天了,我尝试删除错误中描述的文件它不起作用,我尝试删除整个存储库文件夹并重新创建它也不起作用.

Failed to update metadata org.jfrog.test:multi:3.7-SNAPSHOT/maven-metadata.xml: Could not parse metadata /root/.m2/repository/org/jfrog/test/multi/3.7-SNAPSHOT/maven-metadata-central.xml: unexpected markup <!d (position: START_DOCUM[enter image description here][1]ENT seen <!d... @1:3) 

错误中描述的文件 (maven-metadata-central.xml) 包含以下信息:

  <!doctype html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=apple-touch-icon sizes=180x180 href=./apple-touch-icon.png><link rel=icon type=image/png sizes=32x32 href=./favicon-32x32.png><link rel=icon type=image/png sizes=16x16 href=./favicon-16x16.png><link rel=mask-icon href=./safari-pinned-tab.svg color=#f5f5f2><link rel="shortcut icon" href=./favicon.ico><title>JFrog</title><base href=/ui/ ><style>@keyframes heartbeatOut{from{opacity:1}50%{opacity:0;transform:scale(.8)}to{opacity:0;transform:scale(.8)}}@keyframes heartbeat{from{transform:scale3d(1,1,1)}50%{transform:scale3d(1.15,1.15,1.15)}to{transform:scale3d(1,1,1)}}.pounding-heart-container{display:none;align-items:center;justify-content:center;position:absolute;left:0;right:0;top:0;bottom:0;z-index:9999999999;background:linear-gradient(132.49deg,#414857 14.17%,#252831 83.36%)}.pounding-heart-container.show-splash{display:flex}.logo{width:130px;-webkit-backface-visibility:hidden;-ms-transform:translateZ(0);-webkit-transform:translateZ(0);transform:translateZ(0)}.logo.pulse{animation:heartbeat 1.7s infinite}.logo.zoom-out{animation:heartbeatOut 1s forwards}</style><link href=/ui/css/chunk-352dc7c6.401ea4f7.css rel=prefetch><link href=/ui/css/chunk-405f6580.168759e2.css rel=prefetch><link href=/ui/css/chunk-427608b0.f355b6e5.css rel=prefetch><link href=/ui/css/chunk-67042b0c.cbbb24c0.css rel=prefetch><link href=/ui/css/chunk-6fb2c1a5.5b98cb77.css rel=prefetch><link href=/ui/js/chunk-352dc7c6.0d93f03c.js rel=prefetch><link href=/ui/js/chunk-405f6580.588ea0bb.js rel=prefetch><link href=/ui/js/chunk-427608b0.3e53833e.js rel=prefetch><link href=/ui/js/chunk-67042b0c.f8c2ce89.js rel=prefetch><link href=/ui/js/chunk-6fb2c1a5.4af081f5.js rel=prefetch><link href=/ui/css/app.12ca8cca.css rel=preload as=style><link href=/ui/css/chunk-vendors.265cedcc.css rel=preload as=style><link href=/ui/js/app.2bd62c77.js rel=preload as=script><link href=/ui/js/chunk-vendors.d334e426.js rel=preload as=script><link href=/ui/css/chunk-vendors.265cedcc.css rel=stylesheet><link href=/ui/css/app.12ca8cca.css rel=stylesheet></head><body><div class="pounding-heart-container show-splash"><img class="logo pulse" src=/ui/img/jfrog.8f770bff.svg></div><script>(function () {

            const splashScreen = document.querySelector('.pounding-heart-container');
            const logo = document.querySelector('.logo');

            window.showSplashPulse = function () {
                splashScreen.classList.add('show-splash');
            };

            window.hideSplashPulse = function () {
                window.setTimeout(function () {
                    splashScreen.classList.remove('show-splash');
                }, 1100);

                logo.classList.add('zoom-out');
                logo.classList.remove('pulse');

            };
        })();</script><noscript><strong>We're sorry but jfrog webapp doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><link rel=stylesheet type=text/css href=/ui/webapp/css/vendorStyles.css><link rel=stylesheet type=text/css href=/ui/webapp/css/application.css><div id=app></div><script src=/ui/js/chunk-vendors.d334e426.js></script><script src=/ui/js/app.2bd62c77.js></script></body></html>

这就是我的“settings.xml”文件包含的内容:

<?xml version="1.0" encoding="UTF-8"?>
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd" xmlns="http://maven.apache.org/SETTINGS/1.1.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <servers>
    <server>
      <username>${security.getCurrentUsername()}</username>
      <password>${security.getEscapedEncryptedPassword()!"password"}</password>
      <id>central</id>
    </server>
    <server>
      <username>${security.getCurrentUsername()}</username>
      <password>${security.getEscapedEncryptedPassword()!"password"}</password>
      <id>snapshots</id>
    </server>
  </servers>
  <profiles>
    <profile>
      <repositories>
        <repository>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
          <id>central</id>
          <name>libs-release</name>
          <url>http://localhost:8082/ui/repos/tree/General/libs-release-local</url>
        </repository>
        <repository>
          <snapshots />
          <id>snapshots</id>
          <name>libs-snapshot</name>
          <url>http://localhost:8082/ui/repos/tree/General/libs-snapshot-local</url>
        </repository>
      </repositories>
      <pluginRepositories>
        <pluginRepository>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
          <id>central</id>
          <name>libs-release</name>
          <url>http://localhost:8082/ui/repos/tree/General/libs-release-local</url>
        </pluginRepository>
        <pluginRepository>
          <snapshots />
          <id>snapshots</id>
          <name>libs-snapshot</name>
          <url>http://localhost:8082/ui/repos/tree/General/libs-snapshot-local</url>
        </pluginRepository>
      </pluginRepositories>
      <id>artifactory</id>
    </profile>
  </profiles>
  <activeProfiles>
    <activeProfile>artifactory</activeProfile>
  </activeProfiles>
</settings>

【问题讨论】:

    标签: javascript linux maven deployment artifactory


    【解决方案1】:

    当我有一个公司代理阻止我的请求时,我已经看到了这种情况。你能检查一下你的 settings.xml 中是否需要代理吗?

    代理正在返回一个 html 响应,这就是您看到此错误的原因。

    【讨论】:

    • 感谢您的回答,不是真的,“settings.xml”文件不包含任何代理的任何内容。
    • 也许你需要设置代理。 IE。如果您落后于代理,您可能需要在 settings.xml 中使用代理。
    【解决方案2】:

    问题在于您在 Maven 设置中使用的存储库 URL。
    您当前正在使用适合网页浏览的 Artifactory Web UI 的 URL:

    http://localhost:8082/ui/repos/tree/General/libs-release-local
    

    而您应该使用以下内容

    http://localhost:8081/artifactory/libs-release-local
    

    为了更轻松地配置 Maven,我建议遵循 Artifactory 文档的 Maven Repositories 部分

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-11-22
      • 2017-03-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多