The Maven Enforcer Plugin provides goals to control certain environmental constraints such as Maven version, JDK version and OS family along with many more standard rules and user created rules.
Questions tagged [maven-enforcer-plugin]
110 questions
47
votes
3 answers
Solving Maven dependency convergence issues
I use the maven-enforcer-plugin to check for dependency convergence issues. A typical output would be:
[WARNING] Rule 1: org.apache.maven.plugins.enforcer.DependencyConvergence failed
with message:
Failed while enforcing releasability the…

Duncan Jones
- 67,400
- 29
- 193
- 254
27
votes
3 answers
versions:display-plugin-updates does not understand maven-enforcer-plugin
So, I'm trying to use the latest version of some plugins. Earlier I've used the prerequisites-tag but lots of resources (example) say that it should be considered deprecated and that the maven-enforcer-plugin should be used instead.
this is my…

Richo
- 751
- 7
- 17
27
votes
3 answers
Maven enforcer plugin missing or invalid rules
I am trying to setup the enforcer plugin for maven to enforce a minimum Java version. However, whenever I try to run mvn enforcer:enforce, I get:
The parameters 'rules' for goal org.apache.maven.plugins:maven-enforcer-plugin:1.3.1:enforce are…

X3no
- 412
- 1
- 5
- 10
23
votes
4 answers
How to use of the Maven Enforcer plugin?
I'd like to use the Maven Enforcer plugin to check to see if I have duplicate classes on my path.
I've tried the example from here.
But when I run it like this:
mvn enforcer:enforce
I get this error:
Failed to execute…

javamonkey79
- 17,443
- 36
- 114
- 172
19
votes
2 answers
Enforce a minimum version of Maven
Is it possible to specify in a POM the minimum version of Maven required to build the project?
We've been wasting lots of time chasing issues from people building our project due to bugs in older versions of Maven that cause large artifacts (>2GB)…

FatalError
- 52,695
- 14
- 99
- 116
18
votes
2 answers
Skip module with Maven enforcer
I'm using enforcer plugin in a multi-node project in the root pom, but I have one testing module, that I don't really care to run the plugin there since it won't create any jar and is only for testing purposes. Is there any way to skip one of the…

paul
- 12,873
- 23
- 91
- 153
17
votes
4 answers
Run Maven Enforcer Plugin rule on command line
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.
According to the docs I should be able to just pass in the rules parameter like so
mvn…

Manfred Moser
- 29,539
- 13
- 92
- 123
10
votes
1 answer
"Project does not define required minimum version of Maven" with versions-maven-plugin 2.7
I'm facing the following error executing mvn versions:display-plugin-updates. Basing on this discussion, that was fixed in 2.6, but I'm using 2.7 (tried with 2.6 but with no success).
[ERROR] Project does not define required minimum version of…

sys463
- 337
- 2
- 5
- 18
10
votes
1 answer
maven-enforcer-plugin and child pom
I am trying to use the maven-enforcer-plugin to ensure that one profile is activated (requireActiveProfile rule). See the second example on this page: Require Active Profile
It works well with a single pom file. When I try to use it with 2 pom files…

Jmini
- 9,189
- 2
- 55
- 77
8
votes
1 answer
Add parameters to Maven Enforcer Rules called from the command line
Following https://stackoverflow.com/a/59389998/927493, one can now call the Maven enforcer plugin from the command line.
This works well, but unfortunately I haven't understood yet whether I can set rule parameters through the command line. An…

J Fabian Meier
- 33,516
- 10
- 64
- 142
8
votes
1 answer
Dependency convergence error caused by maven-enforcer-plugin
The following is the error I see, what confused me is that why it would depends on 2 versions of my-engine dependency. One is 0.9.0-20180510.015454-2 and another is 0.9.0-SNAPSHOT.
Heres's the command I use:
mvn clean install -DskipTests
In the…

zjffdu
- 25,496
- 45
- 109
- 159
8
votes
2 answers
Maven enforcer and wilcard dependency exclusion
I am using the Maven enforcer plugin to check for dependency convergence. Given this (contrived) example:
project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
…

MandyW
- 1,117
- 3
- 14
- 23
7
votes
2 answers
Maven: ensure same major parent pom version in multi-project development
Our team has multiple projects; most projects are just libraries. Let's assume for simplicity that the libraries don't depend on each other and there is a single project that uses them, e.g.:
Project Main:
Project Lib-A:
X (3rd-party…

Alexander
- 2,761
- 1
- 28
- 33
7
votes
2 answers
Maven Enforcer Plugin: Specify rules via command line
I want to execute the Maven Enforcer plugin via the command line.
I've tried:
mvn enforcer:enforce -Drules=[requireReleaseDeps]
mvn enforcer:enforce -Drules=requireReleaseDeps
I am always getting this error:
[ERROR] Failed to execute goal…

Harold L. Brown
- 8,423
- 11
- 57
- 109
7
votes
3 answers
Sonar plugin error in eclipse maven project
I am creating a new language plugin for sonarqube in Eclipse with maven project and facing following error while building the project:
Failed to execute goal com.mycila.maven-license-plugin:maven-license-plugin:1.9.0:
check (enforce-license-headers)…

Vishnu
- 71
- 1
- 3