7

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.

Mr Lister
  • 45,515
  • 15
  • 108
  • 150
Moon Taejin
  • 351
  • 3
  • 9
  • 21
  • What you have pasted is simply wrong, cause the tomcat7-maven-plugin does not contain such configuration options and IntelliJ is telling you that....within the [documentation you can see the available options etc.](http://tomcat.apache.org/maven-plugin-trunk/tomcat7-maven-plugin/deploy-mojo.html) – khmarbaise Mar 17 '16 at 08:35
  • the original source code about this build was in the eclipse. is there any difference between eclipse and intellij – Moon Taejin Mar 17 '16 at 08:46
  • 2
    In Eclipse it is also wrong, cause the plugin does not support such options...but the checking of the plugin options in Eclipse is not as good as in IntelliJ... – khmarbaise Mar 17 '16 at 08:54

2 Answers2

5

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

so it was wrong source code.

I solved this problem removing configuration tag.

Moon Taejin
  • 351
  • 3
  • 9
  • 21
1

It only maybe support three tags , For Example : outputDirectory,finalName,attach.

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

The generated jar file will be named by the value of the finalName plus "-sources" if it is the main sources. Otherwise, it would be finalName plus "-test-sources" if it is the test sources. It will be generated in the specified outputDirectory. The attach parameter specifies whether the java sources will be attached to the artifact list of the project.

Reffering to site:[enter link description here][1]https://maven.apache.org/plugins/maven-source-plugin/examples/configureplugin.html

youchuikai
  • 49
  • 3