The method in the custom DAO (xxxMapper) is deleted when the Springboot project runs the MVN command.

the SpringBoot project can run using the Java entry normal class, but when starting by running the Maven command or performing other operations, such as using the Maven command to package the project, it will automatically delete the methods in the custom DAO. XxxMapper is automatically generated through mybatis generator, and the methods in mapper are shown in the figure

.

clipboard.png

selectByUsernameUserMaper.xmlMavenselectByUsername

clipboard.png

clipboard.png

beginners learn, ask for answers! The worker"s body thanks to the waist!


has it been solved? Also ask


reason:
I use mybatis-generator to automatically generate dao and other code, and in the packaging process, he will execute the command of mybatis-generator automatic code generation again. The entire Mapper.java file will be replaced, so the custom method in Mapper.java must be gone.

solution:
after generating the relevant files, delete the mybatis-generator dependency in pom.xml and package it.

Welcome follow:
https://github.com/DianeDii

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1ea404c-47a79.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1ea404c-47a79.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?