Use Maven to automatically download jar packages
- Right-click on the project to convert the project to a Maven project
Then go to Maven's official website
There are a lot of jar packages for us to use, for example, I want to download a jsoup jar package now
- Search for jsoup, click the first one
Then there will be a version number here, we click the latest version 1.10.2
Copy the address below Maven
<!-- https://mvnrepository.com/artifact/org.jsoup/jsoup -->
<dependency>
<groupId>org.jsoup</groupId> <artifactId>jsoup</artifactId> <version>1.10.2</version> </dependency>
- 1
- 2
- 3
- 4
- 5
- 6
Edit the pom.xml file
exist
</build>
</project>
- 1
- 2
- 3
add one in the middle
<dependencies>
</dependencies>
- 1
- 2
- 3
Label
Then copy the Maven download address into it.
After saving, eclipse will automatically download the jsoup.jar package
Test and find that you can use this jar package
Here are some things to note:
- If there is a problem with the Maven plugin, the Maven project will fail
Copyright statement: This article is an original article by the blogger and may not be reproduced without the blogger's permission. https://blog.csdn.net/gfd54gd5f46/article/details/54973954