[ERROR] Failed to execute goal io.spring.javaformat:spring-javaformat-maven-plugin:0.0.34:validate (default) on project pig-register: Formatting violations found in the following files:
报错信息如下:
C:\Shen\Software\JDK\jdk1.8.0_60\bin\java.exe -Dmaven.multiModuleProjectDirectory=E:\CODE\IntelliJIDEA\PigDemo\pig-master\pig-master -Dmaven.home=C:\Shen\Software\IntelliJIDEA\plugins\maven\lib\maven3 -Dclassworlds.conf=C:\Shen\Software\IntelliJIDEA\plugins\maven\lib\maven3\bin\m2.conf -Dmaven.ext.class.path=C:\Shen\Software\IntelliJIDEA\plugins\maven\lib\maven-event-listener.jar -javaagent:C:\Shen\Software\IntelliJIDEA\lib\idea_rt.jar=61891:C:\Shen\Software\IntelliJIDEA\bin -Dfile.encoding=UTF-8 -classpath C:\Shen\Software\IntelliJIDEA\plugins\maven\lib\maven3\boot\plexus-classworlds-2.6.0.jar;C:\Shen\Software\IntelliJIDEA\plugins\maven\lib\maven3\boot\plexus-classworlds.license org.codehaus.classworlds.Launcher -Didea.version=2021.3.2 -s C:\Shen\Software\IntelliJIDEA\plugins\maven\lib\maven3\conf\settings.xml install
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] pig [pom]
[INFO] pig-register [jar]
[INFO] pig-common [pom]
[INFO] pig-common-core [jar]
[INFO] pig-gateway [jar]
[INFO] pig-common-feign [jar]
[INFO] pig-common-mybatis [jar]
[INFO] pig-upms [pom]
[INFO] pig-upms-api [jar]
[INFO] pig-common-security [jar]
[INFO] pig-common-log [jar]
[INFO] pig-auth [jar]
[INFO] pig-common-swagger [jar]
[INFO] pig-upms-biz [jar]
[INFO] pig-common-bom [pom]
[INFO] pig-common-datasource [jar]
[INFO] pig-common-job [jar]
[INFO] pig-common-seata [jar]
[INFO] pig-visual [pom]
[INFO] pig-codegen [jar]
[INFO] pig-monitor [jar]
[INFO] pig-sentinel-dashboard [jar]
[INFO] pig-xxl-job-admin [jar]
[INFO]
[INFO] -------------------------< com.pig4cloud:pig >--------------------------
[INFO] Building pig 3.5.1 [1/23]
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- spring-javaformat-maven-plugin:0.0.34:validate (default) @ pig ---
[INFO]
[INFO] --- git-commit-id-maven-plugin:4.9.9:revision (get-the-git-infos) @ pig ---
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ pig ---
[INFO] Installing E:\CODE\IntelliJIDEA\PigDemo\pig-master\pig-master\pom.xml to C:\Users\18303\.m2\repository\com\pig4cloud\pig\3.5.1\pig-3.5.1.pom
[INFO]
[INFO] ---------------------< com.pig4cloud:pig-register >---------------------
[INFO] Building pig-register 3.5.1 [2/23]
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- spring-javaformat-maven-plugin:0.0.34:validate (default) @ pig-register ---
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for pig 3.5.1:
[INFO]
[INFO] pig ................................................ SUCCESS [ 0.531 s]
[INFO] pig-register ....................................... FAILURE [ 1.125 s]
[INFO] pig-common ......................................... SKIPPED
[INFO] pig-common-core .................................... SKIPPED
[INFO] pig-gateway ........................................ SKIPPED
[INFO] pig-common-feign ................................... SKIPPED
[INFO] pig-common-mybatis ................................. SKIPPED
[INFO] pig-upms ........................................... SKIPPED
[INFO] pig-upms-api ....................................... SKIPPED
[INFO] pig-common-security ................................ SKIPPED
[INFO] pig-common-log ..................................... SKIPPED
[INFO] pig-auth ........................................... SKIPPED
[INFO] pig-common-swagger ................................. SKIPPED
[INFO] pig-upms-biz ....................................... SKIPPED
[INFO] pig-common-bom ..................................... SKIPPED
[INFO] pig-common-datasource .............................. SKIPPED
[INFO] pig-common-job ..................................... SKIPPED
[INFO] pig-common-seata ................................... SKIPPED
[INFO] pig-visual ......................................... SKIPPED
[INFO] pig-codegen ........................................ SKIPPED
[INFO] pig-monitor ........................................ SKIPPED
[INFO] pig-sentinel-dashboard ............................. SKIPPED
[INFO] pig-xxl-job-admin .................................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.922 s
[INFO] Finished at: 2022-07-25T14:13:35+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.spring.javaformat:spring-javaformat-maven-plugin:0.0.34:validate (default) on project pig-register: Formatting violations found in the following files:
[ERROR] * E:\CODE\IntelliJIDEA\PigDemo\pig-master\pig-master\pig-register\src\main\java\com\alibaba\nacos\config\ConfigConstants.java
[ERROR] * E:\CODE\IntelliJIDEA\PigDemo\pig-master\pig-master\pig-register\src\main\java\com\alibaba\nacos\config\ConsoleConfig.java
[ERROR] * E:\CODE\IntelliJIDEA\PigDemo\pig-master\pig-master\pig-register\src\main\java\com\alibaba\nacos\console\controller\HealthController.java
[ERROR] * E:\CODE\IntelliJIDEA\PigDemo\pig-master\pig-master\pig-register\src\main\java\com\alibaba\nacos\console\controller\NamespaceController.java
[ERROR] * E:\CODE\IntelliJIDEA\PigDemo\pig-master\pig-master\pig-register\src\main\java\com\alibaba\nacos\console\controller\ServerStateController.java
[ERROR] * E:\CODE\IntelliJIDEA\PigDemo\pig-master\pig-master\pig-register\src\main\java\com\alibaba\nacos\console\enums\NamespaceTypeEnum.java
[ERROR] * E:\CODE\IntelliJIDEA\PigDemo\pig-master\pig-master\pig-register\src\main\java\com\alibaba\nacos\console\exception\ConsoleExceptionHandler.java
[ERROR] * E:\CODE\IntelliJIDEA\PigDemo\pig-master\pig-master\pig-register\src\main\java\com\alibaba\nacos\console\filter\XssFilter.java
[ERROR] * E:\CODE\IntelliJIDEA\PigDemo\pig-master\pig-master\pig-register\src\main\java\com\alibaba\nacos\console\model\Namespace.java
[ERROR] * E:\CODE\IntelliJIDEA\PigDemo\pig-master\pig-master\pig-register\src\main\java\com\alibaba\nacos\console\model\NamespaceAllInfo.java
[ERROR] * E:\CODE\IntelliJIDEA\PigDemo\pig-master\pig-master\pig-register\src\main\java\com\alibaba\nacos\PigNacosApplication.java
[ERROR]
[ERROR] Run `spring-javaformat:apply` to fix.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn
Process finished with exit code 1
执行命令:可在IDEA 中Terminal执行命令
mvn spring-javaformat:apply
备注:执行命令之前得安装 maven。
安装包:下载
环境变量配置 如图 然后点击确定就可以执行命令了(“mvn spring-javaformat:apply”)
或者通过命令提示符执行。