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

« back to all changes in this revision

Viewing changes to enforcer-rules/src/site/apt/requireFilesSize.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
 
  Require File Size
20
 
  ------
21
 
  Brian Fox
22
 
  ------
23
 
  August 2008
24
 
  ------
25
 
 
26
 
Require File Size
27
 
 
28
 
  This rule checks that the specified list of files exist and are within the specified size range.
29
 
 
30
 
 
31
 
   The following parameters are supported by this rule:
32
 
   
33
 
   * message - an optional message to the user if the rule fails.
34
 
   * files - A list of files to check. If this list is empty, the main project artifact will be checked.
35
 
   * maxsize - maximum size in bytes for this file
36
 
   * minsize - minimum size in bytes for this file
37
 
   * allowNulls - If null files should be allowed. If allowed, they will be treated as if they do exist. Default is false.
38
 
   []
39
 
 
40
 
   
41
 
  Sample Plugin Configuration:
42
 
  
43
 
+---+
44
 
<project>
45
 
  [...]
46
 
  <build>
47
 
    <plugins>
48
 
      <plugin>
49
 
        <groupId>org.apache.maven.plugins</groupId>
50
 
        <artifactId>maven-enforcer-plugin</artifactId>
51
 
        <version>1.0</version>
52
 
        <executions>
53
 
          <execution>
54
 
            <id>enforce-file-size</id>
55
 
            <goals>
56
 
              <goal>enforce</goal>
57
 
            </goals>
58
 
            <configuration>
59
 
              <rules>
60
 
                <requireFilesSize>
61
 
                  <maxSize>10000</maxSize>
62
 
                  <minSize>90</minsize>
63
 
                  <files>
64
 
                   <file>${project.outputDirectory}/foo.txt</file>
65
 
                   <file>${project.outputDirectory}/foo2.txt</file>
66
 
                  </files>
67
 
                </requireFilesSize>
68
 
              </rules>
69
 
              <fail>true</fail>
70
 
            </configuration>
71
 
          </execution>
72
 
        </executions>
73
 
      </plugin>
74
 
    </plugins>
75
 
  </build>
76
 
  [...]
77
 
</project>
78
 
+---+