无法为scala 2.12编译flink 1.7.2:maven enforcer发现禁用的依赖项

llew8vvj  于 2021-06-21  发布在  Flink
关注(0)|答案(1)|浏览(616)

我正试图为Scala2.12编译Flink1.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.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>

以前,我成功地为Scala2.11编译了flink。为了确保我的环境没有因为之前的编译而受到污染,我删除并重新下载了flink源代码,并彻底清除了 .m2 maven缓存。

cidc1ykv

cidc1ykv1#

这是一个仅在1.9.0中修复的flink bug,请参阅https://issues.apache.org/jira/browse/flink-12007 详情。
作为解决方法,使用 mvn clean install -Pinclude-kinesis -DskipTests -Pscala-2.12 -Dscala-2.12 . 记住使用jdk8进行构建。

相关问题