RocketMQ コンパイル エラー: mvn -Prerelease-all -DskipTests clean install -U | mvn <goals> -rf :rocketmq-store|broker

エラーメッセージ

Linux 環境で RocketMQ をダウンロードしてインストールすると、次のエラー メッセージが表示される場合があります。

 1) [エラー] 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)[エラー] 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

答え

公式 RocketMQ mvn コンパイル コマンドは、パラメータ-Dcheckstyle.skipを追加します。

mvn -Prerelease-all -DskipTests clean install -U #公式コマンド (rocketmq-store または rocketmq-broker エラーを常に報告します)
mvn -Prelease-all -DskipTests -Dcheckstyle.skip clean install -U #パラメータを追加、スキップ チェックアウト

CentOS6.5での効果テストは成功しました! 

CentOS7.9での効果テストは成功しました!

特別な注意: RocketMQ 解凍のルート ディレクトリでmvn コンパイルを必ず実行してください(配布ディレクトリで mvn コンパイルを実行する必要はありません)。そうしないと、他のエラーが報告されます。

プロセス

インターネット上でエラーの答えが見つからなかったので、自分で解決しようとしました。

1. 異なるバージョンのJDKを変更して繰り返し試しますが、常に上記のエラーが発生します

yum install java-1.8.0-openjdk-devel -y コマンドの使用を含む (最終的に /usr/lib/jvm にインストールされる)

2. 異なるバージョンの Maven を変更した後も、問題は依然として存在します。

最後に、 Windows バージョンでの RocketMQ のインストールに関するブログで、コンパイル エラーの問題を解決するには-Dcheckstyle.skipパラメーターを追加する必要があることがわかりました。

エピローグ

これまでのところ、インターネット上でこのエラーに対する直接的な解決策は見つかりませんでした。さらに、キーワード「[ERROR] mvn <args> -rf :rocketmq-store」で検索しましたが、関連するものが見つかりませんでした。投稿はまったくありません。したがって、後発者たちにインスピレーションを与えることを願って、このブログ記事を書きました。

刺激になったり、参考になったりしたら、ぜひ「いいね!」を押して集めてください!

ノート

1. RocketMQ コレクション: Linux での RocketMQ のダウンロードとインストールの詳細な説明|

おすすめ

転載: blog.csdn.net/xp871038951/article/details/127565045