[INFO] Changes detected - recompiling the module!
[INFO] Compiling 124 source files to /root/CMS/target/classes
[WARNING] Unable to autodetect 'javac' path, using 'javac' from the environment.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.987 s
[INFO] Finished at: 2024-04-23T21:13:51+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project shishuocms: Compilation failure -> [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:
解决方法:通过[WARNING] 警告可以看出 mave无法从环境变量中找到javac命令,所有导致编译出错。
[root@mini-D-103 CMS]# javac -version
-bash: javac: 未找到命令
javac在java-devel包中 安装工具包即可使用javac命令
yum -y install java-devel
[root@mini-D-103 CMS]# javac -version
javac 1.8.0_332