Visitar URL original
`@Resolution` fields stay null: `plugin.xml` gets no `<resolutions>` · Issue #1230 · apache/maven-plugin-tools · GitHub
Skip to content

@Resolution fields stay null: plugin.xml gets no <resolutions> #1230

Open

Description

@slachiewicz

Affected version

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

Bug description

The annotation scanner collects @Resolution as a field annotation (MojoAnnotationsScanner.java:56), but nothing turns it into descriptor content, so plugin.xml gets no <resolutions> element. Maven core injects @Resolution fields only from that element (DefaultMavenPluginManager.java:616), so the field stays null and nothing reports an error.

Reproducer, built with maven-plugin-plugin 4.0.0-beta-3 and run with Maven 4.0.0-rc-7 on a project with one compile dependency; it prints paths=null:

@Mojo(name = "run")
public class ReproMojo implements org.apache.maven.api.plugin.Mojo {
    @Resolution(pathScope = "main-compile")
    List<Path> paths;

    public void execute() {
        System.out.println("paths=" + paths);
    }
}

Expected: one <resolution> per annotated field, with field, pathScope and requestType as defined by the resolutions element in plugin.mdo.

Activity

  1. goutamadwant commented on Oct 3, 2026

    @goutamadwant

    @slachiewicz I reproduced this with Maven 4.0.0-rc-7 and prepared a fix #1234. Please let me know if you have any feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions