1. 带有hadoop-CDH4.2.1的pom.xml模板

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project xmlns="http://maven.apache.org/POM/4.0.0"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4. xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  5. <modelVersion>4.0.0</modelVersion>
  6. <groupId>com.cxz</groupId>
  7. <artifactId>IntoRedis</artifactId>
  8. <version>1.0-SNAPSHOT</version>
  9. <properties>
  10. <endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
  11. <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  12. </properties>
  13. <repositories>
  14. <repository>
  15. <id>cloudera</id>
  16. <name>cloudera maven repository</name>
  17. <url>https://repository.cloudera.com/content/repositories/releases</url>
  18. </repository>
  19. </repositories>
  20. <dependencies>
  21. <dependency>
  22. <groupId>redis.clients</groupId>
  23. <artifactId>jedis</artifactId>
  24. <version>2.1.0</version>
  25. <type>jar</type>
  26. </dependency>
  27. <dependency>
  28. <groupId>commons-pool</groupId>
  29. <artifactId>commons-pool</artifactId>
  30. <version>1.6</version>
  31. </dependency>
  32. <dependency>
  33. <groupId>org.apache.hadoop</groupId>
  34. <artifactId>hadoop-examples</artifactId>
  35. <version>2.0.0-mr1-cdh4.2.1</version>
  36. <type>jar</type>
  37. <scope>provided</scope>
  38. </dependency>
  39. <dependency>
  40. <groupId>junit</groupId>
  41. <artifactId>junit</artifactId>
  42. <version>4.8.2</version>
  43. <scope>test</scope>
  44. </dependency>
  45. <dependency>
  46. <groupId>org.apache.mrunit</groupId>
  47. <artifactId>mrunit</artifactId>
  48. <version>1.0.0</version>
  49. <classifier>hadoop1</classifier>
  50. <scope>test</scope>
  51. </dependency>
  52. <dependency>
  53. <groupId>org.apache.hadoop</groupId>
  54. <artifactId>hadoop-common</artifactId>
  55. <version>2.0.0-cdh4.2.1</version>
  56. <type>jar</type>
  57. <exclusions>
  58. <exclusion>
  59. <artifactId>kfs</artifactId>
  60. <groupId>net.sf.kosmosfs</groupId>
  61. </exclusion>
  62. </exclusions>
  63. <scope>provided</scope>
  64. </dependency>
  65. </dependencies>
  66. <build>
  67. <plugins>
  68. <plugin>
  69. <groupId>org.apache.maven.plugins</groupId>
  70. <artifactId>maven-compiler-plugin</artifactId>
  71. <version>2.3.2</version>
  72. <configuration>
  73. <source>1.7</source>
  74. <target>1.7</target>
  75. </configuration>
  76. </plugin>
  77. <plugin>
  78. <groupId>org.apache.maven.plugins</groupId>
  79. <artifactId>maven-assembly-plugin</artifactId>
  80. <version>2.4</version>
  81. <configuration>
  82. <descriptors>
  83. <descriptor>assembly.xml</descriptor>
  84. </descriptors>
  85. <archive>
  86. <manifest>
  87. <mainClass>com.cxz.redis.IntoRedis</mainClass>
  88. </manifest>
  89. </archive>
  90. </configuration>
  91. <executions>
  92. <execution>
  93. <id>make-assembly</id>
  94. <phase>package</phase>
  95. <goals>
  96. <goal>single</goal>
  97. </goals>
  98. </execution>
  99. </executions>
  100. </plugin>
  101. </plugins>
  102. </build>

2. assembly.xml文件

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <assembly
  3. xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
  4. xmlns='http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0'
  5. xsi:schemaLocation='http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd'>
  6. <id>job</id>
  7. <formats>
  8. <format>jar</format>
  9. </formats>
  10. <includeBaseDirectory>false</includeBaseDirectory>
  11. <dependencySets>
  12. <dependencySet>
  13. <unpack>false</unpack>
  14. <scope>runtime</scope>
  15. <outputDirectory>lib</outputDirectory>
  16. <excludes>
  17. <exclude>${groupId}:${artifactId}</exclude>
  18. </excludes>
  19. </dependencySet>
  20. <dependencySet>
  21. <unpack>true</unpack>
  22. <includes>
  23. <include>${groupId}:${artifactId}</include>
  24. </includes>
  25. </dependencySet>
  26. </dependencySets>
  27. </assembly>

3. maven的基本使用命令

mvn compile

mvn test

mvn test-compile

mvn package

mvn clean

