~ubuntu-branches/ubuntu/utopic/maven-enforcer/utopic

« back to all changes in this revision

Viewing changes to maven-enforcer-plugin/src/site/apt/usage.apt

  • Committer: Package Import Robot
  • Author(s): Torsten Werner
  • Date: 2011-09-12 22:30:16 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: package-import@ubuntu.com-20110912223016-e2pk04avoq8bur7t
Tags: 1.0-1
* Team upload
* New upstream release.
* Add more Build-Depends.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
~~ Licensed to the Apache Software Foundation (ASF) under one
2
 
~~ or more contributor license agreements.  See the NOTICE file
3
 
~~ distributed with this work for additional information
4
 
~~ regarding copyright ownership.  The ASF licenses this file
5
 
~~ to you under the Apache License, Version 2.0 (the
6
 
~~ "License"); you may not use this file except in compliance
7
 
~~ with the License.  You may obtain a copy of the License at
8
 
~~
9
 
~~ http://www.apache.org/licenses/LICENSE-2.0
10
 
~~
11
 
~~ Unless required by applicable law or agreed to in writing,
12
 
~~ software distributed under the License is distributed on an
13
 
~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
 
~~ KIND, either express or implied.  See the License for the
15
 
~~ specific language governing permissions and limitations
16
 
~~ under the License.    
17
 
 
18
 
  ------
19
 
  Usage
20
 
  ------
21
 
  Brian Fox
22
 
  ------
23
 
  Mar 2007
24
 
  ------
25
 
 
26
 
Usage
27
 
 
28
 
  Brief examples on how to use the enforcer goals.
29
 
 
30
 
* Generic Plugin configuration information
31
 
 
32
 
  See the following links for information about including and configuring plugins in your project:
33
 
  
34
 
  *{{{http://maven.apache.org/guides/mini/guide-configuring-plugins.html}Configuring Plugins}}
35
 
  
36
 
  *{{{http://maven.apache.org/guides/plugin/guide-java-plugin-development.html}Plugin Development}}
37
 
 
38
 
  *{{{http://maven.apache.org/guides/introduction/introduction-to-plugin-prefix-mapping.html}Plugin Prefix}}
39
 
  
40
 
  []
41
 
 
42
 
* The <<<enforcer:enforce>>> and <<<enforcer:enforce-once>>> mojos
43
 
 
44
 
   These goals are meant to be bound to a lifecycle phase and configured in your
45
 
   <<<pom.xml>>>. The enforcers execute the configured rules to check for certain constraints. 
46
 
   The available standard rules are described {{{rules/index.html}here}}. Besides the rules to execute, these goals support three options:
47
 
   
48
 
   * {{{enforce-mojo.html#skip}skip}} - a quick way to skip checks via a profile or using <<<-Denforcer.skip=true>>> from the command line.
49
 
   
50
 
   * {{{enforce-mojo.html#fail}fail}} - if the goal should fail the build when a rule fails. The default is <<<true>>>. If false, the errors will be logged as warnings.
51
 
   
52
 
   * {{{enforce-mojo.html#failFast}failFast}} - if the goal should stop checking after the first failure. The default is <<<false>>>.
53
 
   
54
 
   []
55
 
   
56
 
   Each rule to be executed should be added to the rules element along with the specific configuration for that rule.
57
 
   
58
 
   The <<<enforce>>> goal executes against each project in a multi-project build. The <<<enforce-once>>> goal executes
59
 
   just once per build. This is most effective for the standard rules because the Maven, Java and OS versions will not change between projects in the same build.
60
 
   
61
 
   
62
 
   Sample Plugin Configuration:
63
 
   
64
 
+---+
65
 
<project>
66
 
  [...]
67
 
  <build>
68
 
   <plugins>
69
 
     <plugin>
70
 
        <groupId>org.apache.maven.plugins</groupId>
71
 
        <artifactId>maven-enforcer-plugin</artifactId>
72
 
        <executions>
73
 
          <execution>
74
 
            <id>enforce-versions</id>
75
 
            <goals>
76
 
              <goal>enforce</goal>
77
 
            </goals>
78
 
            <configuration>
79
 
              <rules>
80
 
                <requireMavenVersion>
81
 
                  <version>2.0.6</version>
82
 
                </requireMavenVersion>
83
 
                <requireJavaVersion>
84
 
                  <version>1.5</version>
85
 
                </requireJavaVersion>
86
 
                <requireOS>
87
 
                  <family>unix</family>
88
 
                </requireOS>            
89
 
              </rules>
90
 
            </configuration>
91
 
          </execution>
92
 
        </executions>
93
 
      </plugin>
94
 
    </plugins>
95
 
  </build>
96
 
  [...]
97
 
</project>
98
 
+---+
99
 
  
100
 
* The <<<enforcer:display-info>>> mojo
101
 
 
102
 
   This goal is used to determine the current information as detected by the standard rules:
103
 
     
104
 
+---+
105
 
   mvn enforcer:display-info
106
 
   ...
107
 
   [enforcer:display-info]
108
 
       Maven Version: 2.0.6
109
 
       JDK Version: 1.5.0_11 normalized as: 1.5.0-11
110
 
       OS Info: Arch: x86 Family: windows Name: windows xp Version: 5.1
111
 
+---+
112
 
  
 
 
b'\\ No newline at end of file'