package utils;
import java.io.BufferedReader;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.Set;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import org.apache.http.Header;
import org.apache.http.HttpEntity;
import org.apache.http.NameValuePair;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.mime.MultipartEntityBuilder;
import org.apache.http.entity.mime.content.FileBody;
import org.apache.http.entity.mime.content.StringBody;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.util.EntityUtils;
public class HttpClientUtils {
public static final int THREAD_POOL_SIZE = 20;
private static String charSet = "UTF-8";
public interface HttpClientDownLoadProgress {
public void onProgress(int progress);
}
private static HttpClientUtils httpClientDownload;
private ExecutorService downloadExcutorService;
private HttpClientUtils() {
downloadExcutorService = Executors.newFixedThreadPool(THREAD_POOL_SIZE);
}
public static HttpClientUtils getInstance() {
if (httpClientDownload == null) {
httpClientDownload = new HttpClientUtils();
}
return httpClientDownload;
}
public static HttpClientUtils getInstance(String charCode) {
if (httpClientDownload == null) {
httpClientDownload = new HttpClientUtils();
}
charSet = charCode;
return httpClientDownload;
}
public String httpGet(String url) {
return httpGet(url, null);
}
public String httpGet(String url, Map<String, String> headMap) {
String responseContent = null;
CloseableHttpClient httpclient = HttpClients.createDefault();
try {
HttpGet httpGet = new HttpGet(url);
RequestConfig requestConfig =
RequestConfig
.custom()
.setConnectTimeout(50000)
.setConnectionRequestTimeout(10000)
.setSocketTimeout(50000)
.build();
httpGet.setConfig(requestConfig);
setGetHead(httpGet, headMap);
CloseableHttpResponse response = httpclient.execute(httpGet);
try {
int statusCode = response.getStatusLine().getStatusCode();
if (200 == statusCode) {
HttpEntity entity = response.getEntity();
responseContent = getRespString(entity);
EntityUtils.consume(entity);
return responseContent;
}
if (302 == statusCode || 301 == statusCode) {
String location = null;
Header[] allHeaders = response.getAllHeaders();
for (Header header : allHeaders) {
if ("location".equals(header.getName().toLowerCase())) {
location = header.getValue();
break;
}
}
if (null != location) {
String result = httpGet(location, headMap);
return result;
}
}
} finally {
response.close();
}
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
httpclient.close();
} catch (IOException e) {
e.printStackTrace();
}
}
return responseContent;
}
public String httpPost(String url, Map<String, String> paramsMap) {
return httpPost(url, paramsMap, null);
}
public String httpPost(String url, Map<String, String> paramsMap, Map<String, String> headMap) {
String responseContent = null;
CloseableHttpClient httpclient = HttpClients.createDefault();
try {
HttpPost httpPost = new HttpPost(url);
RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(50000)
.setConnectionRequestTimeout(10000).setSocketTimeout(50000).build();
httpPost.setConfig(requestConfig);
setPostHead(httpPost, headMap);
setPostParams(httpPost, paramsMap);
CloseableHttpResponse response = httpclient.execute(httpPost);
try {
if (200 == response.getStatusLine().getStatusCode()) {
HttpEntity entity = response.getEntity();
responseContent = getRespString(entity);
EntityUtils.consume(entity);
} else {
System.out.println(response.getStatusLine());
}
} finally {
response.close();
}
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
httpclient.close();
} catch (IOException e) {
e.printStackTrace();
}
}
return responseContent;
}
public String httpPostForRedirect(String url, Map<String, String> paramsMap, Map<String, String> headMap) {
String responseContent = null;
CloseableHttpClient httpclient = HttpClients.createDefault();
try {
HttpPost httpPost = new HttpPost(url);
RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(50000)
.setConnectionRequestTimeout(10000).setSocketTimeout(50000).build();
httpPost.setConfig(requestConfig);
setPostHead(httpPost, headMap);
setPostParams(httpPost, paramsMap);
CloseableHttpResponse response = httpclient.execute(httpPost);
try {
int statusCode = response.getStatusLine().getStatusCode();
if (302 == statusCode || 301 == statusCode) {
String location = null;
Header[] allHeaders = response.getAllHeaders();
for (Header header : allHeaders) {
if ("location".equals(header.getName().toLowerCase())) {
location = header.getValue();
break;
}
}
if (null != location) {
String result = httpPost(location, paramsMap);
return result;
}
}
HttpEntity entity = response.getEntity();
responseContent = getRespString(entity);
EntityUtils.consume(entity);
} finally {
response.close();
}
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
httpclient.close();
} catch (IOException e) {
e.printStackTrace();
}
}
return responseContent;
}
public void downloadCallback(final String url, final String filePath) {
downloadExcutorService.execute(new Runnable() {
@Override
public void run() {
httpDownloadFile(url, filePath, null, null);
}
});
}
public void download(final String url, final String filePath) {
httpDownloadFile(url, filePath, null, null);
}
public void download(final String url, final String filePath, final HttpClientDownLoadProgress progress) {
downloadExcutorService.execute(new Runnable() {
@Override
public void run() {
httpDownloadFile(url, filePath, progress, null);
}
});
}
private void httpDownloadFile(String url, String filePath, HttpClientDownLoadProgress progress,
Map<String, String> headMap) {
CloseableHttpClient httpclient = HttpClients.createDefault();
try {
HttpGet httpGet = new HttpGet(url);
RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(50000)
.setConnectionRequestTimeout(10000).setSocketTimeout(50000).build();
httpGet.setConfig(requestConfig);
setGetHead(httpGet, headMap);
CloseableHttpResponse response1 = httpclient.execute(httpGet);
try {
HttpEntity httpEntity = response1.getEntity();
long contentLength = httpEntity.getContentLength();
InputStream is = httpEntity.getContent();
ByteArrayOutputStream output = new ByteArrayOutputStream();
byte[] buffer = new byte[4096];
int r = 0;
long totalRead = 0;
while ((r = is.read(buffer)) > 0) {
output.write(buffer, 0, r);
totalRead += r;
if (progress != null) {
progress.onProgress((int) (totalRead * 100 / contentLength));
}
}
FileOutputStream fos = new FileOutputStream(filePath);
output.writeTo(fos);
output.flush();
output.close();
fos.close();
EntityUtils.consume(httpEntity);
} finally {
response1.close();
}
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
httpclient.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
private void setPostParams(HttpPost httpPost, Map<String, String> paramsMap) throws Exception {
if (paramsMap != null && paramsMap.size() > 0) {
List<NameValuePair> nvps = new ArrayList<NameValuePair>();
Set<String> keySet = paramsMap.keySet();
for (String key : keySet) {
nvps.add(new BasicNameValuePair(key, paramsMap.get(key)));
}
httpPost.setEntity(new UrlEncodedFormEntity(nvps));
}
}
private void setPostHead(HttpPost httpPost, Map<String, String> headMap) {
if (headMap != null && headMap.size() > 0) {
Set<String> keySet = headMap.keySet();
for (String key : keySet) {
httpPost.addHeader(key, headMap.get(key));
}
} else {
httpPost.setHeader("user-agent", getUserAgent());
httpPost.setHeader(":authority", "item.jd.com");
httpPost.setHeader(":method", "POST");
httpPost.setHeader(":scheme", "https");
httpPost.setHeader("User-Agent", getUserAgent());
httpPost.setHeader("Accept",
"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8");
httpPost.setHeader("Accept-Encoding", "gzip, deflate, br");
httpPost.setHeader("Accept-Language", "zh-CN,zh;q=0.9,en;q=0.8");
httpPost.setHeader("Cache-Control", "max-age=0");
httpPost.setHeader("Cookie",
"ipLoc-djd=1-72-2799-0; mt_xid=V2_52007VwMXUlteVFMaSx5sAjUFQVNfXlpGGxtKXhliVhYHQVBbCBdVS1oBMwQRWltaB1MYeRpdBWEfElFBWVtLH00SXANsAhBiX2hSah9NGFgBYAUXVW1YV1wY; user-key=b9de3f4b-e58f-4091-9803-1dec084c7108; cn=0; unpl=V2_ZzNtbRFSQRZ2ARRRchAJBmIDEg8RUUERJwtBB30eVFBgChZdclRCFXMURldnGV0UZwQZWUdcQRdFCHZXchBYAWcCGllyBBNNIEwHDCRSBUE3XHxcFVUWF3RaTwEoSVoAYwtBDkZUFBYhW0IAKElVVTUFR21yVEMldQl2VH4ZWgNhChdfRWdzEkU4dlN6H1sAZDMTbUNnAUEpAEJcfR9fSGcGEltEUUoQdw92VUsa; CCC_SE=ADC_CL2fMC1cf8dfSjuccno0cF1Ns%2bbtvKoi33Cs6QdUTFVJDFjj6uM%2bfLmmu6XX9A8yfKi4GXb1%2flxry3lyv3COAEfy8eYjv2kH3NNGANnPdsw%2ferNu%2baDyMBc43P3FW07io%2fwjN%2fmSKX5GBFoWWp%2bXGwV2JDCIoU1fl%2bjJ1OzJfOpiLEp8ovQFBrCVqClPMpAUnd4endpEuLf9uXiJCDWXupLmsqjB7LULXWzhqEIijouQcScUvumPUhHh0ZD%2bcbtoZw8dP1MVSlovcTmT%2fe22fbAlRJjNTPXCRXqUeQm3wxdSbz%2fimWqxjXfi%2bXLpV%2baspX2mIGL3RjekW5%2bfzqk8Q7ybxBrTzfGR6gzVnGamE0ooc4dfw8F%2fLIx0Ya4RxV%2ftBJdtnwmpOvgiy5Jep%2bA%2fafQJv8Y35pvdfS1VFagOa9XudkwXxw5fIYhTBC1Nn00BSjV6yT%2bci%2fh4Ign28gzp6GgAk9%2f0DACF5vqFIMJ5UFftuJYwhdS%2fsxULXk%2btDeEzQHbdawBLfwwi3i74zoYXN%2fRLyKNvW%2fp4tyJSZtEEdOhLRBxwS1DIUFtDrNs0wLzj7AuvvnMK5FlZJ4P5xFKMDyXQpEmFpd7tI1j9pvUutR%2b%2fnWz17DDvQFpCmD7HiinMFq3AhHSzfuA94gpQc9tOOmL2oShxI8yjaFNuib5WFats4%2fO9o4QxaJ0%2fenYBo16eQfrAOB2dE9xfgHhNaK0%2ftW55ONam3a4QNdqFfv8Gwqg%3d; __jdv=122270672|baidu-pinzhuan|t_288551095_baidupinzhuan|cpc|0f3d30c8dba7459bb52f2eb5eba8ac7d_0_b43228c488d2411cb735c26b769d6851|1512896074664; __jda=122270672.1417778436.1512712379.1512901466.1512911995.8; __jdb=122270672.3.1417778436|8.1512911995; __jdc=122270672; __jdu=1417778436; 3AB9D23F7A4B3C9B=ZT3536NGESEGCF5E5MCBC53X6AQUQB7FNGC3UR7MBALPBWXLDN4XMVQGTDEL6SERTGUOFZHSCZU5VWZ2AHLAPZGACA");
httpPost.setHeader("referer", "https://search.jd.com/Search?keyword=%E6%89%8B%E6%9C%BA&enc=utf-8&wq=%E6%89%8B%E6%9C%BA&pvid=8720a017b65c44c3b16a1f0f6e276899");
httpPost.setHeader("Upgrade-Insecure-Requests", "1");
httpPost.setHeader("pragma", "no-cache");
}
}
private void setGetHead(HttpGet httpGet, Map<String, String> headMap) {
if (headMap != null && headMap.size() > 0) {
Set<String> keySet = headMap.keySet();
for (String key : keySet) {
httpGet.addHeader(key, headMap.get(key));
}
} else {
httpGet.setHeader("user-agent", getUserAgent());
httpGet.setHeader(":authority", "item.jd.com");
httpGet.setHeader(":method", "GET");
httpGet.setHeader(":scheme", "https");
httpGet.setHeader("User-Agent", getUserAgent());
httpGet.setHeader("Accept",
"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8");
httpGet.setHeader("Accept-Encoding", "gzip, deflate, br");
httpGet.setHeader("Accept-Language", "zh-CN,zh;q=0.9,en;q=0.8");
httpGet.setHeader("Cache-Control", "max-age=0");
httpGet.setHeader("Cookie",
"ipLoc-djd=1-72-2799-0; mt_xid=V2_52007VwMXUlteVFMaSx5sAjUFQVNfXlpGGxtKXhliVhYHQVBbCBdVS1oBMwQRWltaB1MYeRpdBWEfElFBWVtLH00SXANsAhBiX2hSah9NGFgBYAUXVW1YV1wY; user-key=b9de3f4b-e58f-4091-9803-1dec084c7108; cn=0; unpl=V2_ZzNtbRFSQRZ2ARRRchAJBmIDEg8RUUERJwtBB30eVFBgChZdclRCFXMURldnGV0UZwQZWUdcQRdFCHZXchBYAWcCGllyBBNNIEwHDCRSBUE3XHxcFVUWF3RaTwEoSVoAYwtBDkZUFBYhW0IAKElVVTUFR21yVEMldQl2VH4ZWgNhChdfRWdzEkU4dlN6H1sAZDMTbUNnAUEpAEJcfR9fSGcGEltEUUoQdw92VUsa; CCC_SE=ADC_CL2fMC1cf8dfSjuccno0cF1Ns%2bbtvKoi33Cs6QdUTFVJDFjj6uM%2bfLmmu6XX9A8yfKi4GXb1%2flxry3lyv3COAEfy8eYjv2kH3NNGANnPdsw%2ferNu%2baDyMBc43P3FW07io%2fwjN%2fmSKX5GBFoWWp%2bXGwV2JDCIoU1fl%2bjJ1OzJfOpiLEp8ovQFBrCVqClPMpAUnd4endpEuLf9uXiJCDWXupLmsqjB7LULXWzhqEIijouQcScUvumPUhHh0ZD%2bcbtoZw8dP1MVSlovcTmT%2fe22fbAlRJjNTPXCRXqUeQm3wxdSbz%2fimWqxjXfi%2bXLpV%2baspX2mIGL3RjekW5%2bfzqk8Q7ybxBrTzfGR6gzVnGamE0ooc4dfw8F%2fLIx0Ya4RxV%2ftBJdtnwmpOvgiy5Jep%2bA%2fafQJv8Y35pvdfS1VFagOa9XudkwXxw5fIYhTBC1Nn00BSjV6yT%2bci%2fh4Ign28gzp6GgAk9%2f0DACF5vqFIMJ5UFftuJYwhdS%2fsxULXk%2btDeEzQHbdawBLfwwi3i74zoYXN%2fRLyKNvW%2fp4tyJSZtEEdOhLRBxwS1DIUFtDrNs0wLzj7AuvvnMK5FlZJ4P5xFKMDyXQpEmFpd7tI1j9pvUutR%2b%2fnWz17DDvQFpCmD7HiinMFq3AhHSzfuA94gpQc9tOOmL2oShxI8yjaFNuib5WFats4%2fO9o4QxaJ0%2fenYBo16eQfrAOB2dE9xfgHhNaK0%2ftW55ONam3a4QNdqFfv8Gwqg%3d; __jdv=122270672|baidu-pinzhuan|t_288551095_baidupinzhuan|cpc|0f3d30c8dba7459bb52f2eb5eba8ac7d_0_b43228c488d2411cb735c26b769d6851|1512896074664; __jda=122270672.1417778436.1512712379.1512901466.1512911995.8; __jdb=122270672.3.1417778436|8.1512911995; __jdc=122270672; __jdu=1417778436; 3AB9D23F7A4B3C9B=ZT3536NGESEGCF5E5MCBC53X6AQUQB7FNGC3UR7MBALPBWXLDN4XMVQGTDEL6SERTGUOFZHSCZU5VWZ2AHLAPZGACA");
httpGet.setHeader("referer", "https://search.jd.com/Search?keyword=%E6%89%8B%E6%9C%BA&enc=utf-8&wq=%E6%89%8B%E6%9C%BA&pvid=8720a017b65c44c3b16a1f0f6e276899");
httpGet.setHeader("Upgrade-Insecure-Requests", "1");
httpGet.setHeader("pragma", "no-cache");
}
}
private String getUserAgent(){
ArrayList<String> list = new ArrayList<String>(){{
add("Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML); like Gecko) Chrome/41.0.2228.0 Safari/537.36");
add("Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML); like Gecko) Chrome/41.0.2227.1 Safari/537.36");
add("Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML); like Gecko) Chrome/41.0.2227.0 Safari/537.36");
add("Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML); like Gecko) Chrome/41.0.2227.0 Safari/537.36");
add("Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML); like Gecko) Chrome/41.0.2226.0 Safari/537.36");
add("Mozilla/5.0 (Windows NT 6.4; WOW64) AppleWebKit/537.36 (KHTML); like Gecko) Chrome/41.0.2225.0 Safari/537.36");
add("Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML); like Gecko) Chrome/41.0.2225.0 Safari/537.36");
add("Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML); like Gecko) Chrome/41.0.2224.3 Safari/537.36");
add("Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML); like Gecko) Chrome/40.0.2214.93 Safari/537.36");
add("Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML); like Gecko) Chrome/40.0.2214.93 Safari/537.36");
add("Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML); like Gecko) Chrome/37.0.2049.0 Safari/537.36");
add("Mozilla/5.0 (Windows NT 4.0; WOW64) AppleWebKit/537.36 (KHTML); like Gecko) Chrome/37.0.2049.0 Safari/537.36");
add("Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML); like Gecko) Chrome/36.0.1985.67 Safari/537.36");
add("Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML); like Gecko) Chrome/36.0.1985.67 Safari/537.36");
add("Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML); like Gecko) Chrome/35.0.3319.102 Safari/537.36");
add("Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML); like Gecko) Chrome/35.0.2309.372 Safari/537.36");
add("Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML); like Gecko) Chrome/35.0.2117.157 Safari/537.36");
add("Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML); like Gecko) Chrome/35.0.1916.47 Safari/537.36");
add("Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML); like Gecko) Chrome/34.0.1866.237 Safari/537.36");
add("Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36");
}};
int index = new Random().nextInt( list.size() );
return list.get(index);
}
public String uploadFileImpl(String serverUrl, String localFilePath, String serverFieldName,
Map<String, String> params) throws Exception {
String respStr = null;
CloseableHttpClient httpclient = HttpClients.createDefault();
try {
HttpPost httppost = new HttpPost(serverUrl);
RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(50000)
.setConnectionRequestTimeout(10000).setSocketTimeout(50000).build();
httppost.setConfig(requestConfig);
FileBody binFileBody = new FileBody(new File(localFilePath));
MultipartEntityBuilder multipartEntityBuilder = MultipartEntityBuilder.create();
multipartEntityBuilder.addPart(serverFieldName, binFileBody);
setUploadParams(multipartEntityBuilder, params);
HttpEntity reqEntity = multipartEntityBuilder.build();
httppost.setEntity(reqEntity);
CloseableHttpResponse response = httpclient.execute(httppost);
try {
System.out.println(response.getStatusLine());
HttpEntity resEntity = response.getEntity();
respStr = getRespString(resEntity);
EntityUtils.consume(resEntity);
} finally {
response.close();
}
} finally {
httpclient.close();
}
System.out.println("resp=" + respStr);
return respStr;
}
private void setUploadParams(MultipartEntityBuilder multipartEntityBuilder, Map<String, String> params) {
if (params != null && params.size() > 0) {
Set<String> keys = params.keySet();
for (String key : keys) {
multipartEntityBuilder.addPart(key, new StringBody(params.get(key), ContentType.TEXT_PLAIN));
}
}
}
private String getRespString(HttpEntity entity) throws Exception {
if (entity == null) {
return null;
}
BufferedReader in = new BufferedReader(new InputStreamReader(entity.getContent(), charSet));
StringBuffer strBuf = new StringBuffer();
String line = null;
while ((line = in.readLine()) != null) {
strBuf.append(line);
}
return strBuf.toString();
}
}
<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.test</groupId>
<artifactId>spider-base</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.3</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>fluent-hc</artifactId>
<version>4.5.3</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.9</version>
</dependency>
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.8.3</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpmime</artifactId>
<version>4.5.2</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.39</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
</plugins>
</build>
</project>