1

I have variables in my parent POM which are set during pre-build maven plugin goals such as buildnumber:create and build-helper:parse-version. In Intellij IDEA, these variables show 'cannot resolve symbol' warnings in the IDE and the pom.xml is red (disaster!). The build still works as the goals are run every time.

Examples of such symbols which cannot be resolved are: ${parsedVersion.majorVersion} ${parsedVersion.minorVersion}

Eclipse manages to find a way round this, I believe, using a section in the pom for plugin management to execute the goals at at on configuration/increment:

<plugin>
    <groupId>org.eclipse.m2e</groupId>
    <artifactId>lifecycle-mapping</artifactId>
    <version>1.0.0</version>
    <configuration>
        <lifecycleMappingMetadata>
            <pluginExecutions>
                <pluginExecution>
                    <pluginExecutionFilter>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>buildnumber-maven-plugin</artifactId>
                        <versionRange>[1.0-beta-1,)</versionRange>
                        <goals>
                            <goal>create</goal>
                        </goals>
                    </pluginExecutionFilter>
                    <action>
                        <execute>
                            <runOnConfiguration>true</runOnConfiguration>
                            <runOnIncremental>true</runOnIncremental>
                        </execute>
                    </action>
                </pluginExecution>
             </pluginExecutions>
        </lifecycleMappingMetadata>
    </configuration>
</plugin>

Is there any way to do the equivalent in intellij so the symbols are resolved in the editor?

Cheers

JimHawkins
  • 4,843
  • 8
  • 35
  • 55
Bant
  • 307
  • 1
  • 3
  • 8
  • Those configuration you are using is for Eclipse M2E and will not influence IntelliJ IDEA ...? – khmarbaise Jun 21 '16 at 09:30
  • That's right, the pluginExecution is for m2e, let me expand the snippet.. – Bant Jun 21 '16 at 09:42
  • 4
    I believe this is a duplicate of https://stackoverflow.com/q/37444282/65839 –  Jun 21 '16 at 12:56
  • I think you're right, thanks for that. Looks like there's not a proper solution to it, then. Now to decide on the lesser of two evils.. – Bant Jun 21 '16 at 14:32

0 Answers0