You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Alexander Kriegisch (Jira)" <ji...@apache.org> on 2020/02/21 05:46:00 UTC

[jira] [Commented] (MENFORCER-142) Specify enforcer rule in command line without modifying any pom

    [ https://issues.apache.org/jira/browse/MENFORCER-142?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17041565#comment-17041565 ] 

Alexander Kriegisch commented on MENFORCER-142:
-----------------------------------------------

Unfortunately the tests only cover rules without parameters like {{alwaysPass}} and {{alwaysFail}}. But if I run a command like this...

{code}
mvn enforcer:enforce -Drules=requireMavenVersion
(...)
[INFO] --- maven-enforcer-plugin:3.0.0-M3:enforce (default-cli) @ test-resources ---
[WARNING] Rule 0: org.apache.maven.plugins.enforcer.RequireMavenVersion failed with message:
Maven version can't be empty.
{code}

... I will see the error above even if the POM is preconfigured with necessary parameters for such goals. Furthermore, there is no documented way of actually setting or overriding such parameters via CLI. I suggest to re-open this ticket and fix the issue.

> Specify enforcer rule in command line without modifying any pom
> ---------------------------------------------------------------
>
>                 Key: MENFORCER-142
>                 URL: https://issues.apache.org/jira/browse/MENFORCER-142
>             Project: Maven Enforcer Plugin
>          Issue Type: New Feature
>          Components: Plugin
>            Reporter: Arnaud Bourrée
>            Assignee: Karl Heinz Marbaise
>            Priority: Major
>             Fix For: 3.0.0-M3
>
>
> Hello,
> How could we specify enforcer:enforce rules from command line?
> I want to run command line like following without updating any pom.xml:
> mvn enforcer:enforce -Drules=com.acme.UseAcmeParentPom
> The goal of this enforcer:enforce rule is to check that Acme's
> developers write pom.xml which inherit from acme's parent pom.xml
> And because they may not inherit from acme's parent pom.xml, I cannot
> specify enforcer rule in.
> Regards,
> Arnaud.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)