Build Maven project automatically download jar package

Use Maven to automatically download jar packages

  • Right-click on the project to convert the project to a Maven project

1


Then go to Maven's official website

http://mvnrepository.com/



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

2


Then there will be a version number here, we click the latest version 1.10.2

3


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

4


Edit the pom.xml file

5


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.

6



After saving, eclipse will automatically download the jsoup.jar package

7



Test and find that you can use this jar package

8



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

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324812264&siteId=291194637