eclipse maven
环境:
windows 10pro x64 jdk1.8 eclipse mars
1、安装设置maven插件window->preferences->Installations->Add
具体见下边的参考链接一
2、新建maven projectFile->new project->maven project->maven-archetype-quickstart(默认选中)
groupId:com.mvntest
artifactId:crawler
finish
3、创建爬虫程序TTT.java
在src/main/java右键->new class,输入TTT回车,将爬虫代码粘到里边
4、添加依赖httpclient
4.1 搜httpclient 4.5.2依赖包
在如下网站搜到httpclient 3.1的maven pom.xml
http://mvnrepository.com/artifact/commons-httpclient/commons-httpclient/4.5.2
<!-- http://mvnrepository.com/artifact/commons-httpclient/commons-httpclient -->
<!-- http://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>