java - 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>
解决方案
检查您是否在公司代理后面运行。如果是,那么您可能需要在 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>
推荐阅读
- sql - SQL将日期中的小时和分钟提取到单个列中
- c++ - 如何创建不同原型的函数指针数组?
- reactjs - 从头开始反应管理布局组件
- elasticsearch - Elasticsearch 6.4.3 中的查询字符串
- mysql - MySQL 更新时出现错误 1064,但查询看起来正确
- common-lisp - 如何在运行时编译 s-expression,然后在 Common Lisp 中执行
- html - HEAD 内部标签显示在 BODY 标签中
- javascript - 使用 Javascript 在 Google 地图中显示/隐藏标记集群
- java - 在 Javafx 中实现 sql 查询的问题
- c# - 使用单声道时缺少 Microsoft.Extensions.DependencyInjection 的 System.Collection 依赖项