zoukankan      html  css  js  c++  java
  • maven 创建Hadoop程序


    这里用来将新建的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>  








  • 相关阅读:
    C++设计模式-Bridge桥接模式
    解决VS2010打开Web页面时经常由于内存较低而导致VS2010自动关闭的问题
    Js继承小结
    MAC上的包管理利器
    Objective-C的hook方案(一): Method Swizzling
    OleContainer操作Excel以二进制方式读写数据库
    复制文件时,如何显示进度条(使用TFileStream一点一点读,或者使用BlockRead,并插入application.ProcessMessages)
    ADO异步查询显示进度条
    D2010 RTTI + Attribute 简单实现ORM
    Delphi默认窗体随想
  • 原文地址:https://www.cnblogs.com/zDanica/p/5471668.html
Copyright © 2011-2022 走看看