2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

メモ:paho Java Client 1.0.0 の(非推奨な)導入方法

Last updated at Posted at 2014-09-27

*より良い方法があればコメントおねがいします。

状況

現状、pom.xmlに、paho mqtt-clientのdependencyを書いても1.0.0が取得できず。0.4.0までしかダウンロードできない。

理由

Eclipse Pahoレポジトリの構成が変わった。

0.4.0
/org/eclipse/paho/mqtt-client/0.4.0/mqtt-client-0.4.0.jar

1.0.0
/org/eclipse/paho/org.eclipse.paho.client.mqttv3/1.0.0/org.eclipse.paho.client.mqttv3-1.0.0.jar

pom.xmlの書き方

mqtt-client-0.4.0.jar
<repositories>
    <repository>
        <id>Eclipse Paho Repo</id>
        <url>https://repo.eclipse.org/content/repositories/paho-releases/</url>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>org.eclipse.paho</groupId>
        <artifactId>mqtt-client</artifactId>
        <version>0.4.0</version>
    </dependency>
</dependencies>
mqtt-client-1.0.0.jar
<repositories>
    <repository>
        <id>Eclipse Paho Repo</id>
        <url>https://repo.eclipse.org/content/repositories/paho-releases/</url>
    </repository>
</repositories>

<!-- mavenから依存関係解消できない -->
<dependencies>
    <dependency>
        <groupId>org.eclipse.paho</groupId>
        <artifactId>mqtt-client</artifactId>
        <version>1.0.0</version>
    </dependency>
</dependencies>

## アドホックなインストール方法
ローカルに別名でインストールしてしまう。

インストール
wget https://repo.eclipse.org/content/repositories/paho-releases/org/eclipse/paho/org.eclipse.paho.client.mqttv3/1.0.0/org.eclipse.paho.client.mqttv3-1.0.0.jar

mvn install:install-file -DartifactId=mqtt-client -DgroupId=org.eclipse.paho -Dversion=1.0.0  -Dpackaging=jar -Dfile=./org.eclipse.paho.client.mqttv3-1.0.0.jar

これで、mqtt-client-1.0.0.jarの依存関係が解消できる。

参考文献

paho Java Client 紹介ページ(公式)
http://www.eclipse.org/paho/clients/java/

参考にしたページ
https://issues.jboss.org/browse/ENTMQ-751

2
2
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?