| ~~ 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 No Repositories |
| ------ |
| Brian Fox |
| ------ |
| Novemer 2007 |
| ------ |
| |
| Require No Repositories |
| |
| This rule enforces that all plugins have a version defined, either in the plugin or pluginManagement section of the pom or a parent pom. |
| |
| The following parameters are supported by this rule: |
| |
| * message - an optional message to the user if the rule fails. |
| |
| * banLatest - disallow any use of "LATEST" as a version for any plugin. Default = true. |
| |
| * banRelease - disallow any use of "RELEASE" as a version for any plugin. Default = true. |
| |
| * banSnapshots - disallow any use of SNAPSHOT plugins. Default = true. |
| |
| * phases - The comma separated list of phases that should be used to find |
| lifecycle plugin bindings. The default value is "clean,deploy,site". |
| |
| * additionalPlugins - A list of additional plugins to enforce have versions. These |
| are plugins that may not be in the poms but are used anyway, like help, eclipse etc. |
| The plugins should be specified in the form: group:artifactId. |
| |
| |
| [] |
| |
| Sample Plugin Configuration (showing some defaults, defaults can be skipped): |
| |
| +---+ |
| <project> |
| [...] |
| <build> |
| <plugins> |
| <plugin> |
| <groupId>org.apache.maven.plugins</groupId> |
| <artifactId>maven-enforcer-plugin</artifactId> |
| <version>1.0</version> |
| <executions> |
| <execution> |
| <id>enforce-no-repos</id> |
| <goals> |
| <goal>enforce</goal> |
| </goals> |
| <configuration> |
| <rules> |
| <requirePluginVersions> |
| <message>Best Practice is to always define plugin versions!</message> |
| <banLatest>true</banLatest> |
| <banRelease>true</banRelease> |
| <banSnapshots>true</banSnapshots> |
| <phases>clean,deploy,site</phases> |
| <additionalPlugins> |
| <additionalPlugin>org.apache.maven.plugins:maven-eclipse-plugin</additionalPlugin> |
| <additionalPlugin>org.apache.maven.plugins:maven-ide-plugin</additionalPlugin> |
| </additionalPlugins> |
| </requirePluginVersions> |
| </rules> |
| </configuration> |
| </execution> |
| </executions> |
| </plugin> |
| </plugins> |
| </build> |
| [...] |
| </project> |
| +---+ |