IntelliJ说:在maven-jaxws-tools-plugin中不允许<encoding>

时间:2019-01-16 09:28:14

标签: maven intellij-idea encoding jax-ws pom.xml

在我的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将UTF-8标记为红色。此外,它还说:“此处不允许元素编码。”

我可以将其删除吗?

1 个答案:

答案 0 :(得分:0)

maven-jaxws-tools-plugin的编码默认值为${project.build.sourceEncoding}。您还可以在如下属性中进行设置:

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

据我所知,Windows上的默认编码例如是cp1252,也许这就是为什么您的intellij抱怨吗?