Search code examples
mavenintellij-ideaencodingjax-wspom.xml

IntelliJ says: <encoding> not allowed in maven-jaxws-tools-plugin


In my pom

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

    <build>
        <plugins>
            <plugin>
                <groupId>org.jboss.ws.plugins</groupId>
                <artifactId>maven-jaxws-tools-plugin</artifactId>
                <executions>
                    <execution>
                        <id>wsconsume</id>
                        <goals>
                            <goal>wsconsume</goal>
                        </goals>
                        <configuration>
                            <wsdls>
                                <wsdl>${project.build.directory}/dependency-schemas/wsdl/myWsdl.wsdl</wsdl> 
                            </wsdls>
                            <extension>true</extension>
                            <verbose>false</verbose>
                            <encoding>UTF-8</encoding>
                            <bindingFiles>
                                <bindingFile>${project.build.directory}/dependency-schemas/wsdl/jaxb_bindings.xml</bindingFile>
                            </bindingFiles>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <!-- more stuff -->

</project>

IntelliJ marks UTF-8 as red. Furthermore it says: "Element encoding is not allowed here".

Can I just remove it?


Solution

  • The default value for the encoding for maven-jaxws-tools-plugin is the value of ${project.build.sourceEncoding}. You can also set that in the properties like this:

     <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>
    

    As far as i know the default encoding on windows is for example cp1252, maybe thats why your intellij is complaining?