1: Configure Maven
Download from the official website and add the bin directory to the system variable path.
In the cmd window, enter MVN, and the execution feedback is configured successfully.
Configure the Conf/settings.xml file to specify the repository center to download to a local directory
<localRepository>E:\MavenRepo</localRepository>
2: Experience maven in IntelliJ
Create a new Java project and choose Maven, all the way next.
Build a good root directory pom.xml, add dependencies
<Properties> <dropwizard.version>0.7.1</dropwizard.version> </Properties> <Dependencies> <Dependency> <groupId>Io.dropwizard</groupId> <Artifactid>Dropwizard-core</Artifactid> <version>${dropwizard.version}</version> </Dependency> </Dependencies>
Right-click to select maven->reimport; if there is no directory locally, it will take time to download it from the Web.
Wait for the execution to succeed. You can use a dependent package in your project.
3: summary
Multiple projects can share a local warehouse, and no need to manually add jars to classpath.
This is just one of Maven's many skills in project management tools, and it's worth learning.
"Maven" in IntelliJ, experience maven