0

我正在尝试为 Scala 2.12 编译 Flink 1.7.2,以获取 AWS Kinesis 连接器,它被排除在二进制发行版之外,如此处所述

我从这里下载了源代码并使用了以下命令:

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.xmlscala-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>

之前,我成功为 Scala 2.11 编译了 Flink。为了确保我的环境没有被之前的编译污染,我删除并重新下载了 Flink 源,并彻底清除了.m2Maven 缓存。

4

1 回答 1

2

这是仅在 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 进行构建。

于 2019-04-15T10:24:01.717 回答