记录一下自己常用的maven工程的pom.xml模板
1. 带有hadoop-CDH4.2.1的pom.xml模板
- <?xml version="1.0" encoding="UTF-8"?>
- <project xmlns="http://maven.apache.org/POM/4.0.0"
- 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">
- <modelVersion>4.0.0</modelVersion>
- <groupId>com.cxz</groupId>
- <artifactId>IntoRedis</artifactId>
- <version>1.0-SNAPSHOT</version>
- <properties>
- <endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- </properties>
- <repositories>
- <repository>
- <id>cloudera</id>
- <name>cloudera maven repository</name>
- <url>https://repository.cloudera.com/content/repositories/releases</url>
- </repository>
- </repositories>
- <dependencies>
- <dependency>
- <groupId>redis.clients</groupId>
- <artifactId>jedis</artifactId>
- <version>2.1.0</version>
- <type>jar</type>
- </dependency>
- <dependency>
- <groupId>commons-pool</groupId>
- <artifactId>commons-pool</artifactId>
- <version>1.6</version>
- </dependency>
- <dependency>
- <groupId>org.apache.hadoop</groupId>
- <artifactId>hadoop-examples</artifactId>
- <version>2.0.0-mr1-cdh4.2.1</version>
- <type>jar</type>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.8.2</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.mrunit</groupId>
- <artifactId>mrunit</artifactId>
- <version>1.0.0</version>
- <classifier>hadoop1</classifier>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.hadoop</groupId>
- <artifactId>hadoop-common</artifactId>
- <version>2.0.0-cdh4.2.1</version>
- <type>jar</type>
- <exclusions>
- <exclusion>
- <artifactId>kfs</artifactId>
- <groupId>net.sf.kosmosfs</groupId>
- </exclusion>
- </exclusions>
- <scope>provided</scope>
- </dependency>
- </dependencies>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>2.3.2</version>
- <configuration>
- <source>1.7</source>
- <target>1.7</target>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-assembly-plugin</artifactId>
- <version>2.4</version>
- <configuration>
- <descriptors>
- <descriptor>assembly.xml</descriptor>
- </descriptors>
- <archive>
- <manifest>
- <mainClass>com.cxz.redis.IntoRedis</mainClass>
- </manifest>
- </archive>
- </configuration>
- <executions>
- <execution>
- <id>make-assembly</id>
- <phase>package</phase>
- <goals>
- <goal>single</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
2. assembly.xml文件
- <?xml version="1.0" encoding="UTF-8"?>
- <assembly
- xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
- xmlns='http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0'
- xsi:schemaLocation='http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd'>
- <id>job</id>
- <formats>
- <format>jar</format>
- </formats>
- <includeBaseDirectory>false</includeBaseDirectory>
- <dependencySets>
- <dependencySet>
- <unpack>false</unpack>
- <scope>runtime</scope>
- <outputDirectory>lib</outputDirectory>
- <excludes>
- <exclude>${groupId}:${artifactId}</exclude>
- </excludes>
- </dependencySet>
- <dependencySet>
- <unpack>true</unpack>
- <includes>
- <include>${groupId}:${artifactId}</include>
- </includes>
- </dependencySet>
- </dependencySets>
- </assembly>
3. maven的基本使用命令
mvn compile
mvn test
mvn test-compile
mvn package
mvn clean
记录一下自己常用的maven工程的pom.xml模板的更多相关文章
- 新建maven工程时pom.xml报错
新建maven工程时,pom.xml报错:第一行报如下错误:multiple annotations found at this line后添加org.eclipse.m2e相关的plugin配置后, ...
- maven工程中pom.xml的错误
更新maven工程,出现如下错误信息. Could not calculate build plan: Failure to transfer org.apache.maven.plugins:mav ...
- 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:/ ...
- 新建Maven工程,pom.xml报错web.xml is missing and <failOnMissingWebXml> is set to true
错误原因: 项目中没有web.xml 解决办法: 在项目中添加web.xml 在pom.xml中添加下面的插件 <build> <plugins> <plugin> ...
- 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的错误,一看,还缺 ...
- netbeans生成的maven工程没有web.xml文件 如何新建
使用netbeans生成的maven工程没有web.xml 需要自己新建 步骤: 下一步,完成
- 【转】maven核心,pom.xml详解
感谢如下博主: http://www.cnblogs.com/qq78292959/p/3711501.html maven核心,pom.xml详解 什么是pom? pom作为项目对象模型.通过 ...
- Maven快速入门(四)Maven中的pom.xml文件详解
上一章,我们讲了Maven的坐标和仓库的概念,介绍了Maven是怎么通过坐标找到依赖的jar包的.同时也介绍了Maven的中央仓库.本地仓库.私服等概念及其作用.这些东西都是Maven最基本.最核心的 ...
- Maven的配置文件pom.xml
Maven的配置文件pom.xml 简介: 什么是POM? POM是项目对象模型(Project Object Model)的简称,它是Maven项目中的文件,使用XML表示,名称叫做pom.xml. ...
随机推荐
- hdoj 4450 Draw Something 水题
Draw Something Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Tota ...
- Hibernate中的Session缓存问题
1. Session 缓存: 1) . 在 Session 接口的实现中包括一系列的 Java 集合 , 这些 Java 集合构成了 Session 缓存 . 它用于存放 Sessi ...
- xamarin其实也是一个鸡肋
刚刚体验了一把VS 2015,后来因为部分sdk和工具下载太慢,还是最终决定卸载.顺道了解了下xamarin studio.个人感觉Xamarin完全也是一个鸡肋,没必要过多的时间在xamarin上面 ...
- TSC条码打印机C#例程(tsclib.dll调用)
TSC条码打印机C#例程(tsclib.dll调用) //---- program.cs using System;using System.Collections.Generic;using Sy ...
- 怎样用Java代码来把SSL的证书自己主动导入到Java的秘钥存储文件(keystore)
我们在开发或者使用SSL的过程中,非常多的软件须要我们提供java的keystore.特别是一些基于Java的中间件产品. 我们常规的做法是JDK自带的工具命令(keytool)去做.比方,以下的样例 ...
- 调试查看CLR运行代码
SOS (Son of Strike)调试扩展可以让我们在调试过程中查看CLR运行代码.SOS.dll随.NET一起安装,对于.NET 4.0来说,SOS.dll的所在位置是:C:\Windows\M ...
- Python中函数的参数传递与可变长参数
转自旭东的博客原文 Python中函数的参数传递与可变长参数 Python中传递参数有以下几种类型: (1)像C++一样的默认缺省函数 (2)根据参数名传参数 (3)可变长度参数 示例如下: (1)默 ...
- [iOS] UIView的clipsTobounds属性
如题,有两个view: view1,view2view2添加view1到中,如果view2大于view1,或者view2的坐标不全在view1的范围内,view2是盖着view1的,意思就是超出的部份 ...
- ImageView 设置图片来自:http://blog.csdn.net/lincyang/article/details/6562163
android doc中是这样描述的: public void setImageResource (int resId) 这是其中的一个方法,参数resld是这样: ImageView.setImag ...
- Hadoop-2.2.0中文文档——Common-Hadoop HTTP web控制台认证
简单介绍 此文档描写叙述了怎样配置Hadoop HTTP web控制台,去要求用户认证. 默认地,Hadoop HTTP web控制台(JobTracker, NameNode, TaskTracke ...