我正在尝试为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
配置文件中的scala-2.12
,依赖关系被禁止这样:
<!-- 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>
以前,我成功编译了Flink for Scala 2.11。为了确保我的环境没有从之前的编译中被污染,我删除并重新下载了Flink源代码,并且我完全删除了.m2
Maven缓存。
这是仅在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进行构建。