RocketMQ compilation error: mvn -Prelease-all -DskipTests clean install -U | mvn <goals> -rf :rocketmq-store|broker

error message

When downloading and installing RocketMQ in a Linux environment , you may encounter error messages:

 1) [ERROR]   mvn <args> -rf :rocketmq-store

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  06:01 min
[INFO] Finished at: 2022-10-27T02:30:51-07:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.spotbugs:spotbugs-maven-plugin:4.2.2:spotbugs (spotbugs) on project rocketmq-store: Execution spotbugs of goaotbugs:spotbugs-maven-plugin:4.2.2:spotbugs failed: java.util.EmptyStackException -> [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/PluginExecutionException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <args> -rf :rocketmq-store
[root@CentOS6 rocketmq-all-5.0.0-source-release]# mvn -clean 

2)[ERROR]   mvn <args> -rf :rocketmq-broker

[ERROR] Failed to execute goal com.github.spotbugs:spotbugs-maven-plugin:4.2.2:spotbugs (spotbugs) on project rocketmq-broker: Execution spotbugs of goal com.github.spotbugs:spotbugs-maven-plugin:4.2.2:spotbugs failed: edu.umd.cs.findbugs.ba.AnalysisException: Exeption was thrown during analysis: java.lang.OutOfMemoryError: GC overhead limit exceeded -> [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/PluginExecutionException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <args> -rf :rocketmq-broker

Answer

The official RocketMQ mvn compilation command adds parameters: -Dcheckstyle.skip

mvn -Prelease-all -DskipTests clean install -U #Official command (always report rocketmq-store or rocketmq-broker error)
mvn -Prelease-all -DskipTests -Dcheckstyle.skip clean install -U #Add parameters, skip Check it out

The test effect on CentOS6.5 was successful! 

The test effect on CentOS7.9 was successful!

Special attention: Be sure to execute mvn compilation in the root directory of RocketMQ decompression (no need to perform mvn compilation in the distribution directory), otherwise other errors will be reported.

process

Because I couldn't find the answer to the error on the Internet, I tried to solve it myself.

1. Change the JDK of different versions and try repeatedly, but the above error always occurs

Including using the yum install java-1.8.0-openjdk-devel -y command (finally installed in /usr/lib/jvm)

2. After changing Maven of different versions, the problem still exists.

Finally, I saw in a blog about installing RocketMQ in the windows version that the -Dcheckstyle.skip parameter needs to be added to solve the problem of compiling errors.

Epilogue

So far, I haven't found a direct solution to this error on the Internet, and what's more, I searched with the keyword " [ERROR] mvn <args> -rf :rocketmq-store ", and I can't find related posts at all. Therefore, I wrote this blog post, hoping to inspire the latecomers.

If it inspires or helps you, please like and collect it!

notes

1. RocketMQ Collection: Detailed Explanation of Downloading and Installing RocketMQ in Linux|

Guess you like

Origin blog.csdn.net/xp871038951/article/details/127565045