The dependency of mybatis does not end with </dependency>;
All children of dependency应该是<dependencies></dependencies>;
As long as there are no errors in pom.xml and the warehouse address configured in settings.xml can be connected successfully, just execute maven > reimport in the IDE and the jar package will be downloaded to the local warehouse.
But there is one situation that you should pay attention to: sometimes the download may be interrupted halfway, and then re-download will not be able to download again because of the damaged jar package downloaded before. At this time, usually go to the local warehouse path and manually download the previously downloaded Just remove the jar package.
ctrl+alt+shift+s, 在弹出的面板里面看选择Libraries,看一下有没有mybatis的jar包,如果没有的话就是没下好,执行一下reimport试试。 否则的话看一下你源码中有没有import,或者import right or wrong? I think this is more likely... After all, the custom classes in the code cannot be found. . . If there is no problem with the above... Re-import this project, this is a universal solution. .
in
Terminal
中手动运行mvn clean install
.If the operation is successful, you can refresh the project.
pom.xml has two errors
The dependency of mybatis does not end with
</dependency>
;All children of
dependency
应该是<dependencies></dependencies>
;As long as there are no errors in pom.xml and the warehouse address configured in settings.xml can be connected successfully, just execute
maven > reimport
in the IDE and the jar package will be downloaded to the local warehouse.But there is one situation that you should pay attention to: sometimes the download may be interrupted halfway, and then re-download will not be able to download again because of the damaged jar package downloaded before. At this time, usually go to the local warehouse path and manually download the previously downloaded Just remove the jar package.
Is the package path of
ctrl+alt+shift+s
, 在弹出的面板里面看选择Libraries
,看一下有没有mybatis
的jar包,如果没有的话就是没下好,执行一下reimport试试。否则的话看一下你源码中有没有
import
,或者import
right or wrong? I think this is more likely... After all, the custom classes in the code cannot be found. . .If there is no problem with the above... Re-import this project, this is a universal solution. .
Is it possible to write a dependency and a denpendency in your pom?
Do you have import org.apache.ibatis.session.SqlSessionFactory in your java file?
Click on External Libraries and look for
Maven:org.mybatis:mybatis:version number
Right-click on pom.xml and report again. If the speed is slow, it is recommended to directly download the jar and put it into your maven library