Skip to content

Instantly share code, notes, and snippets.

@coding963
Created April 20, 2016 18:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save coding963/c04f02c6c188b87def65850e7f5cb050 to your computer and use it in GitHub Desktop.
Save coding963/c04f02c6c188b87def65850e7f5cb050 to your computer and use it in GitHub Desktop.
HttpComponentDependency
package com.test.so;
import org.apache.http.client.HttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
public class App {
public static void main( String[] args )
{
System.out.println( "Hello World!" );
HttpClient httpClient = HttpClientBuilder.create().build();
System.out.println( "Hello World!" );
}
}
package com.test.so;
import org.apache.http.client.HttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.junit.Assert;
import org.junit.Test;
public class HttpCoreDependencyTest {
@Test
public void test(){
System.out.println( "Hello World!" );
HttpClient httpClient = HttpClientBuilder.create().build();
System.out.println( "Hello World!" );
Assert.assertTrue(true);
}
}
<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.so</groupId>
<artifactId>soproject-1</artifactId>
<version>0.0.1-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<!-- <dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<version>4.1-alpha1</version>
</dependency> -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.2</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpmime</artifactId>
<version>4.5.2</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<version>4.4</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient-cache</artifactId>
<version>4.5.2</version>
</dependency>
</dependencies>
</project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment