Search code examples
mavenconfigurationtomcat7-maven-plugin

maven pom.xml error with configuration in IntelliJ


There is a problem in the pom.xml like this.

<build>
        <finalName>console</finalName>
        <plugins>
            <plugin>
                <groupId>org.apache.tomcat.maven</groupId>
                <artifactId>tomcat7-maven-plugin</artifactId>
                <version>2.2</version>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>
        </plugins>
    </build>

Like above code, source and target, encoding tag is shown as red color in IntelliJ IDEA.
And this code did not exist in old version. Cause I merged and committed this code with new version with GIT. This code is new version's code.

If I hover the mouse at the <source>, then it says

Element source is not allowed here.

If I hover the mouse at the <target>, then it says

Element target is not allowed here.

If i hover the mouse at the <encoding>, then it says

Element encoding is not allowed here.

Is it related with tomcat7-maven-plugin or other problems? All i did is just paste this code to pom.xml.


Solution

  • tomcat7-maven-plugin doesn't support source, target, encoding tags.

    so it was wrong source code.

    I solved this problem removing configuration tag.