Project building reporting false errors
Hello,
I'm facing a strange behavior in IntelliJ (build 181.4203.550) running with Java 8 on a Windows 7 plateform.
I have a Web Service project generating classes from WSDL files. Everytime I change WSDL files, classes are generated by jaxb2 maven plugin in the target/generated-sources folder. Of course, as objects have change, the maven build fail with errors. The maven log is quite explicit and perfectly ok:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project myproject: Compilation failure: Compilation failure:
[ERROR] /XXXXXXXX/XXXXXXXX/XXXXXXXX/src/main/java/fr/xx/xx/xxx/xxxxx/SomeClass.java:[69,26] cannot find symbol
[ERROR] symbol: method mymethod(java.lang.String)
But when I try a Build Project (Ctrl+F9) IntelliJ gives a lot of false errors formated this way:
Error:(12, 44) java: cannot find symbol
symbol: class AnExistingAndOkClass
location: package fr.all.right.package.package
It seems it cannot find any class or import.
Invalidating cache & restart do not solve this issue. The only way to solve the problem is to reflect WSLD changes in the code and everything come back to normal.
What can I do to make IntelliJ project build report correctly compilation errors ?
Thanks,
JNGerbaux
请先登录再写评论。
Make sure this class/package is not excluded from compilation and is configured as a valid source root: https://www.jetbrains.com/help/idea/configuring-content-roots.html.
If the issue remains, please provide a sample project illustrating the problem and the exact steps to reproduce.
I'm working for a company and I've been obliged to mask informations on screenshot, but "false" errors are in various pakages of differents modules.
As far as I can say, content roots folders are correctly defined for each modules.
I don't think the problem comes from project configuration: When corrections are made to make the code fit to modified generated class (generated by the maven-jaxb2-plugin), everything goes back to normal. No need to change configuration or other part of the code...
As the team is under heavy developpements, I don't think I have time to provide a sample.