Skip to content

[MENFORCER-415] Violation messages can be really hard to find in a multi module project #533

Closed

Description

@jira-importer

Falko Modler opened MENFORCER-415 and commented

In a multi module project, when building with multiple threads (-T) and/or --fail-at-end, enforcer rule violation messages can be really hard to find.

After BUILD FAILURE you just see e.g.

Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:3.0.0-M3:enforce (enforce-test-deps-scope) on project quarkus-integration-test-jpa: Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed. -> [Help 1]

You then have to scroll up, past a potentially huge list of SKIPPED reactor modules and messages like the following:

[INFO] ------------------------------------------------------------------------
[INFO] Skipping Quarkus - Integration Tests - Mailer
[INFO] This project has been banned from the build due to previous failures.
[INFO] ------------------------------------------------------------------------ 

Then, finally, when reaching the first (from the bottom) potentially relevant module outputs, you have find the part with the actual violation messages which can be even higher up.
This only gets worse when building in parallel.

The idea is to enrich the MojoExecutionException with the actual violation messages, either in general or via a new property/parameter.


Affects: 3.0.0-M3, 3.0.0

Issue Links:

  • MENFORCER-400 DependencyConvergence - poor error message
    ("is duplicated by")

Remote Links:

Backported to: 3.2.0

Activity

  1. jira-importer commented on Jan 23, 2023

    @jira-importer
    Author

    Slawomir Jaranowski commented

    I simply add error message to Exception, so we will have, like:

    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time:  29.647 s (Wall Clock)
    [INFO] Finished at: 2023-01-23T22:12:29+01:00
    [INFO] ------------------------------------------------------------------------
    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:3.2.0-SNAPSHOT:enforce (enforce-test-deps-scope) on project quarkus-hibernate-orm-deployment: 
    [ERROR] Rule 0: org.apache.maven.enforcer.rules.dependency.BannedDependencies failed with message:
    [ERROR] Found test dependencies with wrong scope:
    [ERROR] io.quarkus:quarkus-hibernate-orm-deployment:jar:999-SNAPSHOT
    [ERROR]    org.assertj:assertj-core:jar:3.24.2 <--- banned via the exclude/include list
    [ERROR] 
    [ERROR] -> [Help 1]
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions