View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  
20  package org.apache.rat.plugin;
21  
22  import org.apache.commons.cli.Option;
23  import org.apache.commons.lang.StringUtils;
24  import org.apache.maven.plugin.AbstractMojo;
25  import org.apache.maven.plugins.annotations.Parameter;
26  import org.apache.rat.commandline.Arg;
27  import org.apache.rat.DeprecationReporter;
28  import org.apache.rat.utils.CasedString;
29  import org.apache.rat.utils.DefaultLog;
30  import org.apache.rat.utils.Log;
31  
32  import java.util.ArrayList;
33  import java.util.Arrays;
34  import java.util.Collections;
35  import java.util.HashMap;
36  import java.util.List;
37  import java.util.Map;
38  import java.util.Objects;
39  import java.util.stream.Collectors;
40  
41  /* DO NOT EDIT - GENERATED FILE */
42  
43  /**
44   * Generated class to provide Maven support for standard RAT command line options
45   */
46  public abstract class BaseRatMojo extends AbstractMojo {
47  
48      private static final Map<String, String> xlateName = new HashMap<>();
49  
50      private static final List<String> unsupportedArgs = new ArrayList<>();
51  
52      private static final Map<String, String> deprecatedArgs = new HashMap<>();
53  
54      static {
55          xlateName.put("addLicense", "add-license");
56          unsupportedArgs.add("help");
57          unsupportedArgs.add("dir");
58          unsupportedArgs.add("log-level");
59          deprecatedArgs.put("copyright", "Use of deprecated option 'copyright'. Deprecated for removal since 0.17: Use <editCopyright> instead.");
60          deprecatedArgs.put("force", "Use of deprecated option 'force'. Deprecated for removal since 0.17: Use <editOverwrite> instead.");
61          deprecatedArgs.put("addLicense", "Use of deprecated option 'addLicense'. Deprecated for removal since 0.17: Use <editLicense> instead.");
62          deprecatedArgs.put("licenses", "Use of deprecated option 'licenses'. Deprecated for removal since 0.17: Use <config> instead.");
63          deprecatedArgs.put("no-default-licenses", "Use of deprecated option 'noDefaultLicenses'. Deprecated for removal since 0.17: Use <configurationNoDefaults> instead.");
64          deprecatedArgs.put("exclude", "Use of deprecated option 'exclude'. Deprecated for removal since 0.17: Use <inputExclude> instead.");
65          deprecatedArgs.put("exclude-file", "Use of deprecated option 'excludeFile'. Deprecated for removal since 0.17: Use <inputExcludeFile> instead.");
66          deprecatedArgs.put("include", "Use of deprecated option 'include'. Deprecated for removal since 0.17: Use <inputInclude> instead.");
67          deprecatedArgs.put("includes-file", "Use of deprecated option 'includesFile'. Deprecated for removal since 0.17: Use <inputIncludeFile> instead.");
68          deprecatedArgs.put("scan-hidden-directories", "Use of deprecated option 'scanHiddenDirectories'. Deprecated for removal since 0.17: Use <inputIncludeStd> with 'HIDDEN_DIR' argument instead.");
69          deprecatedArgs.put("stylesheet", "Use of deprecated option 'stylesheet'. Deprecated for removal since 0.17: Use <outputStyle> instead.");
70          deprecatedArgs.put("xml", "Use of deprecated option 'xml'. Deprecated for removal since 0.17: Use <outputStyle> with the 'xml' argument instead.");
71          deprecatedArgs.put("list-licenses", "Use of deprecated option 'listLicenses'. Deprecated for removal since 0.17: Use <outputLicenses> instead.");
72          deprecatedArgs.put("list-families", "Use of deprecated option 'listFamilies'. Deprecated for removal since 0.17: Use <outputFamilies> instead.");
73          deprecatedArgs.put("out", "Use of deprecated option 'out'. Deprecated for removal since 0.17: Use <outputFile> instead.");
74      }
75  
76      /**
77       * Creates a Maven name from a long option.
78       * Will map excluded long options to null.
79       * @param longOpt the kebab name.
80       * @return The CamelCased name for Maven use.
81       */
82      public static String createName(String longOpt) {
83          String name = xlateName.get(longOpt);
84          return name != null ? name : new CasedString(CasedString.StringCase.KEBAB, longOpt).toCase(CasedString.StringCase.CAMEL);
85      }
86  
87      /**
88       * Creates a kebab case name from a camel case name.
89       * @param camelCase the camel case name to convert.
90       * @return the kebab format.
91       */
92      public static String toKebabForm(String camelCase) {
93          return new CasedString(CasedString.StringCase.CAMEL, camelCase).toCase(CasedString.StringCase.KEBAB);
94      }
95  
96      /**
97       * Returns the list of unsupported args.
98       * @return the list of kebab style names that are unsupported by the Maven UI.
99       */
100     public static List<String> unsupportedArgs() {
101         return Collections.unmodifiableList(unsupportedArgs);
102     }
103     
104     ///////////////////////// Start common Arg manipulation code
105 
106     /**
107      * Sets the deprecation report method.
108      */
109     private static void setDeprecationReporter() {
110         DeprecationReporter.setLogReporter(opt -> {
111             String msg = deprecatedArgs.get(argsKey(opt));
112             if (msg == null) {
113                 DeprecationReporter.getDefault().accept(opt);
114             } else {
115                 DefaultLog.getInstance().warn(msg);
116             }
117         });
118     }
119 
120     private static String argsKey(Option opt) {
121         return StringUtils.defaultIfEmpty(opt.getLongOpt(), opt.getKey());
122     }
123 
124     /**
125      * A map of CLI-based arguments to values.
126      */
127     protected final Map<String, List<String>> args = new HashMap<>();
128 
129     /**
130      * Gets the list of arguments prepared for the CLI code to parse.
131      * @return the List of arguments for the CLI command line.
132      */
133     protected List<String> args() {
134         List<String> result = new ArrayList<>();
135         for (Map.Entry<String, List<String>> entry : args.entrySet()) {
136             result.add("--" + entry.getKey());
137             result.addAll(entry.getValue().stream().filter(Objects::nonNull).collect(Collectors.toList()));
138         }
139         return result;
140     }
141 
142     private boolean validateSet(String key) {
143         Arg arg = Arg.findArg(key);
144         if (arg != null) {
145             Option opt = arg.find(key);
146             Option main = arg.option();
147             if (opt.isDeprecated()) {
148                 args.remove(argsKey(main));
149                 // deprecated options must be explicitly set so let it go.
150                 return true;
151             }
152             // non-deprecated options may have default so ignore it if another option has already been set.
153             for (Option o : arg.group().getOptions()) {
154                 if (!o.equals(main)) {
155                     if (args.containsKey(argsKey(o))) {
156                         return false;
157                     }
158                 }
159             }
160             return true;
161         }
162         return false;
163     }
164 
165     /**
166      * Set a key and value into the argument list.
167      * Replaces any existing value.
168      * @param key the key for the map.
169      * @param value the value to set.
170      */
171     protected void setArg(String key, String value) {
172         if (value == null || StringUtils.isNotBlank(value)) {
173             if (validateSet(key)) {
174                 List<String> values = new ArrayList<>();
175                 if (DefaultLog.getInstance().isEnabled(Log.Level.DEBUG)) {
176                     DefaultLog.getInstance().debug(String.format("Setting %s to '%s'", key, value));
177                 }
178                 values.add(value);
179                 args.put(key, values);
180             }
181         }
182     }
183 
184     /**
185      * Get the list of values for a key.
186      * @param key the key for the map.
187      * @return the list of values for the key or {@code null} if not set.
188      */
189     public List<String> getArg(String key) {
190         return args.get(key);
191     }
192 
193     /**
194      * Add values to the key in the argument list.
195      * empty values are ignored. If no non-empty values are present no change is made.
196      * If the key does not exist, adds it.
197      * @param key the key for the map.
198      * @param value the array of values to set.
199      */
200     protected void addArg(String key, String[] value) {
201         List<String> newValues = Arrays.stream(value).filter(StringUtils::isNotBlank).collect(Collectors.toList());
202         if (!newValues.isEmpty()) {
203             if (validateSet(key)) {
204                 if (DefaultLog.getInstance().isEnabled(Log.Level.DEBUG)) {
205                     DefaultLog.getInstance().debug(String.format("Adding [%s] to %s", String.join(", ", Arrays.asList(value)), key));
206                 }
207                 List<String> values = args.get(key);
208                 if (values == null) {
209                     values = new ArrayList<>();
210                     args.put(key, values);
211                 }
212                 values.addAll(newValues);
213             }
214         }
215     }
216 
217     /**
218      * Add a value to the key in the argument list.
219      * If the key does not exist, adds it.
220      * @param key the key for the map.
221      * @param value the value to set.
222      */
223     protected void addArg(String key, String value) {
224         if (StringUtils.isNotBlank(value)) {
225             if (validateSet(key)) {
226                 List<String> values = args.get(key);
227                 if (DefaultLog.getInstance().isEnabled(Log.Level.DEBUG)) {
228                     DefaultLog.getInstance().debug(String.format("Adding [%s] to %s", String.join(", ", Arrays.asList(value)), key));
229                 }
230                 if (values == null) {
231                     values = new ArrayList<>();
232                     args.put(key, values);
233                 }
234                 values.add(value);
235             }
236         }
237     }
238 
239     /**
240      * Remove a key from the argument list.
241      * @param key the key to remove from the map.
242      */
243     protected void removeArg(String key) {
244         args.remove(key);
245     }
246 
247  ///////////////////////// End common Arg manipulation code
248 
249     protected BaseRatMojo() {
250         setDeprecationReporter();
251     }
252 
253     /*  GENERATED METHODS */
254 
255 
256     /**
257      * The copyright message to use in the license headers. Argument should be a Arg. (See Argument Types for clarification)
258      * @param copyright Copyright message to use in the license headers.
259      * @deprecated Deprecated for removal since 0.17: Use &lt;editCopyright&gt; instead.
260      */
261     @Deprecated
262     @Parameter(property = "rat.Copyright")
263     public void setCopyright(String copyright) {
264         setArg("copyright", copyright);
265     }
266     /**
267      * The copyright message to use in the license headers. Usually in the form of &quot;Copyright 2008 Foo&quot;.  Only valid with &lt;editLicense&gt; Argument should be a Arg. (See Argument Types for clarification)
268      * @param editCopyright Copyright message to use in the license headers.
269      */
270     @Parameter(property = "rat.EditCopyright")
271     public void setEditCopyright(String editCopyright) {
272         setArg("edit-copyright", editCopyright);
273     }
274     /**
275      * Forces any changes in files to be written directly to the source files so that new files are not created.
276      * @param force The state
277      * @deprecated Deprecated for removal since 0.17: Use &lt;editOverwrite&gt; instead.
278      */
279     @Deprecated
280     @Parameter(property = "rat.Force")
281     public void setForce(boolean force) {
282         if (force) {
283             setArg("force", null);
284         } else {
285             removeArg("force");
286         }
287     }
288     /**
289      * Forces any changes in files to be written directly to the source files so that new files are not created. Only valid with &lt;editLicense&gt;.
290      * @param editOverwrite The state
291      */
292     @Parameter(property = "rat.EditOverwrite")
293     public void setEditOverwrite(boolean editOverwrite) {
294         if (editOverwrite) {
295             setArg("edit-overwrite", null);
296         } else {
297             removeArg("edit-overwrite");
298         }
299     }
300     /**
301      * Add the default license header to any file with an unknown license that is not in the exclusion list.
302      * @param addLicense The state
303      * @deprecated Deprecated for removal since 0.17: Use &lt;editLicense&gt; instead.
304      */
305     @Deprecated
306     @Parameter(property = "rat.AddLicense")
307     public void setAddLicense(boolean addLicense) {
308         if (addLicense) {
309             setArg("addLicense", null);
310         } else {
311             removeArg("addLicense");
312         }
313     }
314     /**
315      * Add the default license header to any file with an unknown license that is not in the exclusion list. By default new files will be created with the license header, to force the modification of existing files use the &lt;editOverwrite&gt; option.
316      * @param editLicense The state
317      */
318     @Parameter(property = "rat.EditLicense")
319     public void setEditLicense(boolean editLicense) {
320         if (editLicense) {
321             setArg("edit-license", null);
322         } else {
323             removeArg("edit-license");
324         }
325     }
326     /**
327      * File names for system configuration. Arguments should be File. (See Argument Types for clarification)
328      * @param config Names for system configuration.
329      */
330     @Parameter
331     public void setConfigs(String[] config) {
332         addArg("config", config);
333     }
334     /**
335      * File names for system configuration. Arguments should be File. (See Argument Types for clarification)
336      * @param config Names for system configuration.
337      */
338     @Parameter
339     public void setConfig(String config) {
340         addArg("config", config);
341     }
342     /**
343      * File names for system configuration. Arguments should be File. (See Argument Types for clarification)
344      * @param licenses Names for system configuration.
345      * @deprecated Deprecated for removal since 0.17: Use &lt;config&gt; instead.
346      */
347     @Deprecated
348     @Parameter
349     public void setLicenses(String[] licenses) {
350         addArg("licenses", licenses);
351     }
352     /**
353      * File names for system configuration. Arguments should be File. (See Argument Types for clarification)
354      * @param licenses Names for system configuration.
355      * @deprecated Deprecated for removal since 0.17: Use &lt;config&gt; instead.
356      */
357     @Deprecated
358     @Parameter
359     public void setLicenses(String licenses) {
360         addArg("licenses", licenses);
361     }
362     /**
363      * Ignore default configuration.
364      * @param configurationNoDefaults The state
365      */
366     @Parameter(property = "rat.ConfigurationNoDefaults")
367     public void setConfigurationNoDefaults(boolean configurationNoDefaults) {
368         if (configurationNoDefaults) {
369             setArg("configuration-no-defaults", null);
370         } else {
371             removeArg("configuration-no-defaults");
372         }
373     }
374     /**
375      * Ignore default configuration.
376      * @param noDefaultLicenses The state
377      * @deprecated Deprecated for removal since 0.17: Use &lt;configurationNoDefaults&gt; instead.
378      */
379     @Deprecated
380     @Parameter(property = "rat.NoDefaultLicenses")
381     public void setNoDefaultLicenses(boolean noDefaultLicenses) {
382         if (noDefaultLicenses) {
383             setArg("no-default-licenses", null);
384         } else {
385             removeArg("no-default-licenses");
386         }
387     }
388     /**
389      * A comma separated list of approved License IDs. These licenses will be added to the list of approved licenses. Argument should be a LicenseID. (See Argument Types for clarification)
390      * @param licensesApproved Comma separated list of approved License IDs.
391      */
392     @Parameter(property = "rat.LicensesApproved")
393     public void setLicensesApproved(String licensesApproved) {
394         setArg("licenses-approved", licensesApproved);
395     }
396     /**
397      * Name of file containing comma separated lists of approved License IDs. Argument should be a File. (See Argument Types for clarification)
398      * @param licensesApprovedFile Of file containing comma separated lists of approved License IDs.
399      */
400     @Parameter(property = "rat.LicensesApprovedFile")
401     public void setLicensesApprovedFile(String licensesApprovedFile) {
402         setArg("licenses-approved-file", licensesApprovedFile);
403     }
404     /**
405      * A comma separated list of approved license family IDs. These license families will be added to the list of approved license families. Argument should be a FamilyID. (See Argument Types for clarification)
406      * @param licenseFamiliesApproved Comma separated list of approved license family IDs.
407      */
408     @Parameter(property = "rat.LicenseFamiliesApproved")
409     public void setLicenseFamiliesApproved(String licenseFamiliesApproved) {
410         setArg("license-families-approved", licenseFamiliesApproved);
411     }
412     /**
413      * Name of file containing comma separated lists of approved family IDs. Argument should be a File. (See Argument Types for clarification)
414      * @param licenseFamiliesApprovedFile Of file containing comma separated lists of approved family IDs.
415      */
416     @Parameter(property = "rat.LicenseFamiliesApprovedFile")
417     public void setLicenseFamiliesApprovedFile(String licenseFamiliesApprovedFile) {
418         setArg("license-families-approved-file", licenseFamiliesApprovedFile);
419     }
420     /**
421      * A comma separated list of denied License IDs. These licenses will be removed from the list of approved licenses. Once licenses are removed they can not be added back. Argument should be a LicenseID. (See Argument Types for clarification)
422      * @param licensesDenied Comma separated list of denied License IDs.
423      */
424     @Parameter(property = "rat.LicensesDenied")
425     public void setLicensesDenied(String licensesDenied) {
426         setArg("licenses-denied", licensesDenied);
427     }
428     /**
429      * Name of file containing comma separated lists of the denied license IDs. These licenses will be removed from the list of approved licenses. Once licenses are removed they can not be added back. Argument should be a File. (See Argument Types for clarification)
430      * @param licensesDeniedFile Of file containing comma separated lists of the denied license IDs.
431      */
432     @Parameter(property = "rat.LicensesDeniedFile")
433     public void setLicensesDeniedFile(String licensesDeniedFile) {
434         setArg("licenses-denied-file", licensesDeniedFile);
435     }
436     /**
437      * A comma separated list of denied License family IDs. These license families will be removed from the list of approved licenses. Once license families are removed they can not be added back. Argument should be a FamilyID. (See Argument Types for clarification)
438      * @param licenseFamiliesDenied Comma separated list of denied License family IDs.
439      */
440     @Parameter(property = "rat.LicenseFamiliesDenied")
441     public void setLicenseFamiliesDenied(String licenseFamiliesDenied) {
442         setArg("license-families-denied", licenseFamiliesDenied);
443     }
444     /**
445      * Name of file containing comma separated lists of denied license IDs. These license families will be removed from the list of approved licenses. Once license families are removed they can not be added back. Argument should be a File. (See Argument Types for clarification)
446      * @param licenseFamiliesDeniedFile Of file containing comma separated lists of denied license IDs.
447      */
448     @Parameter(property = "rat.LicenseFamiliesDeniedFile")
449     public void setLicenseFamiliesDeniedFile(String licenseFamiliesDeniedFile) {
450         setArg("license-families-denied-file", licenseFamiliesDeniedFile);
451     }
452     /**
453      * The acceptable maximum number for the specified counter. A value of '-1' specifies an unlimited number. Arguments should be CounterPattern. (See Argument Types for clarification)
454      * @param counterMax Acceptable maximum number for the specified counter.
455      */
456     @Parameter
457     public void setCounterMaxs(String[] counterMax) {
458         addArg("counter-max", counterMax);
459     }
460     /**
461      * The acceptable maximum number for the specified counter. A value of '-1' specifies an unlimited number. Arguments should be CounterPattern. (See Argument Types for clarification)
462      * @param counterMax Acceptable maximum number for the specified counter.
463      */
464     @Parameter
465     public void setCounterMax(String counterMax) {
466         addArg("counter-max", counterMax);
467     }
468     /**
469      * The minimum number for the specified counter. Arguments should be CounterPattern. (See Argument Types for clarification)
470      * @param counterMin Minimum number for the specified counter.
471      */
472     @Parameter
473     public void setCounterMins(String[] counterMin) {
474         addArg("counter-min", counterMin);
475     }
476     /**
477      * The minimum number for the specified counter. Arguments should be CounterPattern. (See Argument Types for clarification)
478      * @param counterMin Minimum number for the specified counter.
479      */
480     @Parameter
481     public void setCounterMin(String counterMin) {
482         addArg("counter-min", counterMin);
483     }
484     /**
485      * A file containing file names to process. File names must use linux directory separator ('/') or none at all. File names that do not start with '/' are relative to the directory where the argument is located. Arguments should be File. (See Argument Types for clarification)
486      * @param inputSource File containing file names to process.
487      */
488     @Parameter
489     public void setInputSources(String[] inputSource) {
490         addArg("input-source", inputSource);
491     }
492     /**
493      * A file containing file names to process. File names must use linux directory separator ('/') or none at all. File names that do not start with '/' are relative to the directory where the argument is located. Arguments should be File. (See Argument Types for clarification)
494      * @param inputSource File containing file names to process.
495      */
496     @Parameter
497     public void setInputSource(String inputSource) {
498         addArg("input-source", inputSource);
499     }
500     /**
501      * Excludes files matching &lt;Expression&gt;. Arguments should be Expression. (See Argument Types for clarification)
502      * @param exclude Files matching &lt;Expression&gt;.
503      * @deprecated Deprecated for removal since 0.17: Use &lt;inputExclude&gt; instead.
504      */
505     @Deprecated
506     @Parameter
507     public void setExcludes(String[] exclude) {
508         addArg("exclude", exclude);
509     }
510     /**
511      * Excludes files matching &lt;Expression&gt;. Arguments should be Expression. (See Argument Types for clarification)
512      * @param exclude Files matching &lt;Expression&gt;.
513      * @deprecated Deprecated for removal since 0.17: Use &lt;inputExclude&gt; instead.
514      */
515     @Deprecated
516     @Parameter
517     public void setExclude(String exclude) {
518         addArg("exclude", exclude);
519     }
520     /**
521      * Excludes files matching &lt;Expression&gt;. Arguments should be Expression. (See Argument Types for clarification)
522      * @param inputExclude Files matching &lt;Expression&gt;.
523      */
524     @Parameter
525     public void setInputExcludes(String[] inputExclude) {
526         addArg("input-exclude", inputExclude);
527     }
528     /**
529      * Excludes files matching &lt;Expression&gt;. Arguments should be Expression. (See Argument Types for clarification)
530      * @param inputExclude Files matching &lt;Expression&gt;.
531      */
532     @Parameter
533     public void setInputExclude(String inputExclude) {
534         addArg("input-exclude", inputExclude);
535     }
536     /**
537      * Reads &lt;Expression&gt; entries from a file. Entries will be excluded from processing. Argument should be a File. (See Argument Types for clarification)
538      * @param excludeFile &lt;Expression&gt; entries from a file.
539      * @deprecated Deprecated for removal since 0.17: Use &lt;inputExcludeFile&gt; instead.
540      */
541     @Deprecated
542     @Parameter(property = "rat.ExcludeFile")
543     public void setExcludeFile(String excludeFile) {
544         setArg("exclude-file", excludeFile);
545     }
546     /**
547      * Reads &lt;Expression&gt; entries from a file. Entries will be excluded from processing. Argument should be a File. (See Argument Types for clarification)
548      * @param inputExcludeFile &lt;Expression&gt; entries from a file.
549      */
550     @Parameter(property = "rat.InputExcludeFile")
551     public void setInputExcludeFile(String inputExcludeFile) {
552         setArg("input-exclude-file", inputExcludeFile);
553     }
554     /**
555      * Excludes files defined in standard collections based on commonly occurring groups. Arguments should be StandardCollection. (See Argument Types for clarification)
556      * @param inputExcludeStd Files defined in standard collections based on commonly occurring groups.
557      */
558     @Parameter
559     public void setInputExcludeStds(String[] inputExcludeStd) {
560         addArg("input-exclude-std", inputExcludeStd);
561     }
562     /**
563      * Excludes files defined in standard collections based on commonly occurring groups. Arguments should be StandardCollection. (See Argument Types for clarification)
564      * @param inputExcludeStd Files defined in standard collections based on commonly occurring groups.
565      */
566     @Parameter
567     public void setInputExcludeStd(String inputExcludeStd) {
568         addArg("input-exclude-std", inputExcludeStd);
569     }
570     /**
571      * Excludes files with sizes less than the given argument. Argument should be a Integer. (See Argument Types for clarification)
572      * @param inputExcludeSize Files with sizes less than the given argument.
573      */
574     @Parameter(property = "rat.InputExcludeSize")
575     public void setInputExcludeSize(String inputExcludeSize) {
576         setArg("input-exclude-size", inputExcludeSize);
577     }
578     /**
579      * Includes files matching &lt;Expression&gt;. Will override excluded files. Arguments should be Expression. (See Argument Types for clarification)
580      * @param inputInclude Files matching &lt;Expression&gt;.
581      */
582     @Parameter
583     public void setInputIncludes(String[] inputInclude) {
584         addArg("input-include", inputInclude);
585     }
586     /**
587      * Includes files matching &lt;Expression&gt;. Will override excluded files. Arguments should be Expression. (See Argument Types for clarification)
588      * @param inputInclude Files matching &lt;Expression&gt;.
589      */
590     @Parameter
591     public void setInputInclude(String inputInclude) {
592         addArg("input-include", inputInclude);
593     }
594     /**
595      * Includes files matching &lt;Expression&gt;. Will override excluded files. Arguments should be Expression. (See Argument Types for clarification)
596      * @param include Files matching &lt;Expression&gt;.
597      * @deprecated Deprecated for removal since 0.17: Use &lt;inputInclude&gt; instead.
598      */
599     @Deprecated
600     @Parameter
601     public void setIncludes(String[] include) {
602         addArg("include", include);
603     }
604     /**
605      * Includes files matching &lt;Expression&gt;. Will override excluded files. Arguments should be Expression. (See Argument Types for clarification)
606      * @param include Files matching &lt;Expression&gt;.
607      * @deprecated Deprecated for removal since 0.17: Use &lt;inputInclude&gt; instead.
608      */
609     @Deprecated
610     @Parameter
611     public void setInclude(String include) {
612         addArg("include", include);
613     }
614     /**
615      * Reads &lt;Expression&gt; entries from a file. Entries will override excluded files. Argument should be a File. (See Argument Types for clarification)
616      * @param inputIncludeFile &lt;Expression&gt; entries from a file.
617      */
618     @Parameter(property = "rat.InputIncludeFile")
619     public void setInputIncludeFile(String inputIncludeFile) {
620         setArg("input-include-file", inputIncludeFile);
621     }
622     /**
623      * Reads &lt;Expression&gt; entries from a file. Entries will be excluded from processing. Argument should be a File. (See Argument Types for clarification)
624      * @param includesFile &lt;Expression&gt; entries from a file.
625      * @deprecated Deprecated for removal since 0.17: Use &lt;inputIncludeFile&gt; instead.
626      */
627     @Deprecated
628     @Parameter(property = "rat.IncludesFile")
629     public void setIncludesFile(String includesFile) {
630         setArg("includes-file", includesFile);
631     }
632     /**
633      * Includes files defined in standard collections based on commonly occurring groups. Will override excluded files. Arguments should be StandardCollection. (See Argument Types for clarification)
634      * @param inputIncludeStd Files defined in standard collections based on commonly occurring groups.
635      */
636     @Parameter
637     public void setInputIncludeStds(String[] inputIncludeStd) {
638         addArg("input-include-std", inputIncludeStd);
639     }
640     /**
641      * Includes files defined in standard collections based on commonly occurring groups. Will override excluded files. Arguments should be StandardCollection. (See Argument Types for clarification)
642      * @param inputIncludeStd Files defined in standard collections based on commonly occurring groups.
643      */
644     @Parameter
645     public void setInputIncludeStd(String inputIncludeStd) {
646         addArg("input-include-std", inputIncludeStd);
647     }
648     /**
649      * Scans hidden directories.
650      * @param scanHiddenDirectories The state
651      * @deprecated Deprecated for removal since 0.17: Use &lt;inputIncludeStd&gt; with 'HIDDEN_DIR' argument instead.
652      */
653     @Deprecated
654     @Parameter(property = "rat.ScanHiddenDirectories")
655     public void setScanHiddenDirectories(boolean scanHiddenDirectories) {
656         if (scanHiddenDirectories) {
657             setArg("scan-hidden-directories", null);
658         } else {
659             removeArg("scan-hidden-directories");
660         }
661     }
662     /**
663      * Parse SCM based exclusion files to exclude specified files and directories. Arguments should be StandardCollection. (See Argument Types for clarification)
664      * @param inputExcludeParsedScm SCM based exclusion files to exclude specified files and directories.
665      */
666     @Parameter
667     public void setInputExcludeParsedScms(String[] inputExcludeParsedScm) {
668         addArg("input-exclude-parsed-scm", inputExcludeParsedScm);
669     }
670     /**
671      * Parse SCM based exclusion files to exclude specified files and directories. Arguments should be StandardCollection. (See Argument Types for clarification)
672      * @param inputExcludeParsedScm SCM based exclusion files to exclude specified files and directories.
673      */
674     @Parameter
675     public void setInputExcludeParsedScm(String inputExcludeParsedScm) {
676         addArg("input-exclude-parsed-scm", inputExcludeParsedScm);
677     }
678     /**
679      * XSLT stylesheet to use when creating the report. Either an external xsl file may be specified or one of the internal named sheets. Argument should be a StyleSheet. (See Argument Types for clarification)
680      * @param outputStyle Stylesheet to use when creating the report.
681      */
682     @Parameter(property = "rat.OutputStyle")
683     public void setOutputStyle(String outputStyle) {
684         setArg("output-style", outputStyle);
685     }
686     /**
687      * XSLT stylesheet to use when creating the report. Argument should be a StyleSheet. (See Argument Types for clarification)
688      * @param stylesheet Stylesheet to use when creating the report.
689      * @deprecated Deprecated for removal since 0.17: Use &lt;outputStyle&gt; instead.
690      */
691     @Deprecated
692     @Parameter(property = "rat.Stylesheet")
693     public void setStylesheet(String stylesheet) {
694         setArg("stylesheet", stylesheet);
695     }
696     /**
697      * forces XML output rather than the textual report.
698      * @param xml The state
699      * @deprecated Deprecated for removal since 0.17: Use &lt;outputStyle&gt; with the 'xml' argument instead.
700      */
701     @Deprecated
702     @Parameter(property = "rat.Xml")
703     public void setXml(boolean xml) {
704         if (xml) {
705             setArg("xml", null);
706         } else {
707             removeArg("xml");
708         }
709     }
710     /**
711      * List the defined licenses. Argument should be a LicenseFilter. (See Argument Types for clarification)
712      * @param outputLicenses The defined licenses.
713      */
714     @Parameter(property = "rat.OutputLicenses", defaultValue = "NONE")
715     public void setOutputLicenses(String outputLicenses) {
716         setArg("output-licenses", outputLicenses);
717     }
718     /**
719      * List the defined licenses. Argument should be a LicenseFilter. (See Argument Types for clarification)
720      * @param listLicenses The defined licenses.
721      * @deprecated Deprecated for removal since 0.17: Use &lt;outputLicenses&gt; instead.
722      */
723     @Deprecated
724     @Parameter(property = "rat.ListLicenses")
725     public void setListLicenses(String listLicenses) {
726         setArg("list-licenses", listLicenses);
727     }
728     /**
729      * List the defined license families. Argument should be a LicenseFilter. (See Argument Types for clarification)
730      * @param outputFamilies The defined license families.
731      */
732     @Parameter(property = "rat.OutputFamilies", defaultValue = "NONE")
733     public void setOutputFamilies(String outputFamilies) {
734         setArg("output-families", outputFamilies);
735     }
736     /**
737      * List the defined license families. Argument should be a LicenseFilter. (See Argument Types for clarification)
738      * @param listFamilies The defined license families.
739      * @deprecated Deprecated for removal since 0.17: Use &lt;outputFamilies&gt; instead.
740      */
741     @Deprecated
742     @Parameter(property = "rat.ListFamilies")
743     public void setListFamilies(String listFamilies) {
744         setArg("list-families", listFamilies);
745     }
746     /**
747      * If set do not update the files but generate the reports.
748      * @param dryRun The state
749      */
750     @Parameter(property = "rat.DryRun")
751     public void setDryRun(boolean dryRun) {
752         if (dryRun) {
753             setArg("dry-run", null);
754         } else {
755             removeArg("dry-run");
756         }
757     }
758     /**
759      * Define the output file where to write a report to. Argument should be a File. (See Argument Types for clarification)
760      * @param out The output file where to write a report to.
761      * @deprecated Deprecated for removal since 0.17: Use &lt;outputFile&gt; instead.
762      */
763     @Deprecated
764     @Parameter(property = "rat.Out")
765     public void setOut(String out) {
766         setArg("out", out);
767     }
768     /**
769      * Define the output file where to write a report to. Argument should be a File. (See Argument Types for clarification)
770      * @param outputFile The output file where to write a report to.
771      */
772     @Parameter(property = "rat.OutputFile", defaultValue = "${project.build.directory}/rat.txt")
773     public void setOutputFile(String outputFile) {
774         setArg("output-file", outputFile);
775     }
776     /**
777      * Specifies the level of detail in ARCHIVE file reporting. Argument should be a ProcessingType. (See Argument Types for clarification)
778      * @param outputArchive The level of detail in ARCHIVE file reporting.
779      */
780     @Parameter(property = "rat.OutputArchive", defaultValue = "NOTIFICATION")
781     public void setOutputArchive(String outputArchive) {
782         setArg("output-archive", outputArchive);
783     }
784     /**
785      * Specifies the level of detail in STANDARD file reporting. Argument should be a ProcessingType. (See Argument Types for clarification)
786      * @param outputStandard The level of detail in STANDARD file reporting.
787      */
788     @Parameter(property = "rat.OutputStandard", defaultValue = "ABSENCE")
789     public void setOutputStandard(String outputStandard) {
790         setArg("output-standard", outputStandard);
791     }
792     /**
793      * Print information about registered licenses.
794      * @param helpLicenses The state
795      */
796     @Parameter(property = "rat.HelpLicenses")
797     public void setHelpLicenses(boolean helpLicenses) {
798         if (helpLicenses) {
799             setArg("help-licenses", null);
800         } else {
801             removeArg("help-licenses");
802         }
803     }
804 }