1.打開maven項目中的pom.xml文檔,點選pom.xml标簽
1.
2.到maven官網https://mvnrepository.com/檢視是否有你想要的那個jar包
3.點選我們要的jar包名,進入以下界面選擇版本
4.點選需要的版本,進入以下界面,添加下面的代碼到pom.xml文檔中的dependencies裡面即可。
<!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.3.5</version>
</dependency>
5.重新執行mvn指令,項目就會自動包含需要的jar包了。