首页 > 解决方案 > Maven jar 插件 - 无法读取工件描述符

问题描述

我正在尝试通过 Teamcity 在另一台服务器上运行我的 Selenium 测试。项目开始编译,但 maven.jar.plugin 出现错误。

Plugin org.apache.maven.plugins:maven-jar-plugin:3.1.0 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-jar-plugin:jar:3.1.0: Could not transfer artifact org.apache.maven.plugins:maven-jar-plugin:pom:3.1.0 from/to central (https://repo.maven.apache.org/maven2): Connect to repo.maven.apache.org:443 [repo.maven.apache.org/151.101.112.215] failed

本来我那里有2.4版本,后来改成这个试试,也失败了。所以,两者都不起作用。

当然,如果我在本地手动运行测试,一切正常。

我通过调用 mvn clean verify 运行测试

我很感激任何帮助,如果您需要更多信息,请告诉我。

这是我的 pom.xml 中的插件:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-jar-plugin</artifactId>
    <version>3.1.0</version>
    <executions>
      <execution>
        <goals>
          <goal>test-jar</goal>
        </goals>
      </execution>
    </executions>
  </plugin>

标签: javamavenpluginsteamcity

解决方案


检查您是否在公司代理后面运行。如果是,那么您可能需要在 settings.xml 中添加您组织的代理设置。

<settings>
  <proxies>
   <proxy>
      <id>SOME ID</id>
      <active>true</active>
      <protocol>http</protocol>
      <host>PROXY_HOST</host>
      <port>PROXY_PORT</port>
    </proxy>
  </proxies>
</settings>

推荐阅读