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-6797] Remember in MavenSession that there were problems detected when building Maven model #8485
Currently, Maven only prints few lines regarding Maven model problems it encounters when it is building the model. No plugin or code can retrieve the information anywhere. I would like to change that so that at least a boolean flag is used to remember that there were or were not problems when building Maven model.
Problems with the model are detected while creating the buildplan. This is way before the first plugin will be called. I don't see the benefit of this change, so without demonstration showing the need for this feature I'm going to close this issue as Won't Fix.
The problems are detected and messages about the problems are printed. But they are regularly ignored by people (at least here). Remembering in MavenSessions that there were problems would allow me to write Maven Enforcer Plugin rule which could retrieve the problems flag and could fail the build if there were problems. I see a benefit in having this no build warnings policy.
I have attached a pom.xml with produces these Maven warnings. Normally, they would be ignored.
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for org.example:problems-test:jar:1.0-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-install-plugin is missing. @ line 13, column 21
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
But with the attached Enforcer rule, I get this:
[INFO] --- maven-enforcer-plugin:3.0.0-SNAPSHOT:enforce (require-no-problems) @ problems-test ---
[WARNING] Rule 0: org.apache.maven.plugins.enforcer.RequireNoMavenModelProblems failed with message:
There are problems with effective model of this project.
Right, now I see your point.
Not sure if it is fair, but this issue could also be discovered with the requirePluginVersions
For Maven 3.7.0 there's a chance we'll be able to have warning-less builds with MNG-6065, which will probably superseed this issue.
MNG-6065 is interesting. I can see it working for some projects. But in my case it will not work well. It is impossible to fix all WARN messages logs in the project the size I maintain.
Closing as superseded by #12571, which introduces DiagnosticCollector — a session-scoped, thread-safe, deduplicated diagnostic collection service with severity, source, file/line, suggestion, and documentation URL. This is the proper API for remembering problems during the session.
Activity
jira-importer commentedon Nov 29, 2019
Robert Scholte commented
Problems with the model are detected while creating the buildplan. This is way before the first plugin will be called. I don't see the benefit of this change, so without demonstration showing the need for this feature I'm going to close this issue as Won't Fix.
jira-importer commentedon Nov 29, 2019
Václav Haisman commented
The problems are detected and messages about the problems are printed. But they are regularly ignored by people (at least here). Remembering in MavenSessions that there were problems would allow me to write Maven Enforcer Plugin rule which could retrieve the problems flag and could fail the build if there were problems. I see a benefit in having this no build warnings policy.
jira-importer commentedon Nov 30, 2019
Robert Scholte commented
Can you provide a minimal pom.xml showing the issue and optionally the enforcer-rule you have in mind?
jira-importer commentedon Nov 30, 2019
Václav Haisman commented
I have attached a pom.xml with produces these Maven warnings. Normally, they would be ignored.
But with the attached Enforcer rule, I get this:
jira-importer commentedon Dec 1, 2019
Robert Scholte commented
Right, now I see your point.
Not sure if it is fair, but this issue could also be discovered with the requirePluginVersions
For Maven 3.7.0 there's a chance we'll be able to have warning-less builds with MNG-6065, which will probably superseed this issue.
jira-importer commentedon Dec 1, 2019
Václav Haisman commented
MNG-6065 is interesting. I can see it working for some projects. But in my case it will not work well. It is impossible to fix all WARN messages logs in the project the size I maintain.
Remember if Maven model problems were encountered.
Remember if Maven model problems were encountered.
Remember if Maven model problems were encountered.
Remember if Maven model problems were encountered.
gnodet commentedon Oct 14, 2026
Closing as superseded by #12571, which introduces
DiagnosticCollector— a session-scoped, thread-safe, deduplicated diagnostic collection service with severity, source, file/line, suggestion, and documentation URL. This is the proper API for remembering problems during the session.Claude Code on behalf of Guillaume Nodet