Problem
IntelliJ IDEA Ultimate reports a warning for a key in application.properties or application.yml that belongs to a third-party Spring Boot starter:
Cannot resolve configuration property 'javamelody.enabled'
The application starts, and Spring Boot binds the property correctly at runtime. Keys from Spring Boot itself, such as server.port, resolve without a warning.
Example: net.bull.javamelody:javamelody-spring-boot-starter and net.bull.javamelody:javamelody-spring-boot4-starter 2.6.0 to 2.8.0. JavaMelody 2.9.0 fixes this.
Cause
IntelliJ IDEA reads the configuration keys of a library only from META-INF/spring-configuration-metadata.json inside the library jar. It does not scan @ConfigurationProperties classes in library jars. If the library jar does not contain the metadata file, the IDE cannot resolve its keys.
The metadata file is generated by spring-boot-configuration-processor when the library is compiled. Since JDK 23, javac does not run annotation processors that it finds on the classpath unless the build enables annotation processing explicitly. A library that declares the processor only as a dependency and is built with JDK 23 or later can therefore publish jars without the metadata file.
JavaMelody confirmed this cause. The 2.5.1 starter (built with JDK 17) contains the file, and 2.6.0 to 2.8.0 (built with JDK 25) do not. JavaMelody 2.9.0 adds the processor to annotationProcessorPaths and contains the file again (javamelody#1319).
To check a library, list the jar contents and look for META-INF/spring-configuration-metadata.json:
unzip -l <library>.jar | grep spring-configuration-metadata
Resolution
-
Update the library to a version that contains the metadata file, for JavaMelody 2.9.0 or later (javamelody#1319). Reload the Maven or Gradle project. If you defined the keys of this library in your project with option 2, you can remove those entries.
-
If no fixed version is available, define the key in the project metadata. Place the caret on the unresolved key, press Alt+Enter (⌥⏎ on macOS), and select Define configuration key. IntelliJ IDEA adds the key to
src/main/resources/META-INF/additional-spring-configuration-metadata.json, and the warning disappears. The file can also be created manually:{ "properties": [ { "name": "javamelody.enabled", "type": "java.lang.Boolean", "description": "If JavaMelody should be enabled within the application.", "defaultValue": true } ] }If you create the file manually, use the name
additional-spring-configuration-metadata.json. In IntelliJ IDEA 2026.3 EAP builds before 263.6334, the inspection description gives the wrong namespring-additional-configuration-metadata.json(Spring Boot inspection descriptions name wrong metadata file). The IDE does not read a file with that name. -
Suppress the warning for one key in
application.properties. Press Alt+Enter on the key and select Suppress for this property. IntelliJ IDEA adds a# suppress inspection "SpringBootApplicationProperties"comment above the line.
If the library has no fixed version, report the missing metadata file to the library maintainers. The library build must run spring-boot-configuration-processor, for example by listing it under annotationProcessorPaths of maven-compiler-plugin.
Comments
0 comments
Please sign in to leave a comment.