1. Problem & Analysis
The project passes all tests in STS, but fails many tests when executing gradle build.
Find the Gradle's test report, many Invalid Bound Statement.
Then go to the bin folder, found no MyBatis mapper xml files inside, why Gradle didn't copy the xml files to complied target?
2. Solution
Don't want to do some complicated configuration on Gradle side, the easiest solution should be move the xml files from src/main/java to src/main/resources, of course keep the hierarchy.