我在Windows系统上有一些关于构建项目的问题。我的项目使用formatter-maven-plugin,目标是"validate“。在GitHub中推送项目之前,我先对其进行格式化并推送。之后,我将其克隆到我的windows计算机上,并尝试"mvn全新安装“,但我得到:
 Failed to execute goal net.revelc.code.formatter:formatter-maven-plugin:2.9.0:validate (default) on project application: File 'C:\Users\AUser\Desktop\demo\application\src\main\java\com\myapp\Application.java' has not been previously formatted. Please format file and commit before running validation!在Linux中,这个问题并不存在。为什么会这样呢?在推送Git之前,我对它进行了格式化。为什么在linux上不存在问题?无法更改格式的目标。
<plugin>
                <groupId>net.revelc.code.formatter</groupId>
                <artifactId>formatter-maven-plugin</artifactId>
                <version>2.9.0</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>validate</goal>
                        </goals>
                        <configuration>
                            <configFile>${project.basedir}/../eclipse/eclipse-formatter.xml</configFile>
                            <encoding>UTF-8</encoding>
                        </configuration>
                    </execution>
                </executions>
            </plugin>发布于 2020-03-04 01:09:59
https://stackoverflow.com/questions/56670074
复制相似问题