Closed l-scott-warner closed 5 years ago
Hi @l-scott-warner ,
I'm not sure, but it might be caused by out-of-sync files. Have you tried 'Refresh' and 'Clean' ? If it didn't resolve the problem, please post a set of XML and Java files that reproduce the problem.
Refresh and clean don't make any difference. This happens every time I generate the files using the mybatis generator in gradle. I will try to put together a sample project that demonstrates the problem. This did not happen until I upgraded to this version of mybatipse.
This turns out to have something to do with sub-projects where the sub-project is a mybatis project and the errors are showing up on the parent project. I haven't been able to create a small project structure that duplicates the problem yet.
I was able to work around this issue by making sure that my parent projects are not java projects in eclipse. This issue has more to do with eclipse sub-projects that any particular set of XML and java files.
I attached an eclipse project with a subproject that has mybatis files. If you import it and run a validate on the parent project, you should get all kinds of mybatis errors. If you filter your errors by selected project you will see that the errors are on the parent project, not the subproject with the mapper.
@l-scott-warner ,
Thanks a lot for the demo!
When I validate the parent project, I got 42 errors of type "MyBatis XML Problem" on the AhaLookupMapper.xml
(there actually are 21 errors, but this XML file is in both src
and bin
) and no errors on Java files.
As the subproject
folder is not in the build path of mybatipsebug
project, MyBatipse should not validate AhaLookupMapper.xml
.
I haven't find a way to achieve it yet, but there are several workarounds.
In the parent project, disable manual validation.
In the parent project, add subproject
folder to 'Exclude Group' of MyBatis XML Mapper Validator's validation filter (detailed instruction).
Please let me know if these didn't work for you.
Thanks for the quick response. Your solution #2 is what I used and it works. Since this is the way the eclipse validation works,the issue is resolved as far as I'm concerned.
Yeah, this might be a case that requires the validation filter. Closing as 'resolved' for now, but if anyone knows a plugin side solution, please let us know. Thank you again for the detailed report and repro!
Mybatipse is putting an error indicator on all generated mappers. I found the following error in the eclipse log.
MyBatipse Version: 1.2.2.201903190116 Mybatis Generator Version: 1.3.5
eclipse.buildId=4.11.0.I20190307-0500 java.version=1.8.0_181 java.vendor=Oracle Corporation BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US Framework arguments: -product org.eclipse.epp.package.jee.product Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.jee.product
Created Time: 2019-04-19 06:05:47.850
net.harawata.mybatipse Error Fri Apr 19 06:45:07 MDT 2019 Error occurred while validating reference: BaseResultMap