我正在尝试将Flink与RabbitMq流连接器一起使用。已尝试所有可能的版本组合,但仍然失败。
这是我的 sbt 构建代码段
scalaVersion in ThisBuild := "2.11.7"
val flinkVersion = "1.0.0"
val json4sNative = "org.json4s" %% "json4s-native" % "3.3.0"
val flinkDependencies = Seq(
"org.apache.flink" %% "flink-scala" % flinkVersion % "provided",
"org.apache.flink" %% "flink-streaming-scala" % flinkVersion % "provided",
"org.apache.flink" %% "flink-connector-rabbitmq" % "0.10.1",
json4sNative)
错误片段
[error] (root/*:assembly) deduplicate: different file contents found in the following:
[error] /Users/gopigrip7/.ivy2/cache/javax.xml.stream/stax-api/jars/stax-api-1.0-2.jar:javax/xml/stream/EventFilter.class
[error] /Users/gopigrip7/.ivy2/cache/stax/stax-api/jars/stax-api-1.0.1.jar:javax/xml/stream/EventFilter.class
[error] deduplicate: different file contents found in the following:
[error] /Users/gopigrip7/.ivy2/cache/javax.xml.stream/stax-api/jars/stax-api-1.0-2.jar:javax/xml/stream/FactoryConfigurationError.class
[error] /Users/gopigrip7/.ivy2/cache/stax/stax-api/jars/stax-api-1.0.1.jar:javax/xml/stream/FactoryConfigurationError.class
[error] deduplicate: different file contents found in the following:
[error] /Users/gopigrip7/.ivy2/cache/javax.xml.stream/stax-api/jars/stax-api-1.0-2.jar:javax/xml/stream/FactoryFinder$1.class
[error] /Users/gopigrip7/.ivy2/cache/stax/stax-api/jars/stax-api-1.0.1.jar:javax/xml/stream/FactoryFinder$1.class
[error] deduplicate: different file contents found in the following:
[error] /Users/gopigrip7/.ivy2/cache/javax.xml.stream/stax-api/jars/stax-api-1.0-2.jar:javax/xml/stream/FactoryFinder$ClassLoaderFinder.class
[error] /Users/gopigrip7/.ivy2/cache/stax/stax-api/jars/stax-api-1.0.1.jar:javax/xml/stream/FactoryFinder$ClassLoaderFinder.class
[error] deduplicate: different file contents found in the following:
[error] /Users/gopigrip7/.ivy2/cache/javax.xml.stream/stax-api/jars/stax-api-1.0-2.jar:javax/xml/stream/FactoryFinder$ClassLoaderFinderConcrete.class
[error] /Users/gopigrip7/.ivy2/cache/stax/stax-api/jars/stax-api-1.0.1.jar:javax/xml/stream/FactoryFinder$ClassLoaderFinderConcrete.class
[error] deduplicate: different file contents found in the following:
[error] /Users/gopigrip7/.ivy2/cache/javax.xml.stream/stax-api/jars/stax-api-1.0-2.jar:javax/xml/stream/FactoryFinder.class
[error] /Users/gopigrip7/.ivy2/cache/stax/stax-api/jars/stax-api-1.0.1.jar:javax/xml/stream/FactoryFinder.class
[error] deduplicate: different file contents found in the following:
[error]
您是否尝试过使用相同的 Flink 依赖项版本进行构建?我使用以下 SBT 配置成功构建 ( sbt assembly
):
name := "flink-sbt-sample"
version := "1.0"
scalaVersion := "2.11.7"
val flinkVersion = "1.0.0"
libraryDependencies ++= Seq(
"org.apache.flink" %% "flink-scala" % flinkVersion % "provided",
"org.apache.flink" %% "flink-streaming-scala" % flinkVersion % "provided",
"org.apache.flink" %% "flink-connector-rabbitmq" % flinkVersion,
"org.json4s" %% "json4s-native" % "3.3.0"
)
请注意,有一个关于 Flink 项目 SBT 的指南(https://ci.apache.org/projects/flink/flink-docs-master/quickstart/scala_api_quickstart.html#sbt)。