You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Slawomir Jaranowski (Jira)" <ji...@apache.org> on 2023/05/12 19:26:00 UTC
[jira] [Commented] (MENFORCER-482) enforcer:enforce is unable to find rules but works when installing
[ https://issues.apache.org/jira/browse/MENFORCER-482?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17722267#comment-17722267 ]
Slawomir Jaranowski commented on MENFORCER-482:
-----------------------------------------------
You put plugin configuration in execution section, so you need execute as:
{noformat}
mvn enforcer:enforce@enforce-versions{noformat}
> enforcer:enforce is unable to find rules but works when installing
> ------------------------------------------------------------------
>
> Key: MENFORCER-482
> URL: https://issues.apache.org/jira/browse/MENFORCER-482
> Project: Maven Enforcer Plugin
> Issue Type: Bug
> Components: Plugin
> Affects Versions: 3.3.0
> Reporter: Javier A. Ortiz
> Priority: Major
>
> I have a normal project configured as follows:
> {code:java}
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-enforcer-plugin</artifactId>
> <version>3.3.0</version>
> <executions>
> <execution>
> <id>enforce-versions</id>
> <goals>
> <goal>enforce</goal>
> </goals>
> <configuration>
> <rules>
> <dependencyConvergence/>
> <requireMavenVersion>
> <version>[3.9.0,)</version>
> </requireMavenVersion>
> <requireJavaVersion>
> <version>11</version>
> </requireJavaVersion>
> </rules>
> </configuration>
> </execution>
> </executions>
> </plugin>{code}
> Running _mvn install_ runs the plugin as expected but doing mvn enforcer:enforce leads to:
> {code}
> Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:3.3.0:enforce (default-cli) on project p14c-api-tests: No rules are configured. Use the skip flag if you want to disable execution. -> [Help 1]
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)