flink源码编译可以不编译scala代码吗

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

flink源码编译可以不编译scala代码吗

苟刚



Hi,All:


  我再尝试编译flink 1.7的源码时,遇到如下错误,本人对scala不是很了解,不知道是不是版本问题引起,另外可以去掉sacla模块编译吗:
 本机scala版本:2.13.0
JDK 版本: 1.8.0_91
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project flink-scala_2.11: Compilation failure: Compilation failure:
[ERROR] /Users/gang.gou/work/git/github/flink/flink-scala/src/main/java/org/apache/flink/api/scala/typeutils/ScalaEitherSerializerSnapshot.java:[67,44] 不兼容的类型: 无法推断org.apache.flink.api.java.typeutils.runtime.EitherSerializer<>的类型参数
[ERROR] 原因: 不存在类型变量L,R,T,T的实例, 以使org.apache.flink.api.java.typeutils.runtime.EitherSerializer<L,R>与org.apache.flink.api.common.typeutils.TypeSerializer<scala.util.Either<L,R>>一致
[ERROR] /Users/gang.gou/work/git/github/flink/flink-scala/src/main/java/org/apache/flink/api/scala/typeutils/ScalaEitherSerializerSnapshot.java:[78,86] 不兼容的类型: org.apache.flink.api.common.typeutils.TypeSerializer<scala.util.Either<L,R>>无法转换为org.apache.flink.api.java.typeutils.runtime.EitherSerializer<L,R>
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :flink-scala_2.11


Process finished with exit code 1




--
Best Wishes
   Galen.K
Reply | Threaded
Open this post in threaded view
|

Re: flink源码编译可以不编译scala代码吗

tison
Flink 编译的默认 Scala 版本是 2.11.x,你可以试着把 Scala 版本切换成 2.11.x 再编译一下。

Best,
tison.


苟刚 <[hidden email]> 于2019年8月10日周六 下午11:08写道:

>
>
>
> Hi,All:
>
>
>   我再尝试编译flink 1.7的源码时,遇到如下错误,本人对scala不是很了解,不知道是不是版本问题引起,另外可以去掉sacla模块编译吗:
>  本机scala版本:2.13.0
> JDK 版本: 1.8.0_91
> [ERROR] Failed to execute goal
> org.apache.maven.plugins:maven-compiler-plugin:3.1:compile
> (default-compile) on project flink-scala_2.11: Compilation failure:
> Compilation failure:
> [ERROR]
> /Users/gang.gou/work/git/github/flink/flink-scala/src/main/java/org/apache/flink/api/scala/typeutils/ScalaEitherSerializerSnapshot.java:[67,44]
> 不兼容的类型:
> 无法推断org.apache.flink.api.java.typeutils.runtime.EitherSerializer<>的类型参数
> [ERROR] 原因: 不存在类型变量L,R,T,T的实例,
> 以使org.apache.flink.api.java.typeutils.runtime.EitherSerializer<L,R>与org.apache.flink.api.common.typeutils.TypeSerializer<scala.util.Either<L,R>>一致
> [ERROR]
> /Users/gang.gou/work/git/github/flink/flink-scala/src/main/java/org/apache/flink/api/scala/typeutils/ScalaEitherSerializerSnapshot.java:[78,86]
> 不兼容的类型:
> org.apache.flink.api.common.typeutils.TypeSerializer<scala.util.Either<L,R>>无法转换为org.apache.flink.api.java.typeutils.runtime.EitherSerializer<L,R>
> [ERROR] -> [Help 1]
> [ERROR]
> [ERROR] To see the full stack trace of the errors, re-run Maven with the
> -e switch.
> [ERROR] Re-run Maven using the -X switch to enable full debug logging.
> [ERROR]
> [ERROR] For more information about the errors and possible solutions,
> please read the following articles:
> [ERROR] [Help 1]
> http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
> [ERROR]
> [ERROR] After correcting the problems, you can resume the build with the
> command
> [ERROR]   mvn <goals> -rf :flink-scala_2.11
>
>
> Process finished with exit code 1
>
>
>
>
> --
> Best Wishes
>    Galen.K
Reply | Threaded
Open this post in threaded view
|

Re:flink源码编译可以不编译scala代码吗

chaojianok
In reply to this post by 苟刚
Scala版本不一致,你本机的是Scala 2.13.0,Flink源码对应的是Scala 2.11,你把本机的Scala版本和Flink 1.7对应的Scala版本保持一致就可以了,建议是本地安装Scala 2.11重新编译Flink 1.7。
在 2019-08-12 15:15:38,"苟刚" <[hidden email]> 写道:

>
>
>
>Hi,All:
>
>
>  我再尝试编译flink 1.7的源码时,遇到如下错误,本人对scala不是很了解,不知道是不是版本问题引起,另外可以去掉sacla模块编译吗:
> 本机scala版本:2.13.0
>JDK 版本: 1.8.0_91
>[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project flink-scala_2.11: Compilation failure: Compilation failure:
>[ERROR] /Users/gang.gou/work/git/github/flink/flink-scala/src/main/java/org/apache/flink/api/scala/typeutils/ScalaEitherSerializerSnapshot.java:[67,44] 不兼容的类型: 无法推断org.apache.flink.api.java.typeutils.runtime.EitherSerializer<>的类型参数
>[ERROR] 原因: 不存在类型变量L,R,T,T的实例, 以使org.apache.flink.api.java.typeutils.runtime.EitherSerializer<L,R>与org.apache.flink.api.common.typeutils.TypeSerializer<scala.util.Either<L,R>>一致
>[ERROR] /Users/gang.gou/work/git/github/flink/flink-scala/src/main/java/org/apache/flink/api/scala/typeutils/ScalaEitherSerializerSnapshot.java:[78,86] 不兼容的类型: org.apache.flink.api.common.typeutils.TypeSerializer<scala.util.Either<L,R>>无法转换为org.apache.flink.api.java.typeutils.runtime.EitherSerializer<L,R>
>[ERROR] -> [Help 1]
>[ERROR]
>[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
>[ERROR] Re-run Maven using the -X switch to enable full debug logging.
>[ERROR]
>[ERROR] For more information about the errors and possible solutions, please read the following articles:
>[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
>[ERROR]
>[ERROR] After correcting the problems, you can resume the build with the command
>[ERROR]   mvn <goals> -rf :flink-scala_2.11
>
>
>Process finished with exit code 1
>
>
>
>
>--
>Best Wishes
>   Galen.K