You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[MNG-8650] Provide a tool to validate a POM #10442
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.
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.
Activity
ikxeno commentedon Sep 17, 2026
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.
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.