我正在尝试使用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]
答案 0 :(得分:2)
您是否尝试使用相同的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"
)
请注意,有一个使用SBT(https://ci.apache.org/projects/flink/flink-docs-master/quickstart/scala_api_quickstart.html#sbt)的Flink项目指南。