~~ Licensed to the Apache Software Foundation (ASF) under one | |
~~ or more contributor license agreements. See the NOTICE file | |
~~ distributed with this work for additional information | |
~~ regarding copyright ownership. The ASF licenses this file | |
~~ to you under the Apache License, Version 2.0 (the | |
~~ "License"); you may not use this file except in compliance | |
~~ with the License. You may obtain a copy of the License at | |
~~ | |
~~ http://www.apache.org/licenses/LICENSE-2.0 | |
~~ | |
~~ Unless required by applicable law or agreed to in writing, | |
~~ software distributed under the License is distributed on an | |
~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | |
~~ KIND, either express or implied. See the License for the | |
~~ specific language governing permissions and limitations | |
~~ under the License. | |
----- | |
Require Same Version | |
----- | |
Robert Scholte | |
----- | |
2013-06-16 | |
----- | |
Require Prerequisites | |
This rule enforces that the prerequisite is specified since it is not inherited from its parent. | |
Defining the prerequisites is especially useful for plugins to enforce at least a certain version of Maven. | |
The following parameters are supported by this rule: | |
* mavenVersion - an optional value contain a versionrange or the version at least required. | |
[] | |
Sample Plugin Configuration: | |
+---+ | |
<project> | |
[...] | |
<build> | |
<plugins> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-enforcer-plugin</artifactId> | |
<version>${project.version}</version> | |
<executions> | |
<execution> | |
<id>enforce-prerequisites</id> | |
<goals> | |
<goal>enforce</goal> | |
</goals> | |
<configuration> | |
<rules> | |
<requirePrerequisite> | |
<mavenVersion>4.0.0-alpha-1-SNAPSHOT</mavenVersion> | |
</requirePrerequisite> | |
<!-- same rule, different notation --> | |
<requirePrerequisite> | |
<mavenVersion>[2.2.1,)</mavenVersion> | |
</requirePrerequisite> | |
</rules> | |
</configuration> | |
</execution> | |
</executions> | |
</plugin> | |
</plugins> | |
</build> | |
[...] | |
</project> | |
+---+ |