在项目中groupId作为表中的字段,和maven的'groupId'(坐标)重名,如果不设置过滤,maven项目打包时会把Mybatis的mapper.xml文件中groupId参数转义成org.***、com.***、cn.***
解决方法:
在maven的pom.xml文件中添加过滤,过滤掉xml:
<plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-resources-plugin</artifactId> <version>3.0.2</version> <configuration> <nonFilteredFileExtensions> <nonFilteredFileExtension>xml</nonFilteredFileExtension> <nonFilteredFileExtension>xlsx</nonFilteredFileExtension> <nonFilteredFileExtension>xls</nonFilteredFileExtension> </nonFilteredFileExtensions> </configuration> <executions> <execution> <id>copy-xmls</id> <phase>process-sources</phase> <goals> <goal>copy-resources</goal> </goals> <configuration> <outputDirectory>${basedir}/target/classes</outputDirectory> <resources> <resource> <directory>${basedir}/src/main/java</directory> <includes> <include>**/*.xml</include><!--e.g: mybatis.mapper.xml--> <!--other res type--> </includes> </resource> </resources> </configuration> </execution> </executions> </plugin> </plugins>