为什么我在 Maven Central 找不到 aSmack?

Why can't I find aSmack in Maven Central?

我在这里找到了构建我自己的 aSmack jar 的所有资源,对吗? https://github.com/Flowdalic/asmack

但是如何将 aSmack jar(版本 4.0.6)放入我的 Maven/Gradle 应用程序中?

阅读 README.MD:

https://github.com/Flowdalic/asmack

它说:

Smack 4.1 adds native support for Android

Starting with Version 4.1 Smack is able to run without modifications on Android. Smack 4.1 is currently in a alpha development stage. Snapshots and alpha releases are on Maven Central. Everyone is invited to test and provide feedback.

More information on how to use Smack 4.1 in your Android Project can be found in the Smack 4.1 Readme and Upgrade Guide.

Compiled JARs Make sure to read the README for every release! Or else aSmack won't work for you. 95% of the problems people experiencing with aSmack come from the fact that they didn't read the README.

The JARs can be found @ http://asmack.freakempire.de/

带你到这里:

https://github.com/igniterealtime/Smack/wiki/Smack-4.1-Readme-and-Upgrade-Guide

然后:

针对 Android

的项目

和Gradle

repositories {
  maven {
    url 'https://oss.sonatype.org/content/repositories/snapshots'
  }
  mavenCentral()
}

带有用于 TCP 上的 XMPP 的 smack 扩展的 Smack 配置

dependencies {
  compile "org.igniterealtime.smack:smack-android-extensions:4.1.0-beta1"
  compile "org.igniterealtime.smack:smack-tcp:4.1.0-beta1"
}

基于 TCP 的 XMPP 的最小 Smack 配置

dependencies {
  compile "org.igniterealtime.smack:smack-android:4.1.0-beta1"
  compile "org.igniterealtime.smack:smack-tcp:4.1.0-beta1"
}

因为我还没有上传到OSS Sonatype,所以不会出现在Maven Central上。 :-)

您可以像任何其他 jar 库一样将 aSmack 添加到 gradle。参见 Add external jar in gradle