Remember a Maven guide package error

Today I encountered a sm Maven error again

Scenario : I forgot to configure the hot deployment before and want to make up the hot deployment configuration, copy the dependency to the pom, view it in maven, report red, and display the version number as unknown

Solution :

1. Or try to delete the folder where the corresponding jar package is located in the warehouse, and then refresh the maven component. As always, it doesn’t work.

2. After annotating the dependency, restart the idea, the red report disappears, and release the comment, it still reports red, unknown

3. Finally, I tried to add the version number. There was no automatic prompt. During the hand-printing process, I found that all the folders in the process were generated under the corresponding folder of the warehouse.

For example, the version number is 2.2.1.RELEASE,

Generated folders such as 2, 2.2.1, 2.2.1.REALEASE, and unknown that has been lingering

After deleting all the wrong packages, copy the correct packages from other warehouses to the local

Try again, when prompted, import successfully after refresh

Summary : It is speculated that the generated incorrect package is most likely to be automatically imported by the maven package.

You can try to close it first, download the correct jar package, and then open it

Automatic import is sometimes tricky

Guess you like

Origin blog.csdn.net/codedecentt/article/details/111871714