无法读取org.apache.maven.plugins:maven-source-plugin:jar:2.4的工件描述符 [英] Failed to read artifact descriptor for org.apache.maven.plugins:maven-source-plugin:jar:2.4

查看:2050
本文介绍了无法读取org.apache.maven.plugins:maven-source-plugin:jar:2.4的工件描述符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

感谢Dropwizard Maven原型,我生成了一个示例Dropwizard Maven项目. pom.xml特别使用maven-source-plugin:

Thanks to a Dropwizard Maven archetype I generated a sample Dropwizard Maven project. The pom.xml notably uses maven-source-plugin:

<plugin>
    <artifactId>maven-source-plugin</artifactId>
    <version>2.4</version>
    <executions>
        <execution>
           <id>attach-sources</id>
           <goals>
              <goal>jar</goal>
           </goals>
        </execution>
    </executions>
</plugin>

当我运行全新安装"时,出现以下错误:

When I run "clean install" I have the following error :

插件org.apache.maven.plugins:maven-source-plugin:2.4或其依赖项之一无法解析:无法读取org.apache.maven.plugins:maven-source-plugin:jar的工件描述符:2.4:无法将工件org.apache.maven.plugins:maven-source-plugin:pom:2.4从中央转移到中央( http://repo.maven.apache.org/maven2 ):连接被拒绝:connect-> [帮助1]

Plugin org.apache.maven.plugins:maven-source-plugin:2.4 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-source-plugin:jar:2.4: Could not transfer artifact org.apache.maven.plugins:maven-source-plugin:pom:2.4 from/to central (http://repo.maven.apache.org/maven2): Connection refused: connect -> [Help 1]

"maven-source-plugin"依赖项存储在我公司的Nexus存储库中.所以我尝试在依赖项和/dependencies之间添加插件依赖项:

The "maven-source-plugin" dependency is stored in the Nexus repository of my company. So I tried the adding of the plugin dependency between dependencies and /dependencies :

<dependencies>
    ...
    <dependency>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>2.4</version>
    </dependency>
</dependencies>

但是它不能解决问题.我还尝试在插件的调用中添加依赖项:

but it did not correct the problem. I also tried to add the dependency at the call of the plugin :

 <plugin>
    <artifactId>maven-source-plugin</artifactId>
    <version>2.4</version>
    <executions>
       <execution>
           <id>attach-sources</id>
           <goals>
              <goal>jar</goal>
           </goals>
       </execution>
      </executions>
      <dependencies>
          <dependency>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-source-plugin</artifactId>
              <version>2.4</version>
          </dependency>
     </dependencies>
 </plugin>

但它也不起作用

推荐答案

两种可能的情况:

  • 您的公司使用代理连接到公共Maven存储库.然后询问您公司中的某人代理的IP地址是什么,然后将其放入您的settings.xml文件中

  • Your company uses a proxy to connect to the public Maven repository. Then ask someone in your company what the IP address of the proxy is then put it in your settings.xml file

您的公司拥有自己的Maven存储库(例如Nexus存储库).然后询问公司中的某人Nexus存储库是什么,然后将其放入pom.xml或settings.xml中.请参见将maven nexus存储库添加到我的pom.xml https://maven.apache.org/guides/mini/guide-multiple -repositories.html

Your company has its/their own Maven repository/ies (Nexus repository for example). Then ask someone in your company what the Nexus repository is then put it in your pom.xml or in your settings.xml. See Adding maven nexus repo to my pom.xml and https://maven.apache.org/guides/mini/guide-multiple-repositories.html

这篇关于无法读取org.apache.maven.plugins:maven-source-plugin:jar:2.4的工件描述符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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