我想在我的项目中导入以下库,该怎么做?
import org.eclipse.paho.client.mqttv3.MqttCallback;
import org.eclipse.paho.client.mqttv3.MqttClient;
import org.eclipse.paho.client.mqttv3.MqttConnectOptions;
import org.eclipse.paho.client.mqttv3.MqttDeliveryToken;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.eclipse.paho.client.mqttv3.MqttMessage;
import org.eclipse.paho.client.mqttv3.MqttTopic;我必须下载文件吗?或者我必须链接到eclipse.org?如何导入?任何提示。谢谢。
发布于 2018-07-09 23:52:52
The documentation for Eclipse Paho确切地解释了要做什么:
Maven为那些想要使用
来管理其依赖项的人托管了一个Nexus存储库。发布的库也可以在Maven Central存储库中找到。
将如下所示的存储库定义和依赖项定义添加到pom.xml中。
将%REPOURL%替换为https://repo.eclipse.org/content/repositories/paho-releases/ (对于正式版本)或https://repo.eclipse.org/content/repositories/paho-snapshots/ (对于夜间快照)。将%VERSION%替换为所需的级别。最新发布版本为1.0.2,当前快照版本为1.0.3。
<project ...>
<repositories>
<repository>
<id>Eclipse Paho Repo</id>
<url>%REPOURL%</url>
</repository>
</repositories>
...
<dependencies>
<dependency>
<groupId>org.eclipse.paho</groupId>
<artifactId>org.eclipse.paho.client.mqttv3</artifactId>
<version>%VERSION%</version>
</dependency>
</dependencies>
</project>发布于 2018-07-10 21:26:20
https://stackoverflow.com/questions/51249461
复制相似问题