There are already many similar questions, but none of the proposed solutions (mainly "Clear caches and restart IntelliJ) solves my problem.
I have a maven project that I imported into IntelliJ Community Edition 2017.1 . My maven build automatically creates some java sources from Google protobuf specifications.
Excerpt from pom.xml
<plugin>
<groupId>com.github.os72</groupId>
<artifactId>protoc-jar-maven-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<protocVersion>3.1.0</protocVersion> <!-- 2.4.1, 2.5.0, 2.6.1, 3.1.0 -->
<inputDirectories>
<include>src/main/protobuf</include>
</inputDirectories>
<outputDirectory>${project.build.directory}/generated-sources/protobuf</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
The folder /generated-sources/protobuf is correctly recognized as "generated-sources" with a blue icon and the wheel for generated sources under IntelliJ -> File -> Project Structure -> Modules -> Sources
The maven target "compile" also works fine.
But the IntelliJ "internal" java compiler complains "Cannot resolve symbol" for my generated class.
Solutions I tired so far
Any more suggestions?
In IntelliJ IDEA 2016 and newer you can change this setting in Help > Edit Custom Properties.
On older versions, there's no GUI to do it. But you can change it if you edit the IntelliJ IDEA Platform Properties file as described here: https://intellij-support.jetbrains.com/hc/en-us/articles/206544869-Configuring-JVM-options-and-platform-properties
# Maximum file size (kilobytes) IDE should provide code assistance for.
idea.max.intellisense.filesize=50000
# Maximum file size (kilobytes) IDE is able to open.
idea.max.content.load.filesize=50000
Don't forget to save and restart IntelliJ IDEA.
SOLUTION: The generated files were to large. Had to increase
idea.max.intellisense.filesize=2500
in IDE_HOME\bin\idea.properties
as described here: File size exceeds configured limit (2560000), code insight features not available
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With