Skip to content

[MNG-6797] Remember in MavenSession that there were problems detected when building Maven model #8485

Closed as not planned

Description

@jira-importer

Václav Haisman opened MNG-6797 and commented

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.


Affects: 3.6.2

Attachments:

Remote Links:

Activity

  1. jira-importer commented on Nov 29, 2019

    @jira-importer
    Author

    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.

  2. jira-importer commented on Nov 29, 2019

    @jira-importer
    Author

    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.

  3. jira-importer commented on Nov 30, 2019

    @jira-importer
    Author

    Robert Scholte commented

    Can you provide a minimal pom.xml showing the issue and optionally the enforcer-rule you have in mind?

  4. jira-importer commented on Nov 30, 2019

    @jira-importer
    Author

    Václav Haisman commented

    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.
    
  5. jira-importer commented on Dec 1, 2019

    @jira-importer
    Author

    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.

  6. jira-importer commented on Dec 1, 2019

    @jira-importer
    Author

    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.

  7. added a commit that references this issue on Jul 29, 2026
    1edef52
  8. added a commit that references this issue on Aug 24, 2026
    98bdadb
  9. added a commit that references this issue on Sep 4, 2026
    54442ce
  10. added a commit that references this issue on Sep 15, 2026
    676a69b
  11. gnodet commented on Oct 14, 2026

    @gnodet
    Contributor

    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

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions