hivemq / hivemq-mqtt-client

HiveMQ MQTT Client is an MQTT 5.0 and MQTT 3.1.1 compatible and feature-rich high-performance Java client library with different API flavours and backpressure support
https://hivemq.github.io/hivemq-mqtt-client/
Apache License 2.0
847 stars 158 forks source link

1.3.0 compile error #519

Closed kaiseiyouse closed 2 years ago

kaiseiyouse commented 2 years ago

Expected behavior

1.3.0 compile successfully

Actual behavior

1.3.0 compile error Execution failed for task ':compileJava'.

Could not resolve all files for configuration ':compileClasspath'. Could not resolve com.hivemq:hivemq-mqtt-client-websocket:1.3.0. Required by: project : No matching variant of com.hivemq:hivemq-mqtt-client-websocket:1.3.0 was found. The consumer was configured to find an API of a library compatible with Java 8, preferably in the form of class files, and its dependencies declared externally but:

  • Variant 'apiElements' capability com.hivemq:hivemq-mqtt-client-websocket:1.3.0 declares an API of a component:
  • Incompatible because this component declares a platform and the consumer needed a library
  • Other compatible attributes:
  • Doesn't say anything about how its dependencies are found (required its dependencies declared externally)
  • Doesn't say anything about its target Java version (required compatibility with Java 8)
  • Doesn't say anything about its elements (required them preferably in the form of class files)
  • Variant 'enforcedApiElements' capability com.hivemq:hivemq-mqtt-client-websocket-derived-enforced-platform:1.3.0 declares an API of a component:
  • Incompatible because this component declares an enforced platform and the consumer needed a library
  • Other compatible attributes:
  • Doesn't say anything about how its dependencies are found (required its dependencies declared externally)
  • Doesn't say anything about its target Java version (required compatibility with Java 8)
  • Doesn't say anything about its elements (required them preferably in the form of class files)
  • Variant 'enforcedRuntimeElements' capability com.hivemq:hivemq-mqtt-client-websocket-derived-enforced-platform:1.3.0 declares a runtime of a component:
  • Incompatible because this component declares an enforced platform and the consumer needed a library
  • Other compatible attributes:
  • Doesn't say anything about how its dependencies are found (required its dependencies declared externally)
  • Doesn't say anything about its target Java version (required compatibility with Java 8)
  • Doesn't say anything about its elements (required them preferably in the form of class files)
  • Variant 'runtimeElements' capability com.hivemq:hivemq-mqtt-client-websocket:1.3.0 declares a runtime of a component:
  • Incompatible because this component declares a platform and the consumer needed a library
  • Other compatible attributes:
  • Doesn't say anything about how its dependencies are found (required its dependencies declared externally)
  • Doesn't say anything about its target Java version (required compatibility with Java 8)
  • Doesn't say anything about its elements (required them preferably in the form of class files) Could not resolve com.hivemq:hivemq-mqtt-client-proxy:1.3.0. Required by: project : No matching variant of com.hivemq:hivemq-mqtt-client-proxy:1.3.0 was found. The consumer was configured to find an API of a library compatible with Java 8, preferably in the form of class files, and its dependencies declared externally but:
  • Variant 'apiElements' capability com.hivemq:hivemq-mqtt-client-proxy:1.3.0 declares an API of a component:
  • Incompatible because this component declares a platform and the consumer needed a library
  • Other compatible attributes:
  • Doesn't say anything about how its dependencies are found (required its dependencies declared externally)
  • Doesn't say anything about its target Java version (required compatibility with Java 8)
  • Doesn't say anything about its elements (required them preferably in the form of class files)
  • Variant 'enforcedApiElements' capability com.hivemq:hivemq-mqtt-client-proxy-derived-enforced-platform:1.3.0 declares an API of a component:
  • Incompatible because this component declares an enforced platform and the consumer needed a library
  • Other compatible attributes:
  • Doesn't say anything about how its dependencies are found (required its dependencies declared externally)
  • Doesn't say anything about its target Java version (required compatibility with Java 8)
  • Doesn't say anything about its elements (required them preferably in the form of class files)
  • Variant 'enforcedRuntimeElements' capability com.hivemq:hivemq-mqtt-client-proxy-derived-enforced-platform:1.3.0 declares a runtime of a component:
  • Incompatible because this component declares an enforced platform and the consumer needed a library
  • Other compatible attributes:
  • Doesn't say anything about how its dependencies are found (required its dependencies declared externally)
  • Doesn't say anything about its target Java version (required compatibility with Java 8)
  • Doesn't say anything about its elements (required them preferably in the form of class files)
  • Variant 'runtimeElements' capability com.hivemq:hivemq-mqtt-client-proxy:1.3.0 declares a runtime of a component:
  • Incompatible because this component declares a platform and the consumer needed a library
  • Other compatible attributes:
  • Doesn't say anything about how its dependencies are found (required its dependencies declared externally)
  • Doesn't say anything about its target Java version (required compatibility with Java 8)
  • Doesn't say anything about its elements (required them preferably in the form of class files)

To Reproduce

Steps

change hivemq version, refresh gradle, only hivemq-mqtt-client:1.3.0 jar get downloaded from maven central. Here is part of my build.gradle file

ext {
    hivemqVersion = '1.3.0'
}
allprojects {
    repositories {
        mavenCentral()
        maven { url "https://repo.spring.io/snapshot" }
        maven { url "https://repo.spring.io/milestone" }
    }

    sourceCompatibility = JavaVersion.VERSION_1_8
    targetCompatibility = JavaVersion.VERSION_1_8
}
dependencies {
    implementation group: "com.hivemq", name: "hivemq-mqtt-client", version: hivemqVersion
    implementation group: "com.hivemq", name: "hivemq-mqtt-client-websocket", version: hivemqVersion
    implementation group: "com.hivemq", name: "hivemq-mqtt-client-proxy", version: hivemqVersion
   // other dependencies
}

gradle version 6.4

Reproducer code

Details

kaiseiyouse commented 2 years ago

1.2.0 works for me but 1.3.0 doesn't, can anyone help?

SgtSilvio commented 2 years ago

Hi @kaiseiyouse In your build.gradle please replace

implementation group: "com.hivemq", name: "hivemq-mqtt-client-websocket", version: hivemqVersion
implementation group: "com.hivemq", name: "hivemq-mqtt-client-proxy", version: hivemqVersion

with

implementation(platform("com.hivemq:hivemq-mqtt-client-websocket:$hivemqVersion"))
implementation(platform("com.hivemq:hivemq-mqtt-client-proxy:$hivemqVersion"))

(This is also documented (but unfortunately not updated for 1.3.0) here: https://hivemq.github.io/hivemq-mqtt-client/docs/installation/)

Sorry for the inconvenience.

kaiseiyouse commented 2 years ago

Thanks SgtSilvio!