Run Maven Enforcer Plugin rule on command line

后端 未结 4 1731
一个人的身影
一个人的身影 2021-01-17 11:28

I would like to enforce the requireReleaseDeps rule of the Maven Enforcer Plugin on a Maven project without any POM configuration simply as a command line call.

Acco

相关标签:
4条回答
  • 2021-01-17 11:55

    It is available from 3.0.0. The Jira issue from accepted answer got resolved: https://issues.apache.org/jira/browse/MENFORCER-142

    mvn enforcer:enforce -Drules=alwaysPass,alwaysFail
    
    0 讨论(0)
  • 2021-01-17 11:56

    With the version 3.0.0-M3 of the plugin and newer release the enforcer goal now supports the rules parameter and command line execution without config in the pom. See more at https://maven.apache.org/enforcer/maven-enforcer-plugin/enforce-mojo.html#commandLineRules

    Unfortunately there is currently no such functionality but there is already a JIRA Issue for that.

    0 讨论(0)
  • 2021-01-17 11:59

    Worked for me using Atlassian's fork of the plugin: mvn org.apache.maven.plugins:maven-enforcer-plugin:3.0.0-atlassian-m01:enforce -Drules=...

    I had to declare their plugin repository:

    <pluginRepositories>
        ....
        <pluginRepository>
            <id>atlassian-3rdparty</id>
            <url>https://maven.atlassian.com/3rdparty</url>
        </pluginRepository>
    </pluginRepositories>
    

    Hope this helps.

    0 讨论(0)
  • 2021-01-17 12:12

    It works with the 3.0.0-M3 version:

    mvn org.apache.maven.plugins:maven-enforcer-plugin:3.0.0-M3:enforce -Drules=requireReleaseDeps
    
    0 讨论(0)
提交回复
热议问题