Skip to content

[MNG-8650] Provide a tool to validate a POM #10442

Closed

Description

@jira-importer

Guillaume Nodet opened MNG-8650 and commented

I think we should provide a simple command line that can be used to validate a POM and report warnings and errors in a simple way.
We could then ask Sonatype to make sure that POMs uploaded to Maven Central do not contain any error and raise the warnings back to maintainers.


No further details from MNG-8650

Activity

  1. modified the milestones: 4.0.0, 4.1.0 on Mar 23, 2026
  2. ikxeno commented on Sep 17, 2026

    @ikxeno
    Contributor

    I'd like to take this, if nobody has started.

    Before writing anything, here's what I'd build, so you can tell me if it's
    what you had in mind.

    A separate CLI tool laid out like mvnenc and mvnup: Options in
    maven-api-cli, Parser/Invoker/Context in maven-cli, launchers in the
    assembly. Needs nothing beyond core on the classpath, so it doesn't add to
    the /lib bloat raised in #10316.

        mvnval [<pom>...]        defaults to ./pom.xml
    

    It builds the model and prints the ModelProblems the ModelBuilder already
    produces, with severity and source:line:column. Plain text by default,
    --format=json for the Sonatype case in the description. Exit 0 when clean,
    1 on errors, 2 on warnings only, so a gate can pick its own strictness.

    Out of scope: rewriting POMs, that's mvnup's job.

    Three things I'd rather settle first:

    Standalone tool, or a goal on an existing plugin?
    Which validation level for a published POM? Strict, as for a build POM, or something looser?
    @gnodet, you moved this to 4.1.0 in March. Were you planning to do it yourself? I don't want to collide.

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

    maintenancepriority:major

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions