Skip to content

Can't override ratchetFrom on Maven command-line #2842

@mkhl

Description

@mkhl

I have a maven project that uses the spotless plugin and configures <ratchetFrom>origin/main</ratchetFrom>.

I'd like to be able to override that settings from the command-line. The spotless:check and spotless:apply goals both advertise accepting a ratchetFrom parameter (visible for example with mvn help:describe -Dplugin=spotless -Dgoal=check -Ddetail, but undocumented), but mvn spotless:check -DratchetFrom=NONE uses the ratchetFrom configuration from the POM.

I believe this is caused by AbstractSpotlessMojo discarding the NONE value before checking whether it overrides the configuration, presumably treating it as if the used hadn't provided it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions