1

I have added the following in my POM so that I can use the Maven enforcer ruleset -

...
</plugins>
        </pluginManagement>
    </build>
</project>
...
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-enforcer-plugin</artifactId>
    <version>1.4.1</version>
    <executions>
        <execution>
            <id>enforce-no-snapshots</id>
            <goals>
                <goal>enforce</goal>
            </goals>
            <configuration>
                <rules>
                    <requireReleaseDeps>
                        <message>No Snapshots Allowed!</message>
                        <excludes>
                            <exclude>org.apache.maven:maven-core</exclude>
                        </excludes>
                    </requireReleaseDeps>
                </rules>
                <fail>true</fail>
            </configuration>
        </execution>
    </executions>
</plugin>  
...
</plugins>
        </pluginManagement>
    </build>
</project>

But I am getting this error when running goal mvn enforcer:enforce

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.405s
[INFO] Finished at: Tue Sep 01 14:35:26 IST 2015
[INFO] Final Memory: 11M/240M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.4.1:enforce (default-cli) on project XXX
QAParent: The parameters 'rules' for goal org.apache.maven.plugins:maven-enforcer-plugin:1.4.1:enforce are missing or in
valid -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginParameterException

Can someone help please???

Saikat
  • 14,222
  • 20
  • 104
  • 125
  • 1
    possible duplicate of [Maven clean install issue: Failed to configure plugin parameters](http://stackoverflow.com/questions/24883102/maven-clean-install-issue-failed-to-configure-plugin-parameters) – SaviNuclear Aug 28 '15 at 09:49
  • I disagree @SaviNuclear. Its a different issue altogether. – Saikat Aug 28 '15 at 10:06
  • Please post full error message output....and full pom file... – khmarbaise Aug 31 '15 at 08:47
  • @khmarbaise as requested the error message is updated. The pom is quite large and the work policy does not allow me to post here. Is there any other way I can provide you the information? – Saikat Sep 01 '15 at 09:09
  • 1
    Possible duplicate of [usage of maven enforcer plugin](http://stackoverflow.com/questions/6754974/usage-of-maven-enforcer-plugin) – gavenkoa Dec 02 '15 at 16:37

1 Answers1

0

I was getting the same error when using maven-enforcer-plugin:1.4.1 with maven:3.0.5. Downgrading the enforcer version to 1.3.1 did the trick. You may have to downgrade to a lower version (like 1.0.1) if you are using an even older version of maven.

Mike Cialowicz
  • 9,892
  • 9
  • 47
  • 76