Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Maven plugin: Maven 4 warns about Plexus `@Component` injection

オープン
#3,121 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@Goooler がすでに取り組んでいます。

2026年9月30日 から。

  • #3122 @Goooler による — オープン

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
78/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
java
領域
build-system

調査の方向性

Start in plugin-maven/src/main/java/com/diffplug/spotless/maven/AbstractSpotlessMojo.java and inspect the four @Component fields: RepositorySystem, ResourceManager, BuildContext and MavenSession. Apply the issue’s MavenSession parameter and JSR-330 injection guidance, then run the plugin under Maven 4 and Maven 3. Done means the Maven 4 validation warning is gone while Maven 3 support remains.

索引モデルが issue の本文から書いたものです。

説明

Running spotless-maven-plugin 3.10.3 under Maven 4.0.0-rc-7 prints a plugin validation warning on every build:

[WARNING]  * com.diffplug.spotless:spotless-maven-plugin:3.10.3
[WARNING]      - Plugin uses Plexus Component requirements (@Component annotation). Use Maven 4 Dependency Injection (for v4 plugins) or JSR 330 annotations (for v3 plugins) to inject dependencies instead.

The source is the four @Component fields in plugin-maven/src/main/java/com/diffplug/spotless/maven/AbstractSpotlessMojo.java: RepositorySystem, ResourceManager, BuildContext and MavenSession.

A fix that keeps Maven 3 support:

  • MavenSession is not a component; take it as @Parameter(defaultValue = "${session}", readonly = true).
  • Inject the other three with JSR-330 (@Inject on a constructor or on the fields).
主要言語
Java
スター
5.7k
フォーク
563
平均マージ
1日 18時間
マージ済み PR(30日)
53

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

diffplug/spotless のほかの issue

diffplug/spotless の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。