请选择 进入手机版 | 继续访问电脑版
切换皮肤
创建项目
准备pom.xml文件配置(附在文档最后)
在下载jar过程中极其缓慢,简直不能忍受,查阅了下资料,得到下面的办法:
1、 maven仓库中没有支持cdh的相关依赖。cloudera自己建立了一个相关的仓库。要想利用maven添加相关依赖,则必须单独添加cloudera仓库
?url=http%3A%2F%2Fdingyue.ws.126.net%2F2020%2F0406%2F097dbec0p00q8dipx001pc0011300hzc.jpg

2、 在国内使用maven中央仓库一般会有网络问题,所以大部分人会使用aliyun仓库或者其他开源的仓库。所以需要修改setting.xml (以下配置中 *,!cloudera 表示除了aliyun仓库还使用cloudera仓库)
配置

nexus-aliyun
*,!cloudera
Nexus aliyun
http://maven.aliyun.com/nexus/content/groups/public
?url=http%3A%2F%2Fdingyue.ws.126.net%2F2020%2F0406%2F329aa2cap00q8dipy0015c0011s00hgc.jpg
配置环境
下面两个配置表示是在本地运行还是到Linux环境中运行
dev
?url=http%3A%2F%2Fdingyue.ws.126.net%2F2020%2F0406%2F33f4a2e6p00q8dipn002mc0016k00gpc.jpg
编写内容
?url=http%3A%2F%2Fdingyue.ws.126.net%2F2020%2F0406%2F931373cbp00q8dipo002gc0011f00g1c.jpg
local
?url=http%3A%2F%2Fdingyue.ws.126.net%2F2020%2F0406%2F4cd04494p00q8dipp002rc001a100h5c.jpg
编写内容
?url=http%3A%2F%2Fdingyue.ws.126.net%2F2020%2F0406%2Fa59f087ap00q8dipq001uc0012e00duc.jpg
准备log4j的日志配置,这个网上很多,可以直接复制一份,改下关键地方就可以
?url=http%3A%2F%2Fdingyue.ws.126.net%2F2020%2F0406%2Fa658ab55p00q8dipt003ac001c400k2c.jpg
HDFS连接地址的配置
?url=http%3A%2F%2Fdingyue.ws.126.net%2F2020%2F0406%2Faa71728ep00q8dipt002sc000xz00iec.jpg
Hbase的连接配置
?url=http%3A%2F%2Fdingyue.ws.126.net%2F2020%2F0406%2Ff3a0d94ep00q8dipu003oc000ya00n9c.jpg
配置文件transformer-env.xml
?url=http%3A%2F%2Fdingyue.ws.126.net%2F2020%2F0406%2F260ac476p00q8dipv0019c000f800cyc.jpg
文件内容
?url=http%3A%2F%2Fdingyue.ws.126.net%2F2020%2F0406%2F9a86394dp00q8dipw002gc0014t00ksc.jpg
?url=http%3A%2F%2Fdingyue.ws.126.net%2F2020%2F0406%2Fa96bf879p00q8dipx002pc0013n00o0c.jpg
pom.xml文件配置
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0
com.xlgl.wzy
localenv
0.0.1-SNAPSHOT

2.7.3
1.2.5
2.1.1
5.1.6
2.6.2
0.6.1


aliyun
http://maven.aliyun.com/nexus/content/groups/public/
cloudera
https://repository.cloudera.com/artifactory/cloudera-repos/
jboss
http://repository.jboss.org/nexus/content/groups/public


org.apache.hadoop
hadoop-client
${hadoop.version}


org.apache.hbase
hbase-client
${hbase.version}


org.apache.hbase
hbase-server
${hbase.version}


org.apache.hive
hive-exec
${hive.version}



mysql
mysql-connector-java
${mysql.version}



cz.mallat.uasparser
uasparser
${uasparser.version}


com.google.code.gson
gson
${gson.version}






local

true




configuration/local


src/main/resources





org.codehaus.mojo
build-helper-maven-plugin
1.4


add-source
generate-sources

add-source



${basedir}/src/main/java
${basedir}/src/main/extr










dev



configuration/dev


src/main/resources




org.codehaus.mojo
build-helper-maven-plugin
1.4


add-source
generate-sources

add-source



${basedir}/src/main/java







org.apache.maven.plugins
maven-shade-plugin
2.1


package

shade




cz.mallat.uasparser:uasparser
net.sourceforge.jregex:jregex
mysql:mysql-connector-java











src/test/java


maven-assembly-plugin


jar-with-dependencies




make-assembly
package

assembly





maven-compiler-plugin
3.3

1.8
1.8
utf8







org.eclipse.m2e
lifecycle-mapping
1.0.0





org.codehaus.mojo

build-helper-maven-plugin

[1.4,)

add-source

















[size=0.28]特别

回复

使用道具 举报

    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则


    Archiver|手机版|小黑屋|齐聚无忧 |网站地图

    Powered by Discuz! X3.4  © 2001-2013 Comsenz Inc.