we use Vaadin 8 and I’m the only Windows IntelliJ user with a compilation error in about 50% of all maven runs. My colleagues with MacOS IntelliJ or other Windows users don’t have this issues. The error message is always the same in the same maven target, but the reported classes differ (like never the same).
[INFO]
--- vaadin-maven-plugin:8.8.5:compile (default) @ MpApplicationVaadinView ---
[INFO]
auto discovered modules [com.zetcom.mp.application.view.vaadin.MpRIAWidgetset]
[INFO]
Compiling module com.zetcom.mp.application.view.vaadin.MpRIAWidgetset
[INFO]
Tracing compile failure path for type 'com.zetcom.mp.application.view.vaadin.client.AppStyleExtensionConnector'
[INFO]
[ERROR]
Errors in 'file:/C:/dev/projects/MpRIA/MpApplicationVaadinView/src/main/java/com/zetcom/mp/application/view/vaadin/client/AppStyleExtensionConnector.java'
[INFO]
[ERROR]
Line 12: The import com.zetcom.mp.application.view.vaadin.component.AppStyleExtension cannot be resolved
[INFO]
[ERROR]
Line 19: AppStyleExtension cannot be resolved to a type
[INFO]
[ERROR]
Line 19: Class<AppStyleExtension> cannot be resolved to a type
However this types always exist in this one maven module (war packaging) and are always only a package away. If I repeat the build it is compiling. This feels like a race condition, as it is working in 50% of the cases directly and can always be fixed by a second run if the error occurs.
Based on the pwd output, I presume you’re using Cygwin? If you’re running the Maven goal from the Cygwin terminal, have you tried running it from inside the IDE instead? Or if you’re running the command from inside the IDE, have you tried command line instead? Is your Maven version up to date?
yes I use cygwin, but I usually have this issue in Intellij with bundled Maven 3.3.9. I verified this error also occurred under cygwin with Maven 3.6.0 (although I needed three attempts, i.e. small statistics look like 33% there).
I’ve heard Maven 3.5.2 is probably the minimum version, although there is no official data on that (My Intellij’s bundled version seems to be 3.6.1). But if 3.6.0 also gives you the same issue, it’s not what’s causing the problem. Which Java version are you using?
Hey, I ignored the issue for a long time due to the easy workaround, but it’s still very annoying. I tested now with Oracle JDK 1.8.0_202 and Oracle JDK 1.8.0_251 and have the very same issue also there at least in Intellij, haven’t checked in cygwin directly, yet.
Core reason was a falsely activated auto build option in intellij (Build project automatically), at least in conjunction with auto clean on rebuild (Clear output directory on rebuild). Thanks to Intellij auto sync settings I had the issue on multiple machines and didn’t realize the second build process in background. It’s a wonder that there have been workarounds working at all. Also failing command line results must be coming from having intellij at least open parallel. I’m glad I finally found the core reason… Thanks for sparing!