记录一下自己常用的maven工程的pom.xml模板的更多相关文章

  1. 新建maven工程时pom.xml报错

    新建maven工程时,pom.xml报错:第一行报如下错误:multiple annotations found at this line后添加org.eclipse.m2e相关的plugin配置后, ...

  2. maven工程中pom.xml的错误

    更新maven工程,出现如下错误信息. Could not calculate build plan: Failure to transfer org.apache.maven.plugins:mav ...

  3. eclipse加载maven工程提示pom.xml无法解析org.apache.maven.plugins:maven-resources-plugin:2.4.3解决方案

    pom文件提示信息: Failure to transfer org.apache.maven.plugins:maven-resources-plugin:pom:2.4.3 from http:/ ...

  4. 新建Maven工程,pom.xml报错web.xml is missing and <failOnMissingWebXml> is set to true

    错误原因: 项目中没有web.xml 解决办法: 在项目中添加web.xml 在pom.xml中添加下面的插件 <build> <plugins> <plugin> ...

  5. Eclispe创建maven工程缺失web.xml报web.xml is missing and <failOnMissingWebXml> is set to true的错误

    Eclispe创建maven工程缺失web.xml报web.xml is missing and <failOnMissingWebXml> is set to true的错误,一看,还缺 ...

  6. netbeans生成的maven工程没有web.xml文件 如何新建

    使用netbeans生成的maven工程没有web.xml 需要自己新建 步骤: 下一步,完成

  7. 【转】maven核心,pom.xml详解

    感谢如下博主: http://www.cnblogs.com/qq78292959/p/3711501.html maven核心,pom.xml详解 什么是pom?    pom作为项目对象模型.通过 ...

  8. Maven快速入门(四)Maven中的pom.xml文件详解

    上一章,我们讲了Maven的坐标和仓库的概念,介绍了Maven是怎么通过坐标找到依赖的jar包的.同时也介绍了Maven的中央仓库.本地仓库.私服等概念及其作用.这些东西都是Maven最基本.最核心的 ...

  9. Maven的配置文件pom.xml

    Maven的配置文件pom.xml 简介: 什么是POM? POM是项目对象模型(Project Object Model)的简称,它是Maven项目中的文件,使用XML表示,名称叫做pom.xml. ...

随机推荐

  1. IOS学习笔记41--图片的缩放(一)

    图片的缩放 一:Pinch手势对图片进行缩放.即用两根手指往不同方向拖拉照片,照片会被缩小或放大. 我理解的原理:等比缩放 先看如下关键代码: 1.初始化参数 - (void)viewDidLoad ...

  2. 如何使用C#关键字const,readonly,static

    如果有一个值不太会变化,我们经常使用const和readonly,这2者有何不同呢?有时候,我们也会在readonly之前加上关键字static,这又意味着什么呢? const ● const默认是静 ...

  3. 报错:未能加载文件或程序集“WebGrease, Version=1.5.1.25624, Culture=neutral, PublicKeyToken=31bf3856ad364e35”或它的某一个依赖项。找到的程序集清单定义与程序集引用不匹配。 (异常来自 HRESULT:0x80131040)

    □ 背景 通过NuGet安装某程序包后,运行程序出现如上错误.   □ 分析 可能是程序集版本不兼容引起的,可以通过NuGet先把程序包删除,然后再安装最新或某个版本的程序包.   □ 解决方法 通过 ...

  4. Writable atomic property '***' cannot pair a synthesized setter/getter with a user defined

    1. warning: Semantic Issue: Writable atomic property 'number' cannot pair a synthesized setter/gette ...

  5. 【docker】docker容器和宿主机之间文件互传,互相拷贝

    原文地址:https://www.cnblogs.com/areyouready/p/8973495.html [注意:命令中符号均为英文符号] 1.从容器里面拷文件到宿主机 答:在宿主机里面执行以下 ...

  6. JAVA nio 2 和 Path 类简介

    想要初步了解 NIO.2 API,也就是通常所说的“JSR203: More New I/O APIs for the Java Platform”,最好的切入点就是新的抽象类 java.nio.fi ...

  7. velocity.properties配置说明

    1.Runtime  Log runtime.log  =  velocity.log 用以指定 Velocity 运行时日志文件的路劲和日志文件名,如不是全限定的绝对路径,系统会认为想对于 当前目录 ...

  8. Jetty学习二:配置概览-怎么配置Jetty

    Jetty POJO配置 Jetty的核心组件是Plain Old Java Objects(POJOs):配置Jetty的大部分工作就是在Jetty POJOs上的初始化.装配和设置域的处理,你能通 ...

  9. JSON.parse()和jQuery.parseJSON()的区别

    jQuery.parseJSON(jsonString) : 将格式完好的JSON字符串转为与之对应的JavaScript对象   (jquery 方法) 1 2 3 var str = '[{&qu ...

  10. 文件内容操作篇clearerr fclose fdopen feof fflush fgetc fgets fileno fopen fputc fputs fread freopen fseek ftell fwrite getc getchar gets

    clearerr(清除文件流的错误旗标) 相关函数 feof 表头文件 #include<stdio.h> 定义函数 void clearerr(FILE * stream); 函数说明 ...