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