'Cannot resolve symbol' in my Maven POM file for @VAR@ property values

Answered

Hello,

I'm getting errors for entries in my pom file

<context.root>@CONTEXT_ROOT@</context.root>
<app.prefix>@APP_PREFIX@</app.prefix>


For the first entry, it says "Cannot resolve symbol 'CONTEXT_ROOT'".

I need to set the property to exactly this value, our SCM profiling works with these variable names. Can I escape this in some way to get rid of these errors.

Many thanks in advance for your help!

13 comments
Comment actions Permalink

A workaround is to define a property in 'Settings > Build, Execution, Deployment > Build Tools > Maven > Runner > Properties'.

-1
Comment actions Permalink

This is very annoying!

0
Comment actions Permalink

It's a shame this critical bug is still present in the very latest version. Seems developers are not going to fix this at all.

0
Comment actions Permalink

Defining properties in the maven runner did not remove the error from the pom analyzer. Is there another workaround?

0
Comment actions Permalink

Get this when I use git-commit-id-plugin. Will have to start seeing a therapist because this exacerbates my OCD.

It also affects the 5 other people on my team.

0
Comment actions Permalink

Can it be solved now somehow?

0
Comment actions Permalink

I'm wondering if anyone found a solution. Although it doesn't break the build, the warnings are annoying. Setting a property in IntelliJ settings isn't a solution, as such a property, set manually, prevent its auto population by e.g. git-commit-id-plugin.

0
Comment actions Permalink

Could JetBrains please at least acknowledge the issue and provide an ETA for the fix? The "workaround" proposed above isn't valid as per Damir's explanation and warnings for perfectly valid code aren't acceptable.

1
Comment actions Permalink

I have duplicated this in other contexts. We have a use case where we define multiple Cucumber tag inclusion/exclusion settings in our POM, and get the same error.

For example, defining a Maven property as follows causes the error to appear; even disabling the Maven model inspection does not address the issue.

<cucumber.options>--tags ~@unit --tags ~@slow</cucumber.options>

It appears the parsing error is independent of the inspections.

0
Comment actions Permalink

Since 2018.2 version (corresponding blog post about this Maven update) it is now possible to suppress such errors:

0
Comment actions Permalink

Andrey,

That will definitely fix things - thanks for the information!

Could you please let us know when you expect that update to be released?

0
Comment actions Permalink

Andrey,

Again, thanks for the information. In addition to the functionality you describe, it also fixes the parsing error in the first place.

0

Please sign in to leave a comment.