Maven guide package is popular (error) complete solution ideas

Maven guide package is popular (error) complete solution ideas

Related scenes:

1. The imported new project, Maven did not import all the packages
. 2. Create a parent project to manage the version of the technology in the entire project. But when the parent project was created, the jar packages of more new technologies were not imported

Solution for scenario one (general):

step one:

  • **Main idea: **
    Specific steps for detecting idea's configuration of maven :
    Click file->settings-> to check whether the maven version is consistent with the version you downloaded, and whether the warehouse is the warehouse location configured in the settings.xml of the maven config . And whether the setting.xml location is the settings.xml in the maven you just selected, insert the picture description here,
    Insert picture description here
    Insert picture description here
    where the Maven home directory is the maven installation location, the User setting file refers to the location of the settings.xml in the maven you installed, and the local repository refers to The location of the local warehouse configured in settings.xml. If you still have problems after adjusting in step 1, please see step 2.

Step two:

The main idea : increase download channels and delete old jar packages that failed to download

Specific steps:

  1. Add mirrors in < mirrors > in setting.xml . The setting.xml is in the config in the downloaded maven;
  2. Delete the jar package that failed to download;
  3. Re-guide the package
    The location of setting.xml is in the conf (configuration file) in the downloaded maven.
    Insert picture description here
    The mirror needs to be added in, the added mirror is (if there is a duplicate mirror, you don’t need to add it again):
<mirror>
      <id>nexus-aliyun</id>
      <mirrorOf>*</mirrorOf>
      <name>Nexus aliyun</name>
      <url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>
<mirror>
	<id>alimaven</id>
	<mirrorOf>central</mirrorOf>
	<name>aliyun maven</name>
	<url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
</mirror>
<mirror>
      <id>nexus</id>
      <name>internal nexus repository</name>
      <!-- <url>http://192.168.1.100:8081/nexus/content/groups/public/</url>-->
      <url>http://repo.maven.apache.org/maven2</url>
      <mirrorOf>central</mirrorOf>
</mirror>
<mirror>
        <id>nexus-aliyun</id>
        <mirrorOf>*</mirrorOf>
        <name>Nexus aliyun</name>
        <url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>
<mirror>
      <id>nexus-aliyun</id>
      <mirrorOf>*</mirrorOf>
      <name>Nexus aliyun</name>
      <url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>
<mirror>
      <id>alimaven</id>
      <name>aliyun maven</name>
      <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
      <mirrorOf>central</mirrorOf>
</mirror>
<mirror> 
      <id>Central</id> 
      <url>http://repo1.maven.org/maven2</url> 
      <mirrorOf>central</mirrorOf> 
</mirror>

Search for files ending with .lastUpdated in the local repository. These files are all jar packages
Insert picture description here
that failed to download. ctrl+a all the files found, and then delete them.
Open the related project, click maven on the right, and then click reImport.
Insert picture description here
So far, most of the maven guide package exceptions have been resolved. However, there may still be some packages that cannot be imported, and you can only import them manually.

Step three:

The main idea : some jar packages cannot be imported for some reason, and you need to manually import the packages at this time

Specific steps:

  1. Find the package that cannot be imported in the pom.xml of the project;
  2. Find a classmate or colleague to pass these packages to you;
  3. Put these packages in the corresponding location, and then restart the idea (or reimport is fine, you may not do the operation)

Insert picture description here

This means that the 3.3.1 version of the mybatis-plus-boot-starter file is missing in the baomidou folder in the com folder of the local warehouse. If the folder you want from your classmate contains this, you only need to place it in the corresponding location Put this 3.3.1 package in "local warehouse.com.baomidou.mybatis-plus-boot-starter".
Insert picture description here
The folder I am looking for is the mybatis-plus-boot-starter folder, and there is only one version 3.3.1. If there are other versions of mybatis-plus-boot-starter in your local library, but there is no one you need , Then you only need to put the corresponding version in this mybatis-plus-boot-starter.
At this time, because there is no mybatis-plus-boot-starter folder in my local library, I need to create a folder and find the required version mybatis-plus-boot-starter and copy it into it.
Insert picture description here
tips: The dependent groupId in pom.xml refers to the location where the artifactId needs to be stored in the local warehouse, and the version is the version of the corresponding artifactId.
At this point, more than 90% of the maven guide package dependency problem should be solved.

Scenario two (the parent project leads the package error):

**Cause of error (guess): **Maybe due to springboot version problems, the unified version number cannot be recognized

solution:

Put the popular dependencies in another project, and specify the version you need. This is how I solved the red-hot error of the parent project. If the error still occurs, you can refer to scenario one.

Guess you like

Origin blog.csdn.net/JasonLee97/article/details/108854778