这里用来将新建的maven project 放入到现有的maven working set 中,这样我们就能看到项目之间的层级关系




选择下面的程序



在父项目中创建公共的pom,在pom中维护项目所需要的各种jar包其中version在properites中指定




在 midules中添加子模块


以下是两个主要的plugin

                同dependencyManageMent
        <pluginManagement>
            <plugins>
                <!-- maven project model -->
                <plugin>
                    <groupId>org.apache.avro</groupId>
                    <artifactId>avro-maven-plugin</artifactId>
                    <version>${avro.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${maven.version}</version>
                    <configuration>
                        <source>${java.version}</source>
                        <target>${java.version}</target>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>${maven.resources.plugin}</version>
                </plugin>
            </plugins>
        </pluginManagement>
        
        设定jdk的版本以及编译版本
        <plugins>
            <!-- set the jdk version and compile level -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                </configuration>
            </plugin>

</plugins>  


 子项目中:
 设置直系parent


下面设置avro(阿弗罗自动构建命令)
    <build>
        <plugins>
            <!-- maven project model -->
            <plugin>
                <groupId>org.apache.avro</groupId>
                <artifactId>avro-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>generate-avro-test-sources</id>
                        <phase>generate-test-sources</phase>
                        <goals>
                            <goal>schema</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <includes>
                        <include>StringPair.avsc</include>
                    </includes>
                    <project>
                        <groupId>donggege.gege</groupId>
                    </project>
                    <sourceDirectory>src/main/resources/avro</sourceDirectory>
                    <outputDirectory>${project.build.main.directory}</outputDirectory>
                    <testSourceDirectory>src/main/resources/avro</testSourceDirectory>
                    <testOutputDirectory>${project.build.test.directory}</testOutputDirectory>
                </configuration>
            </plugin>
        </plugins>

</build>  





maven 创建Hadoop程序的更多相关文章

  1. IDEAL基于maven创建spark程序

    今天创建spark项目遇到一个奇葩问题,困扰了好久,特此记录一下. 1.按照截图创建spark项目 2.项目创建好后,运行报错: Error:scalac: error while loading J ...

  2. IntelliJ Idea基于Maven创建SpringMVC程序

    1. 创建Maven工程 网上很多资料,不再详细介绍,请参看IntelliJ IDEA 创建 hello world Java web Maven项目从头到尾都有图有真相2017版本 有关settin ...

  3. IntelliJ IDEA + Maven环境编写第一个hadoop程序

    1. 新建IntelliJ下的maven项目 点击File->New->Project,在弹出的对话框中选择Maven,JDK选择你自己安装的版本,点击Next 2. 填写Maven的Gr ...

  4. Maven学习(十一)-----使用Maven创建Web应用程序项目

    使用Maven创建Web应用程序项目 用到的技术/工具: Maven 3.3.3 Eclipse 4.3 JDK 8 Spring 4.1.1.RELEASED Tomcat 7 Logback 1. ...

  5. maven 学习---使用Maven创建Web应用程序项目

    在本教程中,我们将演示如何使用 Maven 创建一个 Java Web 项目(Spring MVC). 用到的技术/工具: Maven 3.3.3 Eclipse 4.3 JDK 8 Spring 4 ...

  6. 从零自学Hadoop(09):使用Maven构建Hadoop工程

    阅读目录 序 Maven 安装 构建 示例下载 系列索引 本文版权归mephisto和博客园共有,欢迎转载,但须保留此段声明,并给出原文链接,谢谢合作. 文章是哥(mephisto)写的,Source ...

  7. 转】用Maven构建Hadoop项目

    原博文出自于: http://blog.fens.me/hadoop-maven-eclipse/ 感谢!   用Maven构建Hadoop项目 Hadoop家族系列文章,主要介绍Hadoop家族产品 ...

  8. Maven构建Hadoop

    Maven构建Hadoop工程 阅读目录 序 Maven 安装 构建 示例下载 系列索引 序 上一篇,我们编写了第一个MapReduce,并且成功的运行了Job,Hadoop1.x是通过ant来管理工 ...

  9. 编写hadoop程序,并打包jar到hadoop集群运行

    windows环境下编写hadoop程序 新建:File->new->Project->Maven->next GroupId 和ArtifactId 随便写(还是建议规范点) ...

随机推荐

  1. Unity3D使用Assetbundle打包加载(Prefab、场景)

    之前有一篇文章中我们相惜讨论了Assetbundle的原理,如果对原理还不太了解的朋友可以看这一篇文章:Unity游戏开发使用Assetbundle加载场景的原理 本篇文章我们将说说assetbund ...

  2. html 定位问题

    HTML精确定位:scrollLeft,scrollWidth,clientWidth,offsetWidth scrollHeight: 获取对象的滚动高度. scrollLeft:设置或获取位于对 ...

  3. jQuery - 疑惑

    设置内容和属性:http://www.runoob.com/jquery/jquery-dom-set.html

  4. struts2 中 Actionsupport 的作用

    struts2 中 Actionsupport 的作用 Action 跟 Actionsupport 的区别     当我们在写action的时候,可以实现Action接口,也可以继承Actionsu ...

  5. 纸上谈兵:表(list)

    作者:Vamei 出处:http://www.cnblogs.com/vamei 欢迎转载,也请保留这段声明.谢谢! 表 表(list)是常见的数据结构.从数学上来说,表是一个有序的元素集合.在C语言 ...

  6. 动态规划 - 最长递增子序列(LIS)

    最长递增子序列是动态规划中经典的问题,详细如下: 在一个已知的序列{a1,a2,...,an}中,取出若干数组组成新的序列{ai1,ai2,...,aim},其中下标i1,i2,...,im保持递增, ...

  7. cs11_c++_lab2

    Matrix.hh class Matrix { int row; int col; int *p; public: Matrix(); Matrix(int x,int y); ~Matrix(); ...

  8. nginx_tomcat负载均衡环境

    Nginx+Tomcat搭建 版本 操作系统版本 Centos 6.4 Nginx版本 nginx-1.3.15.tar.gz JDK版本 jdk-7u71-linux-i586 //jdk1.7 T ...

  9. ps 使用说明

    ps基本介绍 linux 版本 centos 1511  x64 汇报当前所有进程的快照.report a snapshot of the current processes. 能够显示F, S, U ...

  10. weed-fs参数列表

    weed-fs没有详细的帮助文档,为了方便阅读,特意把有用的参数帮助罗列出来.未列出的两个命令为version(版本查询) 及shell(这个命令在0.45版本只有回显功能)nerc@Ubuntu:~ ...