java - Why can't I use an apache httpcomponents object in spring-boot, even though it is listed in the MVN dependancies? -


spring-boot has following maven dependencies around org.apache.httpcomponents

<dependency>     <groupid>org.apache.httpcomponents</groupid>     <artifactid>httpasyncclient</artifactid>     <version>${httpasyncclient.version}</version>     <exclusions>         <exclusion>             <groupid>commons-logging</groupid>             <artifactid>commons-logging</artifactid>         </exclusion>     </exclusions> </dependency> <dependency>     <groupid>org.apache.httpcomponents</groupid>     <artifactid>httpclient</artifactid>     <version>${httpclient.version}</version>     <exclusions>         <exclusion>             <groupid>commons-logging</groupid>             <artifactid>commons-logging</artifactid>         </exclusion>     </exclusions> </dependency> <dependency>     <groupid>org.apache.httpcomponents</groupid>     <artifactid>httpmime</artifactid>     <version>${httpclient.version}</version> </dependency> 

however don't have access org.apache.http related in codebase unless add dependency myself.

<dependency>     <groupid>org.apache.httpcomponents</groupid>     <artifactid>httpclient</artifactid> </dependency> 

why this? isn't same adding dependency twice?

the artifacts declared in dependencymanagement section of spring-boot-dependencies pom.

meaning when inherit spring boot starter, can declare want use of dependencies managed it. notice don't need provide version of httpclient. because spring has nicely managed you, hence dependencymanagement. not same thing declaring twice.

more info here http://docs.spring.io/spring-boot/docs/current-snapshot/reference/htmlsingle/#using-boot-maven-parent-pom


Comments

Popular posts from this blog

html - How can i make an element from a bottom stacking context stays in front of another higher stacking context? -

python - TypeError: start must be a integer -

sql - MySQL Custom calculate views -