Flink之源码本地构建(一)

1、准备工作:

windows10 + java8 1.8.0_261 + maven3.1.1 + idea14

特别的,maven版本为官方推荐的,试了其他版本,未能成功构建。jdk8要用高版本的261。

2、从git clone源码,不再赘述 

https://github.com/apache/flink.git

3、右键源码根目录

4、时间大概需要半小时,耐心等待,可以去喝杯茶或者撸点代码...

5、wordcount小例子跑起来,开始源码之旅~

6、修改代码后,执行mvn clean install -DskipTests,等待...喝茶

 

FAQ:

1·、org.apache.flink.sql.parser.utils类中包导入import org.apache.flink.sql.parser.impl.ParseException失败问题。排查过程中,发现源码确实没有该包。最终切换maven版本后,重新generate Sources搞定。最终生成的源码,注意这个是maven插件生成的,文件夹的样式可以看出来。

2、Error:(550, 53) java: 未报告的异常错误X; 必须对其进行捕获或声明以便抛出 

一开始本地的jdk8是40小版本,静态代码编译不过,可是查了git发现代码也这样,那就不是代码原因,否则早改了。考虑是自身环境问题,升级jdk8 261版本后搞定。

3、license问题,注释根pom下的插件。

<!--<plugin>-->
				<!--<groupId>org.apache.rat</groupId>-->
				<!--<artifactId>apache-rat-plugin</artifactId>-->
				<!--<version>0.12</version>&lt;!&ndash;$NO-MVN-MAN-VER$&ndash;&gt;-->
				<!--<inherited>false</inherited>-->
				<!--<executions>-->
					<!--<execution>-->
						<!--<phase>verify</phase>-->
						<!--<goals>-->
							<!--<goal>check</goal>-->
						<!--</goals>-->
					<!--</execution>-->
				<!--</executions>-->
				<!--<configuration>-->
					<!--<excludeSubProjects>false</excludeSubProjects>-->
					<!--<numUnapprovedLicenses>0</numUnapprovedLicenses>-->
					<!--<licenses>-->
						<!--&lt;!&ndash; Enforce this license:-->
							<!--Licensed to the Apache Software Foundation (ASF) under one-->
							<!--or more contributor license agreements.  See the NOTICE file-->
							<!--distributed with this work for additional information-->
							<!--regarding copyright ownership.  The ASF licenses this file-->
							<!--to you under the Apache License, Version 2.0 (the-->
							<!--"License"); you may not use this file except in compliance-->
							<!--with the License.  You may obtain a co
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值