1、pom.xml 配置文件:
在pom.xml配置文件中添加
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>cn.bd.bdapp.batch.HfileByMapReduce</mainClass> // 根據自己類名和路徑修改
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
</plugins>
</build>
2、進入項目路徑打包
在項目路徑下執行:mvn assembly:assembly
如下圖表示打包成功:

3、找到文件打包的路徑
一般在項目target目錄下會生成一個:project-version-with-dependencies.jar文件
例如我的bdapp-3-jar-with-dependencies.jar
4、上傳該包即可。
本文參考地址:
http://lvjun106.iteye.com/blog/1849803
