“缺少...的POM,没有可用的依存关系信息";即使它存在于Maven存储库中 [英] "The POM for ... is missing, no dependency information available" even though it exists in Maven Repository

查看:444
本文介绍了“缺少...的POM,没有可用的依存关系信息";即使它存在于Maven存储库中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题:

即使我从Maven存储库中复制了依赖项,也不会下载.

A dependency will not download even though I copied it from the Maven Repository.

当我将鼠标悬停在Eclipse中的依赖项上时,它会警告:"Maven Missing artifact org.raml:jaxrs-code-generator:jar:2.0.0".

When I hover over the dependency in Eclipse, it warns: "Maven Missing artifact org.raml:jaxrs-code-generator:jar:2.0.0".

当我尝试mvn installmvn compile时,它会警告:"[WARNING] The POM for org.raml:jaxrs-code-generator:jar:2.0.0 is missing, no dependency information available".

When I try mvn install or mvn compile it warns: "[WARNING] The POM for org.raml:jaxrs-code-generator:jar:2.0.0 is missing, no dependency information available".

尝试过:

  • jar 下载到~/.m2/repository/org/raml/jaxrs-code-generator/2.0.0文件夹,然后在编辑器中刷新.

  • Downloading the jar into the ~/.m2/repository/org/raml/jaxrs-code-generator/2.0.0 folder, then refreshing in the editor.

  • 当我installcompile时,似乎忽略了它.
  • When I install or compile it seems to ignore it.

正在运行mvn -U.

  • installcompile相同.
  • Same as with install or compile.

深入:

    <dependency>
        <groupId>org.raml</groupId>
        <artifactId>jaxrs-code-generator</artifactId>
        <version>2.0.0</version>
    </dependency>

  • Maven中的依赖项存在存储库(版本也正确).

    • The dependency exists in the Maven Repository (the version is also correct).

      使用Eclipse EE Neon 4.6.3,Apache Maven 3.3.9,Java 1.8.0_121.

      Using Eclipse EE Neon 4.6.3, Apache Maven 3.3.9, Java 1.8.0_121.

      ~/.m2文件夹中没有settings.xml.

      我不使用任何其他本地或其他存储库.

      I don't use any other repositories, local or otherwise.

      推荐答案

      仔细阅读警告消息:

      缺少org.raml:jaxrs-code-generator:jar:2.0.0的POM,否 可用的依赖项信息

      The POM for org.raml:jaxrs-code-generator:jar:2.0.0 is missing, no dependency information available

      问题不是罐子,而是缺少的pom.xml.
      pom.xml列出了Maven在构建和整个应用程序打包期间将拉出的该jar所需的依赖关系. 因此,您可能真的需要它.

      The problem is not the jar, but the pom.xml that is missing.
      The pom.xml lists the required dependencies for this jar that Maven will pull during the build and overall the packaging of your application. So, you may really need it.

      请注意,其他Maven依赖项当然可能会出现此问题,并且解决该问题的思路始终相同.

      Note that this problem may of course occur for other Maven dependencies and the ideas to solve that is always the same.

      The子网站的文档很好,除了与之相关的一些信息.

      The Mule website documents very well that in addition to some information related to.

      1)快速解决方法:在Internet上寻找工件的pom.xml

      1) Quick workaround : looking for in the internet the pom.xml of the artifact

      谷歌搜索工件ID,组ID及其版本 有趣的结果:maven存储库链接下载它.
      如果是org.raml:jaxrs-code-generator:jar:2.0.0依赖项,则可以从Maven ule存储库中下载pom.xml:

      Googling the artifact id, the group id and its version gives generally interesting results : maven repository links to download it.
      In the case of the org.raml:jaxrs-code-generator:jar:2.0.0 dependency, you can download the pom.xml from the Maven mule repository :

      https://repository.mulesoft.org/nexus/content/repositories/releases/org/raml/jaxrs-code-generator/2.0.0/

      2)清理单个Maven项目的解决方法:在pom中添加存储库声明.

      在您的情况下,添加Maven ule存储库:

      In your case, add the Maven mule repositories :

      <?xml version="1.0" encoding="UTF-8"?>
      <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
          <modelVersion>4.0.0</modelVersion>
          ...
          <repositories>
              <repository>
                  <id>mulesoft-releases</id>
                  <name>MuleSoft Repository</name>
                  <url>http://repository.mulesoft.org/releases/</url>
                  <layout>default</layout>
              </repository>
              <repository>
                  <id>mulesoft-snapshots</id>
                  <name>MuleSoft Snapshot Repository</name>
                  <url>http://repository.mulesoft.org/snapshots/</url>
                  <layout>default</layout>
              </repository>
          </repositories>
          ...
      </project>
      

      3)清理所有Maven项目的解决方法:在settings.xml

      3) Clean workaround for any Maven projects : add the repository declaration in your settings.xml

       <profile> 
         <repositories>
          ...
          <repository>
            <id>mulesoft-releases</id>
            <name>MuleSoft Repository</name>
            <url>http://repository.mulesoft.org/releases/</url>
            <layout>default</layout>
          </repository>
          <repository>
            <id>mulesoft-snapshots</id>
            <name>MuleSoft Snapshot Repository</name>
            <url>http://repository.mulesoft.org/snapshots/</url>
            <layout>default</layout>
          </repository>
           ...
        </repositories>     
      </profile>
      

      请注意,在极少数情况下,pom.xml声明依赖项不存在.因此,您必须确定自己是否工件需要依赖项.

      Note that in some rare cases, the pom.xml declaring the dependencies is nowhere. So, you have to identify yourself whether the artifact requires dependencies.

      这篇关于“缺少...的POM,没有可用的依存关系信息";即使它存在于Maven存储库中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