flume-ng-1.6.0-cdh5.12.2 源码编译

安装包

flume-ng-1.6.0-cdh5.12.2-src.tar.gz

源码编译

# 解压进入跟目录
tar -zxvf flume-ng-1.6.0-cdh5.12.2-src.tar.gz
cd flume-ng-1.6.0-cdh5.12.2
mvn clean package -DskipTests

# 等待编译完成
# 在 flume-ng-dist/target 获取安装包:apache-flume-1.6.0-cdh5.12.2-bin.tar.gz

编译中遇到的问题:

问题1:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.0:enforce (clean) on project flume-parent: Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed. -> [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/MojoExecutionException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn  -rf :flume-parent

解决方法:

# 原因是enforcer插件检查到与依赖冲突,可以使用 -Denforcer.skip=true 参数跳过enforcer执行
# 完整执行命令如下:
mvn clean package -Denforcer.skip=true -DskipTests

问题2:

[ERROR] Failed to execute goal on project flume-ng-morphline-solr-sink: Could not resolve dependencies for project org.apache.flume.flume-ng-sinks:flume-ng-morphline-solr-sink:jar:1.6.0-cdh5.12.2: Failed to collect dependencies at org.kitesdk:kite-morphlines-all:pom:1.0.0-cdh5.12.2 -> org.kitesdk:kite-morphlines-useragent:jar:1.0.0-cdh5.12.2 -> ua_parser:ua-parser:jar:1.3.0: Failed to read artifact descriptor for ua_parser:ua-parser:jar:1.3.0: Could not transfer artifact ua_parser:ua-parser:pom:1.3.0 from/to maven-twttr (http://maven.twttr.com): Connect to maven.twttr.com:80 [maven.twttr.com/69.171.244.15] failed: Operation timed out (Connection timed out) -> [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/DependencyResolutionException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn  -rf :flume-ng-morphline-solr-sink

解决方法:在 当前 pox.xml 文件中添加如下仓库地址:


  p2.jfrog.org
  http://p2.jfrog.org/libs-releases

添加完成后重新编译

你可能感兴趣的:(开发中遇到的一些问题,flume)