In my project's POM, I use maven-resources-plugin to set some properties from a file. However, Intellij flags these property references in the POM with the error "cannot resolve symbol", presumably because it cannot see them being defined anywhere. Is there a way to suppress this error?
-
If you hit alt-enter, is there an option where you can disable the inspection? – vikingsteve Jul 02 '13 at 13:40
-
@vikingsteve no, the only options are "merge tags" and "split current tag" – Andy Dennie Jul 02 '13 at 15:10
-
Wondering then if you are able to define them with blank values and then overwrite them with the maven-resources-plugin? – vikingsteve Jul 02 '13 at 20:00
4 Answers
Warning: The solution to define the property blank as vikingsteve mentioned is very dangerous because in Maven 3 properties which are declared in pom.xml
could not be changed by other plugins.
So if you have one plugin which sets a property and another plugin which reads the value of the property it will always get an empty string if you initialize it in the pom.xml
.
In fact you can't define it in the pom.xml
but i have no idea what i can do to eliminate the IntelliJ IDEA warning. For now i have to disable the "Maven model inspection". :-(

- 2,778
- 3
- 22
- 37
-
1
-
unfortunately, not yet. sry. I also don't know if there exists a JIRA ticket at jetbrains... :( – Josef Reichardt Jun 08 '16 at 11:32
-
1@ the user who have down-voted my answer (maybe @vikingsteve ?): can you please explain why you have down voted my answer? I can't see any error. – Josef Reichardt Aug 30 '16 at 13:39
-
probably because you were unfortunately also not able to provide a better solution, a final answer – avalancha Nov 22 '16 at 10:36
The best way I see to solve the issue is to use the following comment:
<!-- suppress UnresolvedMavenProperty -->
Empty properties are not overwritten or may be a risky operation as @Josef mentioned.

- 1,950
- 1
- 9
- 22

- 19
- 3
Yes, you can open Settings (spanner icon), go to Project Settings -> Inspections and then disable the inspection Maven -> Maven Model Inspection.
Alternatively, you might like to try defining "blank" values for the properties, and see if the plugin successfully overwrites them.
<properties>
<myproperty></myproperty>
</properties>
Good luck!

- 38,481
- 23
- 112
- 156
-
The setting didn't have any effect for me, but the empty property worked. – Andy Dennie Nov 01 '13 at 18:09
-
Sry, but this solution isn't correct! Please see my Answer below. – Josef Reichardt Aug 30 '16 at 10:28
Error “cannot resolve symbol” can occur if you open a directory maven project, but intellij project has not yet been created. Why does the "Maven model inspection" there is such a relationship - is not clear, but it helped me.

- 109
- 1
- 3
-
Hey Stas, in either case you should edit this and clarify what you mean by the model inspection. I can't tell if you're asking a question or proposing a solution. Hope this helps! – jamesmortensen Nov 03 '13 at 00:15
-
I mean, that there is a project - "Inspection" is working correctly. There is no "idea"-project, the properties are highlighted as "cannot resolve symbol". – Stas Yak Nov 07 '13 at 07:08