You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Maven安装Binance期货Java连接器测试失败及依赖引入咨询

使用Binance期货Java连接器遇到的Maven问题

问题背景

  • 首次接触Maven,尝试使用Binance提供的binance-futures-connector-java库对接期货API
  • 按官方步骤下载库的ZIP包并解压,进入pom.xml所在目录执行mvn install命令时出现构建失败

报错详情

Tests in error:
testNewOrder(unit.cm_futures.account.TestCMNewOrder)
testNewOrder(unit.um_futures.account.TestUMNewOrder)

Tests run: 302, Failures: 3, Errors: 2, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 11.241 s
[INFO] Finished at: 2023-01-12T12:55:38+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project binance-futures-connector-java: There are test failures.

已尝试的解决操作

  • 使用下载的原始pom.xml文件,已在PrivateConfig类中配置好API密钥
  • 在pom.xml中添加Maven Surefire插件配置:
<plugin>
   <groupId>org.apache.maven.plugins</groupId>
   <artifactId>maven-surefire-plugin</artifactId>
   <version>2.12.4</version>
</plugin>
  • 执行命令 mvn clean install -U,但报错情况未改变

额外疑问

在IntelliJ IDEA中新建Maven项目时,直接在pom.xml中添加以下依赖是否正确?

<dependency>
    <groupId>io.github.binance</groupId>
    <artifactId>binance-futures-connector-java</artifactId>
    <version>1.0.0</version>
</dependency>

内容的提问来源于stack exchange,提问作者Aljaž Holobar

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.04 20:10:27