1.拷贝settings到.m2文件下

  

2.修改文件

  

3.新建Project项目

  

4.转换为maven项目

  config下转换

5.拷贝pom文件

 <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.ibeifeng</groupId>
<artifactId>transformer</artifactId>
<version>0.0.1</version> <properties>
<hadoop.version>2.5.0-cdh5.3.6</hadoop.version>
<hbase.version>0.98.6-cdh5.3.6</hbase.version>
<hive.version>0.13.1-cdh5.3.6</hive.version>
<mysql.version>5.1.18</mysql.version>
<gson.version>2.6.2</gson.version>
<uasparser.version>0.6.1</uasparser.version>
</properties> <repositories>
<!-- 指定该项目可以从哪些地方下载依赖包 -->
<repository>
<id>aliyun</id>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
</repository>
<repository>
<id>cloudera</id>
<url>https://repository.cloudera.com/artifactory/cloudera-repos/</url>
</repository>
<repository>
<id>jboss</id>
<url>http://repository.jboss.org/nexus/content/groups/public</url>
</repository>
</repositories> <dependencies>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-client</artifactId>
<version>${hadoop.version}</version>
</dependency> <dependency>
<groupId>org.apache.hbase</groupId>
<artifactId>hbase-client</artifactId>
<version>${hbase.version}</version>
</dependency> <dependency>
<groupId>org.apache.hbase</groupId>
<artifactId>hbase-server</artifactId>
<version>${hbase.version}</version>
</dependency> <dependency>
<groupId>org.apache.hive</groupId>
<artifactId>hive-exec</artifactId>
<version>${hive.version}</version>
</dependency> <!-- mysql start -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql.version}</version>
</dependency>
<!-- mysql end --> <dependency>
<groupId>cz.mallat.uasparser</groupId>
<artifactId>uasparser</artifactId>
<version>${uasparser.version}</version>
</dependency> <dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>${gson.version}</version>
</dependency>
</dependencies> <profiles>
<!-- 指定环境 -->
<profile>
<!-- 指定本地运行环境,windows环境 -->
<id>local</id>
<activation>
<!-- 指定默认环境是local -->
<activeByDefault>true</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<!-- 支持多个不同文件夹中的java代码进行编译 -->
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.4</version>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${basedir}/src/main/java</source>
<source>${basedir}/src/main/extr</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile> <profile>
<!-- hadoop环境运行, linux环境 -->
<id>dev</id>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.4</version>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${basedir}/src/main/java</source>
</sources>
</configuration>
</execution>
</executions>
</plugin> <plugin>
<!-- 该插件的作用是将jar文件打包到最终形成的项目jar文件中 -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<artifactSet>
<includes>
<include>cz.mallat.uasparser:uasparser</include>
<include>net.sourceforge.jregex:jregex</include>
<include>mysql:mysql-connector-java</include>
</includes>
</artifactSet>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles> <build>
<testSourceDirectory>src/test/java</testSourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<encoding>utf8</encoding> <!-- 默认是gbk -->
</configuration>
</plugin>
</plugins>
</build>
</project>

  

6.新建目录

  src/main/java

  src/main/resources

  src/test/java

7.拷贝java下的所有程序到src/main/java

  

8.拷贝resources配置到src/main/resources

  

9.拷贝ip到主目录

  

二:测试

1.程序

  

2.结果 

{os=Windows, u_sd=6D4F89C0-E17B-45D0-BFE0-059644C1878D, b_iev=Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36, bf_sid=33cbf257-3b11-4abd-ac70-c5fc47afb797_11177014, os_v=Windows XP, c_time=1450569596991, b_rst=1440*900, l=zh-CN, s_time=1450569601351, ver=1, u_ud=4B16B8BB-D6AA-4118-87F8-C58680D22657, city=宝山区, country=中国, ip=114.92.217.149, u_nu=1, browser=Chrome, province=上海市, pl=website, browser_v=45.0.2454.101, en=e_l, sdk=js}

