Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

`descriptor` fails on `onlineRequired`, `dependencyCollection` and `dependencyResolutionPathScopes` in the Maven 4 API `@Mojo`

Aperta
#1,231 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@efegokdemir ci sta già lavorando.

Dal 7/10/2026.

  • #1237 di @efegokdemir — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
65/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
java

Direzione di ricerca

Start at DefaultMojoAnnotationsScanner.java:276 and inspect MojoAnnotationContent.java, then compare the Maven 4 @Mojo attributes with the existing projectRequired and dependencyResolutionRequired handling. Verify the descriptor goal with the three reported attributes and ensure dependencyCollection, onlineRequired, and dependencyResolutionPathScopes no longer fail during scanning.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug
Affected version

4.0.0-beta-3; the code is unchanged on master

Bug description

The scanner copies each annotation attribute set on a mojo into MojoAnnotationContent by calling the method of the same name (DefaultMojoAnnotationsScanner.java:276). MojoAnnotationContent has no method for three attributes of the Maven 4 API @Mojo, so setting any of them fails the descriptor goal:

Attribute Error
dependencyCollection = true Method: 'dependencyCollection' not found in class: 'class org.apache.maven.tools.plugin.extractor.annotations.datamodel.MojoAnnotationContent'
onlineRequired = true Method: 'onlineRequired' not found in class: …
dependencyResolutionPathScopes = "main-compile" Method: 'dependencyResolutionPathScopes' not found in class: …

Reproduced with maven-plugin-plugin 4.0.0-beta-3 under Maven 4.0.0-rc-7, one mojo per attribute, for example:

@Mojo(name = "run", dependencyCollection = true)
public class ReproMojo implements org.apache.maven.api.plugin.Mojo {
    public void execute() {}
}

010c9b2e (MPLUGIN-508) added methods for the Maven 4 names projectRequired and dependencyResolutionRequired; these three have none. #257 (MPLUGIN-506, closed unmerged) mapped onlineRequired. They do not map one to one: dependencyCollection is a boolean where the Maven 3 requiresDependencyCollection is a ResolutionScope, and dependencyResolutionPathScopes names Maven 4 path scopes.

Lingua principale
Java
Stelle
63
Fork
76
Merge medio
1g 8h
PR unite (30g)
19

Preparare l'ambiente

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di apache/maven-plugin-tools

Tutte le issue di apache/maven-plugin-tools

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.