我正在尝试为Scala 2.12编译Flink 1.7.2,以获取AWS Kinesis连接器,该连接器已从二进制发行版中排除,如here所述。
我从here下载了源代码,并使用了以下命令:
mvn clean install -Pscala-2.12 -Pinclude-kinesis -DskipTests
但是我遇到以下错误:
[INFO] --- maven-enforcer-plugin:3.0.0-M1:enforce (enforce-versions) @ flink-runtime_2.12 ---
[WARNING] Rule 0: org.apache.maven.plugins.enforcer.BannedDependencies failed with message:
Found Banned Dependency: com.typesafe.akka:akka-testkit_2.12:jar:2.4.20
Found Banned Dependency: com.typesafe.akka:akka-remote_2.12:jar:2.4.20
Found Banned Dependency: org.scala-lang.modules:scala-java8-compat_2.12:jar:0.8.0
Found Banned Dependency: com.typesafe:ssl-config-core_2.12:jar:0.2.1
Found Banned Dependency: org.clapper:grizzled-slf4j_2.12:jar:1.3.2
Found Banned Dependency: com.github.scopt:scopt_2.12:jar:3.5.0
Found Banned Dependency: org.apache.flink:flink-queryable-state-client-java_2.12:jar:1.7.2
Found Banned Dependency: com.typesafe.akka:akka-protobuf_2.12:jar:2.4.20
Found Banned Dependency: com.twitter:chill_2.12:jar:0.7.6
Found Banned Dependency: org.scalatest:scalatest_2.12:jar:3.0.0
Found Banned Dependency: com.typesafe.akka:akka-actor_2.12:jar:2.4.20
Found Banned Dependency: com.typesafe.akka:akka-slf4j_2.12:jar:2.4.20
Found Banned Dependency: org.scalactic:scalactic_2.12:jar:3.0.0
Found Banned Dependency: com.typesafe.akka:akka-stream_2.12:jar:2.4.20
Found Banned Dependency: org.scala-lang.modules:scala-xml_2.12:jar:1.0.5
Found Banned Dependency: org.scala-lang.modules:scala-parser-combinators_2.12:jar:1.0.4
Use 'mvn dependency:tree' to locate the source of the banned dependencies.
我不明白为什么要禁止这些依赖项,因为pom.xml
的{{1}}配置文件中的依赖项是通过以下方式禁止的:
scala-2.12
以前,我已经成功为Scala 2.11编译了Flink。为了确保我的环境不受以前的编译污染,我删除并重新下载了Flink源,然后完全清除了<!-- make sure we don't have any _2.10 or _2.11 dependencies when building
for Scala 2.12 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<executions>
<execution>
<id>enforce-versions</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<bannedDependencies>
<excludes combine.children="append">
<exclude>*:*_2.11</exclude>
<exclude>*:*_2.10</exclude>
</excludes>
</bannedDependencies>
</rules>
</configuration>
</execution>
</executions>
</plugin>
Maven缓存。
答案 0 :(得分:1)
这是仅在1.9.0中修复的flink错误,有关详细信息,请参见https://issues.apache.org/jira/browse/FLINK-12007。
作为解决方法,请使用mvn clean install -Pinclude-kinesis -DskipTests -Pscala-2.12 -Dscala-2.12
进行构建。并记住使用JDK8进行构建。