096实战 在windows下新建maven项目的更多相关文章

  1. 在windows下新建maven项目

    1.拷贝settings到.m2文件下 2.修改文件 3.新建Project项目 4.转换为maven项目 config下转换 5.拷贝pom文件 6.新建目录 src/main/java src/m ...

  2. Eclipse下新建Maven项目、自动打依赖jar包

    当我们无法从本地仓库找到需要的构件的时候,就会从远程仓库下载构件至本地仓库.一般地,对于每个人来说,书房只有一个,但外面的书店有很多,类似第,对于Maven来说,每个用户只有一个本地仓库,但可以配置访 ...

  3. eclipse下新建maven项目

    eclipse下新建maven项目 1.1下载maven安装包 进入Maven官网的下载页面:http://maven.apache.org/download.cgi,如下图所示:\ 选择当前最新版本 ...

  4. Windows下安装Maven

    上篇文章刚说到Linux下安装maven的过程,有时候为了适合在本地构建项目开发,然后上传到远程服务器执行,需要在本地构建maven项目,那么一般就是在Windows下构建maven项目并导入到我们的 ...

  5. 【IDEA】本地新建Maven项目+配置Git和GitHub+代码上传和拉取到GitHub+其他IDEA和GitHub实战

    一.本地新建Maven项目并启动成功 1. 按照IDEA提供的模板,构建一个maven webapp的模板项目. 一路Next,到最后的finish.如下图. 2. 新建Tomcat,启动刚建立的项目 ...

  6. maven课程 项目管理利器-maven 3-4 eclipse安装maven插件和新建maven项目

    本节主要讲了两个主要内容, 1       eclipse安装maven插件 2 新建maven项目 3 本人实操 1       eclipse安装maven插件 eclipse4.0以上和myec ...

  7. [Eclipse的Maven项目搭建,仅为测试Maven功能]如何在Eclipse下搭建Maven项目

    [Eclipse的Maven项目搭建,仅为测试Maven功能]如何在Eclipse下搭建Maven项目   你可能需要了解以下才能更好的阅读以下: 在 Windows 中配置Maven: http:/ ...

  8. eclipse 新建 maven 项目 步骤(初级入门新手)

    安装 maven(百度) 和在eclipse 中svn(上一篇) 修改 maven 本地仓库 eclipse 属性 maven--> installations-->添加新的 自定义安装的 ...

  9. 解决新建maven项目速度慢的问题

    问题描述 通过idea新建maven项目,参数设置好后,idea自动构建maven项目时,速度很慢. 参数设置如图: 执行时间如下图: Total time为8:49,花了将近十分钟时间. 连续尝试了 ...

随机推荐

  1. 表格控件QTableWidget

    搭配QTableWidgetItem使用 样式: import sys from PyQt5.QtCore import Qt from PyQt5.QtWidgets import QApplica ...

  2. 第3月第1天 GCDAsyncSocket dispatch_source_set_event_handler runloop

    + (void)startCFStreamThreadIfNeeded { LogTrace(); static dispatch_once_t predicate; dispatch_once(&a ...

  3. json和jsonp的使用区别

    json和jsonp的使用区别 一.    跨域请求的概念 JavaScript出于安全方面的考虑,不允许跨域调用其他页面的对象. 二.    json和jsonp JSON是一种基于文本的数据交换方 ...

  4. nginx入门一

    配置文件: server_name user root; worker_processes 2; error_log logs/error-test.log; #pid logs/nginx.pid; ...

  5. Faster rcnn代码理解(4)

    上一篇我们说完了AnchorTargetLayer层,然后我将Faster rcnn中的其他层看了,这里把ROIPoolingLayer层说一下: 我先说一下它的实现原理:RPN生成的roi区域大小是 ...

  6. ImageNet Classification with Deep Convolutional Neural Networks(译文)转载

    ImageNet Classification with Deep Convolutional Neural Networks Alex Krizhevsky, Ilya Sutskever, Geo ...

  7. 利用capability特征加强Linux系统安全【转】

    转自:https://blog.csdn.net/fivedragon/article/details/676849 1.简介 UNIX是一种安全操作系统,它给普通用户尽可能低的权限,而把全部的系统权 ...

  8. 八大最安全的Linux发行版,具备匿名功能,做服务器的首选,web,企业服务器等

    10 best Linux distros for privacy fiends and security buffs in 2017 Introduction The awesome operati ...

  9. 对WinMain程序入口函数返回值为msg.wParam的几点理解

    原文地址:http://blog.csdn.net/setflvet/article/details/6983224 1.在WinMain主函数中,最后的返回值是msg.wParam,这个参数是传递给 ...

  10. 安装xcache3.0.3/3.2,为php加速

    安装xcache,为php加速 1.安装 # tar xf xcache-3.0.3.tar.bz2  # cd xcache-3.0.3 # /usr/local/php/bin/phpize # ...