| <?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang=""><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../jacoco-resources/report.css" type="text/css"/><link rel="shortcut icon" href="../jacoco-resources/report.gif" type="image/gif"/><title>BaseRatMojo.java</title><link rel="stylesheet" href="../jacoco-resources/prettify.css" type="text/css"/><script type="text/javascript" src="../jacoco-resources/prettify.js"></script></head><body onload="window['PR_TAB_WIDTH']=4;prettyPrint()"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="../jacoco-sessions.html" class="el_session">Sessions</a></span><a href="../index.html" class="el_report">Apache Creadur RAT::Plugin4Maven</a> > <a href="index.source.html" class="el_package">org.apache.rat.plugin</a> > <span class="el_source">BaseRatMojo.java</span></div><h1>BaseRatMojo.java</h1><pre class="source lang-java linenums">/* |
| * 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. |
| */ |
| |
| package org.apache.rat.plugin; |
| |
| import org.apache.commons.cli.Option; |
| import org.apache.commons.lang3.StringUtils; |
| import org.apache.maven.plugin.AbstractMojo; |
| import org.apache.maven.plugins.annotations.Parameter; |
| import org.apache.rat.commandline.Arg; |
| import org.apache.rat.DeprecationReporter; |
| import org.apache.rat.utils.CasedString; |
| import org.apache.rat.utils.DefaultLog; |
| import org.apache.rat.utils.Log; |
| |
| import java.util.ArrayList; |
| import java.util.Arrays; |
| import java.util.Collections; |
| import java.util.HashMap; |
| import java.util.List; |
| import java.util.Map; |
| import java.util.Objects; |
| import java.util.stream.Collectors; |
| |
| /** |
| * Generated class to provide Maven support for standard RAT command line options |
| * DO NOT EDIT - GENERATED FILE |
| */ |
| public abstract class BaseRatMojo extends AbstractMojo { |
| |
| <span class="fc" id="L47"> private static final Map<String, String> xlateName = new HashMap<>();</span> |
| |
| <span class="fc" id="L49"> private static final List<String> unsupportedArgs = new ArrayList<>();</span> |
| |
| <span class="fc" id="L51"> private static final Map<String, String> deprecatedArgs = new HashMap<>();</span> |
| |
| static { |
| <span class="fc" id="L54"> xlateName.put("addLicense", "add-license");</span> |
| <span class="fc" id="L55"> unsupportedArgs.add("help");</span> |
| <span class="fc" id="L56"> unsupportedArgs.add("dir");</span> |
| <span class="fc" id="L57"> unsupportedArgs.add("log-level");</span> |
| <span class="fc" id="L58"> deprecatedArgs.put("copyright", "Use of deprecated option 'copyright'. Deprecated for removal since 0.17: Use <editCopyright> instead.");</span> |
| <span class="fc" id="L59"> deprecatedArgs.put("force", "Use of deprecated option 'force'. Deprecated for removal since 0.17: Use <editOverwrite> instead.");</span> |
| <span class="fc" id="L60"> deprecatedArgs.put("addLicense", "Use of deprecated option 'addLicense'. Deprecated for removal since 0.17: Use <editLicense> instead.");</span> |
| <span class="fc" id="L61"> deprecatedArgs.put("licenses", "Use of deprecated option 'licenses'. Deprecated for removal since 0.17: Use <config> instead.");</span> |
| <span class="fc" id="L62"> deprecatedArgs.put("no-default-licenses", "Use of deprecated option 'noDefaultLicenses'. Deprecated for removal since 0.17: Use <configurationNoDefaults> instead.");</span> |
| <span class="fc" id="L63"> deprecatedArgs.put("exclude", "Use of deprecated option 'exclude'. Deprecated for removal since 0.17: Use <inputExclude> instead.");</span> |
| <span class="fc" id="L64"> deprecatedArgs.put("exclude-file", "Use of deprecated option 'excludeFile'. Deprecated for removal since 0.17: Use <inputExcludeFile> instead.");</span> |
| <span class="fc" id="L65"> deprecatedArgs.put("include", "Use of deprecated option 'include'. Deprecated for removal since 0.17: Use <inputInclude> instead.");</span> |
| <span class="fc" id="L66"> deprecatedArgs.put("includes-file", "Use of deprecated option 'includesFile'. Deprecated for removal since 0.17: Use <inputIncludeFile> instead.");</span> |
| <span class="fc" id="L67"> deprecatedArgs.put("scan-hidden-directories", "Use of deprecated option 'scanHiddenDirectories'. Deprecated for removal since 0.17: Use <inputIncludeStd> with 'HIDDEN_DIR' argument instead.");</span> |
| <span class="fc" id="L68"> deprecatedArgs.put("stylesheet", "Use of deprecated option 'stylesheet'. Deprecated for removal since 0.17: Use <outputStyle> instead.");</span> |
| <span class="fc" id="L69"> deprecatedArgs.put("xml", "Use of deprecated option 'xml'. Deprecated for removal since 0.17: Use <outputStyle> with the 'xml' argument instead.");</span> |
| <span class="fc" id="L70"> deprecatedArgs.put("list-licenses", "Use of deprecated option 'listLicenses'. Deprecated for removal since 0.17: Use <outputLicenses> instead.");</span> |
| <span class="fc" id="L71"> deprecatedArgs.put("list-families", "Use of deprecated option 'listFamilies'. Deprecated for removal since 0.17: Use <outputFamilies> instead.");</span> |
| <span class="fc" id="L72"> deprecatedArgs.put("out", "Use of deprecated option 'out'. Deprecated for removal since 0.17: Use <outputFile> instead.");</span> |
| <span class="fc" id="L73"> }</span> |
| |
| /** |
| * Creates a Maven name from a long option. |
| * Will map excluded long options to null. |
| * @param longOpt the kebab name. |
| * @return The CamelCased name for Maven use. |
| */ |
| public static String createName(String longOpt) { |
| <span class="fc" id="L82"> String name = xlateName.get(longOpt);</span> |
| <span class="fc bfc" id="L83" title="All 2 branches covered."> return name != null ? name : new CasedString(CasedString.StringCase.KEBAB, longOpt).toCase(CasedString.StringCase.CAMEL);</span> |
| } |
| |
| /** |
| * Creates a kebab case name from a camel case name. |
| * @param camelCase the camel case name to convert. |
| * @return the kebab format. |
| */ |
| public static String toKebabForm(String camelCase) { |
| <span class="nc" id="L92"> return new CasedString(CasedString.StringCase.CAMEL, camelCase).toCase(CasedString.StringCase.KEBAB);</span> |
| } |
| |
| /** |
| * Returns the list of unsupported args. |
| * @return the list of kebab style names that are unsupported by the Maven UI. |
| */ |
| public static List<String> unsupportedArgs() { |
| <span class="fc" id="L100"> return Collections.unmodifiableList(unsupportedArgs);</span> |
| } |
| |
| ///////////////////////// Start common Arg manipulation code |
| |
| /** |
| * Sets the deprecation report method. |
| */ |
| private static void setDeprecationReporter() { |
| <span class="fc" id="L109"> DeprecationReporter.setLogReporter(opt -> {</span> |
| <span class="fc" id="L110"> String msg = deprecatedArgs.get(argsKey(opt));</span> |
| <span class="pc bpc" id="L111" title="1 of 2 branches missed."> if (msg == null) {</span> |
| <span class="nc" id="L112"> DeprecationReporter.getDefault().accept(opt);</span> |
| } else { |
| <span class="fc" id="L114"> DefaultLog.getInstance().warn(msg);</span> |
| } |
| <span class="fc" id="L116"> });</span> |
| <span class="fc" id="L117"> }</span> |
| |
| private static String argsKey(Option opt) { |
| <span class="fc" id="L120"> return StringUtils.defaultIfEmpty(opt.getLongOpt(), opt.getKey());</span> |
| } |
| |
| /** |
| * A map of CLI-based arguments to values. |
| */ |
| <span class="fc" id="L126"> protected final Map<String, List<String>> args = new HashMap<>();</span> |
| |
| /** |
| * Gets the list of arguments prepared for the CLI code to parse. |
| * @return the List of arguments for the CLI command line. |
| */ |
| protected List<String> args() { |
| <span class="fc" id="L133"> List<String> result = new ArrayList<>();</span> |
| <span class="fc bfc" id="L134" title="All 2 branches covered."> for (Map.Entry<String, List<String>> entry : args.entrySet()) {</span> |
| <span class="fc" id="L135"> result.add("--" + entry.getKey());</span> |
| <span class="fc" id="L136"> result.addAll(entry.getValue().stream().filter(Objects::nonNull).toList());</span> |
| <span class="fc" id="L137"> }</span> |
| <span class="fc" id="L138"> return result;</span> |
| } |
| |
| private boolean validateSet(String key) { |
| <span class="fc" id="L142"> Arg arg = Arg.findArg(key);</span> |
| <span class="pc bpc" id="L143" title="1 of 2 branches missed."> if (arg != null) {</span> |
| <span class="fc" id="L144"> Option opt = arg.find(key);</span> |
| <span class="fc" id="L145"> Option main = arg.option();</span> |
| <span class="fc bfc" id="L146" title="All 2 branches covered."> if (opt.isDeprecated()) {</span> |
| <span class="fc" id="L147"> args.remove(argsKey(main));</span> |
| // deprecated options must be explicitly set so let it go. |
| <span class="fc" id="L149"> return true;</span> |
| } |
| // non-deprecated options may have default so ignore it if another option has already been set. |
| <span class="fc bfc" id="L152" title="All 2 branches covered."> for (Option o : arg.group().getOptions()) {</span> |
| <span class="fc bfc" id="L153" title="All 2 branches covered."> if (!o.equals(main)) {</span> |
| <span class="fc bfc" id="L154" title="All 2 branches covered."> if (args.containsKey(argsKey(o))) {</span> |
| <span class="fc" id="L155"> return false;</span> |
| } |
| } |
| <span class="fc" id="L158"> }</span> |
| <span class="fc" id="L159"> return true;</span> |
| } |
| <span class="nc" id="L161"> return false;</span> |
| } |
| |
| /** |
| * Set a key and value into the argument list. |
| * Replaces any existing value. |
| * @param key the key for the map. |
| * @param value the value to set. |
| */ |
| protected void setArg(String key, String value) { |
| <span class="pc bpc" id="L171" title="1 of 4 branches missed."> if (value == null || StringUtils.isNotBlank(value)) {</span> |
| <span class="fc bfc" id="L172" title="All 2 branches covered."> if (validateSet(key)) {</span> |
| <span class="fc" id="L173"> List<String> values = new ArrayList<>();</span> |
| <span class="pc bpc" id="L174" title="1 of 2 branches missed."> if (DefaultLog.getInstance().isEnabled(Log.Level.DEBUG)) {</span> |
| <span class="nc" id="L175"> DefaultLog.getInstance().debug(String.format("Setting %s to '%s'", key, value));</span> |
| } |
| <span class="fc" id="L177"> values.add(value);</span> |
| <span class="fc" id="L178"> args.put(key, values);</span> |
| } |
| } |
| <span class="fc" id="L181"> }</span> |
| |
| /** |
| * Get the list of values for a key. |
| * @param key the key for the map. |
| * @return the list of values for the key or {@code null} if not set. |
| */ |
| public List<String> getArg(String key) { |
| <span class="fc" id="L189"> return args.get(key);</span> |
| } |
| |
| /** |
| * Add values to the key in the argument list. |
| * empty values are ignored. If no non-empty values are present no change is made. |
| * If the key does not exist, adds it. |
| * @param key the key for the map. |
| * @param value the array of values to set. |
| */ |
| protected void addArg(String key, String[] value) { |
| <span class="fc" id="L200"> List<String> newValues = Arrays.stream(value).filter(StringUtils::isNotBlank).toList();</span> |
| <span class="fc bfc" id="L201" title="All 2 branches covered."> if (!newValues.isEmpty()) {</span> |
| <span class="pc bpc" id="L202" title="1 of 2 branches missed."> if (validateSet(key)) {</span> |
| <span class="pc bpc" id="L203" title="1 of 2 branches missed."> if (DefaultLog.getInstance().isEnabled(Log.Level.DEBUG)) {</span> |
| <span class="nc" id="L204"> DefaultLog.getInstance().debug(String.format("Adding [%s] to %s", String.join(", ", Arrays.asList(value)), key));</span> |
| } |
| <span class="fc" id="L206"> List<String> values = args.computeIfAbsent(key, k -> new ArrayList<>());</span> |
| <span class="fc" id="L207"> values.addAll(newValues);</span> |
| } |
| } |
| <span class="fc" id="L210"> }</span> |
| |
| /** |
| * Add a value to the key in the argument list. |
| * If the key does not exist, adds it. |
| * @param key the key for the map. |
| * @param value the value to set. |
| */ |
| protected void addArg(String key, String value) { |
| <span class="pc bpc" id="L219" title="1 of 2 branches missed."> if (StringUtils.isNotBlank(value)) {</span> |
| <span class="pc bpc" id="L220" title="1 of 2 branches missed."> if (validateSet(key)) {</span> |
| <span class="fc" id="L221"> List<String> values = args.get(key);</span> |
| <span class="pc bpc" id="L222" title="1 of 2 branches missed."> if (DefaultLog.getInstance().isEnabled(Log.Level.DEBUG)) {</span> |
| <span class="nc" id="L223"> DefaultLog.getInstance().debug(String.format("Adding [%s] to %s", String.join(", ", Arrays.asList(value)), key));</span> |
| } |
| <span class="fc bfc" id="L225" title="All 2 branches covered."> if (values == null) {</span> |
| <span class="fc" id="L226"> values = new ArrayList<>();</span> |
| <span class="fc" id="L227"> args.put(key, values);</span> |
| } |
| <span class="fc" id="L229"> values.add(value);</span> |
| } |
| } |
| <span class="fc" id="L232"> }</span> |
| |
| /** |
| * Remove a key from the argument list. |
| * @param key the key to remove from the map. |
| */ |
| protected void removeArg(String key) { |
| <span class="fc" id="L239"> args.remove(key);</span> |
| <span class="fc" id="L240"> }</span> |
| |
| ///////////////////////// End common Arg manipulation code |
| |
| <span class="fc" id="L244">protected BaseRatMojo() {</span> |
| <span class="fc" id="L245"> setDeprecationReporter();</span> |
| <span class="fc" id="L246">}</span> |
| |
| /* GENERATED METHODS */ |
| |
| |
| /** |
| * The copyright message to use in the license headers. Argument should be a Arg. (See Argument Types for clarification) |
| * @param copyright Copyright message to use in the license headers. |
| * @deprecated Deprecated for removal since 0.17: Use &lt;editCopyright&gt; instead. |
| */ |
| @Deprecated |
| @Parameter(property = "rat.Copyright") |
| public void setCopyright(String copyright) { |
| <span class="fc" id="L259"> setArg("copyright", copyright);</span> |
| <span class="fc" id="L260"> }</span> |
| /** |
| * 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) |
| * @param editCopyright Copyright message to use in the license headers. |
| */ |
| @Parameter(property = "rat.EditCopyright") |
| public void setEditCopyright(String editCopyright) { |
| <span class="fc" id="L267"> setArg("edit-copyright", editCopyright);</span> |
| <span class="fc" id="L268"> }</span> |
| /** |
| * Forces any changes in files to be written directly to the source files so that new files are not created. |
| * @param force The state |
| * @deprecated Deprecated for removal since 0.17: Use &lt;editOverwrite&gt; instead. |
| */ |
| @Deprecated |
| @Parameter(property = "rat.Force") |
| public void setForce(boolean force) { |
| <span class="pc bpc" id="L277" title="1 of 2 branches missed."> if (force) {</span> |
| <span class="fc" id="L278"> setArg("force", null);</span> |
| } else { |
| <span class="nc" id="L280"> removeArg("force");</span> |
| } |
| <span class="fc" id="L282"> }</span> |
| /** |
| * 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;. |
| * @param editOverwrite The state |
| */ |
| @Parameter(property = "rat.EditOverwrite") |
| public void setEditOverwrite(boolean editOverwrite) { |
| <span class="pc bpc" id="L289" title="1 of 2 branches missed."> if (editOverwrite) {</span> |
| <span class="fc" id="L290"> setArg("edit-overwrite", null);</span> |
| } else { |
| <span class="nc" id="L292"> removeArg("edit-overwrite");</span> |
| } |
| <span class="fc" id="L294"> }</span> |
| /** |
| * Add the Apache-2.0 license header to any file with an unknown license that is not in the exclusion list. |
| * @param addLicense The state |
| * @deprecated Deprecated for removal since 0.17: Use &lt;editLicense&gt; instead. |
| */ |
| @Deprecated |
| @Parameter(property = "rat.AddLicense") |
| public void setAddLicense(boolean addLicense) { |
| <span class="pc bpc" id="L303" title="1 of 2 branches missed."> if (addLicense) {</span> |
| <span class="fc" id="L304"> setArg("addLicense", null);</span> |
| } else { |
| <span class="nc" id="L306"> removeArg("addLicense");</span> |
| } |
| <span class="fc" id="L308"> }</span> |
| /** |
| * 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. |
| * @param editLicense The state |
| */ |
| @Parameter(property = "rat.EditLicense") |
| public void setEditLicense(boolean editLicense) { |
| <span class="pc bpc" id="L315" title="1 of 2 branches missed."> if (editLicense) {</span> |
| <span class="fc" id="L316"> setArg("edit-license", null);</span> |
| } else { |
| <span class="nc" id="L318"> removeArg("edit-license");</span> |
| } |
| <span class="fc" id="L320"> }</span> |
| /** |
| * File names for system configuration. Arguments should be File. (See Argument Types for clarification) |
| * @param config Names for system configuration. |
| */ |
| @Parameter |
| public void setConfigs(String[] config) { |
| <span class="nc" id="L327"> addArg("config", config);</span> |
| <span class="nc" id="L328"> }</span> |
| /** |
| * File names for system configuration. Arguments should be File. (See Argument Types for clarification) |
| * @param config Names for system configuration. |
| */ |
| @Parameter |
| public void setConfig(String config) { |
| <span class="fc" id="L335"> addArg("config", config);</span> |
| <span class="fc" id="L336"> }</span> |
| /** |
| * File names for system configuration. Arguments should be File. (See Argument Types for clarification) |
| * @param licenses Names for system configuration. |
| * @deprecated Deprecated for removal since 0.17: Use &lt;config&gt; instead. |
| */ |
| @Deprecated |
| @Parameter |
| public void setLicenses(String[] licenses) { |
| <span class="nc" id="L345"> addArg("licenses", licenses);</span> |
| <span class="nc" id="L346"> }</span> |
| /** |
| * File names for system configuration. Arguments should be File. (See Argument Types for clarification) |
| * @param licenses Names for system configuration. |
| * @deprecated Deprecated for removal since 0.17: Use &lt;config&gt; instead. |
| */ |
| @Deprecated |
| @Parameter |
| public void setLicenses(String licenses) { |
| <span class="fc" id="L355"> addArg("licenses", licenses);</span> |
| <span class="fc" id="L356"> }</span> |
| /** |
| * Ignore default configuration. |
| * @param configurationNoDefaults The state |
| */ |
| @Parameter(property = "rat.ConfigurationNoDefaults") |
| public void setConfigurationNoDefaults(boolean configurationNoDefaults) { |
| <span class="pc bpc" id="L363" title="1 of 2 branches missed."> if (configurationNoDefaults) {</span> |
| <span class="fc" id="L364"> setArg("configuration-no-defaults", null);</span> |
| } else { |
| <span class="nc" id="L366"> removeArg("configuration-no-defaults");</span> |
| } |
| <span class="fc" id="L368"> }</span> |
| /** |
| * Ignore default configuration. |
| * @param noDefaultLicenses The state |
| * @deprecated Deprecated for removal since 0.17: Use &lt;configurationNoDefaults&gt; instead. |
| */ |
| @Deprecated |
| @Parameter(property = "rat.NoDefaultLicenses") |
| public void setNoDefaultLicenses(boolean noDefaultLicenses) { |
| <span class="pc bpc" id="L377" title="1 of 2 branches missed."> if (noDefaultLicenses) {</span> |
| <span class="fc" id="L378"> setArg("no-default-licenses", null);</span> |
| } else { |
| <span class="nc" id="L380"> removeArg("no-default-licenses");</span> |
| } |
| <span class="fc" id="L382"> }</span> |
| /** |
| * 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) |
| * @param licensesApproved Comma separated list of approved License IDs. |
| */ |
| @Parameter(property = "rat.LicensesApproved") |
| public void setLicensesApproved(String licensesApproved) { |
| <span class="fc" id="L389"> setArg("licenses-approved", licensesApproved);</span> |
| <span class="fc" id="L390"> }</span> |
| /** |
| * Name of file containing comma separated lists of approved License IDs. Argument should be a File. (See Argument Types for clarification) |
| * @param licensesApprovedFile Of file containing comma separated lists of approved License IDs. |
| */ |
| @Parameter(property = "rat.LicensesApprovedFile") |
| public void setLicensesApprovedFile(String licensesApprovedFile) { |
| <span class="fc" id="L397"> setArg("licenses-approved-file", licensesApprovedFile);</span> |
| <span class="fc" id="L398"> }</span> |
| /** |
| * 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) |
| * @param licenseFamiliesApproved Comma separated list of approved license family IDs. |
| */ |
| @Parameter(property = "rat.LicenseFamiliesApproved") |
| public void setLicenseFamiliesApproved(String licenseFamiliesApproved) { |
| <span class="fc" id="L405"> setArg("license-families-approved", licenseFamiliesApproved);</span> |
| <span class="fc" id="L406"> }</span> |
| /** |
| * Name of file containing comma separated lists of approved family IDs. Argument should be a File. (See Argument Types for clarification) |
| * @param licenseFamiliesApprovedFile Of file containing comma separated lists of approved family IDs. |
| */ |
| @Parameter(property = "rat.LicenseFamiliesApprovedFile") |
| public void setLicenseFamiliesApprovedFile(String licenseFamiliesApprovedFile) { |
| <span class="fc" id="L413"> setArg("license-families-approved-file", licenseFamiliesApprovedFile);</span> |
| <span class="fc" id="L414"> }</span> |
| /** |
| * 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) |
| * @param licensesDenied Comma separated list of denied License IDs. |
| */ |
| @Parameter(property = "rat.LicensesDenied") |
| public void setLicensesDenied(String licensesDenied) { |
| <span class="fc" id="L421"> setArg("licenses-denied", licensesDenied);</span> |
| <span class="fc" id="L422"> }</span> |
| /** |
| * 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) |
| * @param licensesDeniedFile Of file containing comma separated lists of the denied license IDs. |
| */ |
| @Parameter(property = "rat.LicensesDeniedFile") |
| public void setLicensesDeniedFile(String licensesDeniedFile) { |
| <span class="fc" id="L429"> setArg("licenses-denied-file", licensesDeniedFile);</span> |
| <span class="fc" id="L430"> }</span> |
| /** |
| * 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) |
| * @param licenseFamiliesDenied Comma separated list of denied License family IDs. |
| */ |
| @Parameter(property = "rat.LicenseFamiliesDenied") |
| public void setLicenseFamiliesDenied(String licenseFamiliesDenied) { |
| <span class="fc" id="L437"> setArg("license-families-denied", licenseFamiliesDenied);</span> |
| <span class="fc" id="L438"> }</span> |
| /** |
| * 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) |
| * @param licenseFamiliesDeniedFile Of file containing comma separated lists of denied license IDs. |
| */ |
| @Parameter(property = "rat.LicenseFamiliesDeniedFile") |
| public void setLicenseFamiliesDeniedFile(String licenseFamiliesDeniedFile) { |
| <span class="fc" id="L445"> setArg("license-families-denied-file", licenseFamiliesDeniedFile);</span> |
| <span class="fc" id="L446"> }</span> |
| /** |
| * 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) |
| * @param counterMax Acceptable maximum number for the specified counter. |
| */ |
| @Parameter |
| public void setCounterMaxs(String[] counterMax) { |
| <span class="nc" id="L453"> addArg("counter-max", counterMax);</span> |
| <span class="nc" id="L454"> }</span> |
| /** |
| * 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) |
| * @param counterMax Acceptable maximum number for the specified counter. |
| */ |
| @Parameter |
| public void setCounterMax(String counterMax) { |
| <span class="fc" id="L461"> addArg("counter-max", counterMax);</span> |
| <span class="fc" id="L462"> }</span> |
| /** |
| * The minimum number for the specified counter. Arguments should be CounterPattern. (See Argument Types for clarification) |
| * @param counterMin Minimum number for the specified counter. |
| */ |
| @Parameter |
| public void setCounterMins(String[] counterMin) { |
| <span class="nc" id="L469"> addArg("counter-min", counterMin);</span> |
| <span class="nc" id="L470"> }</span> |
| /** |
| * The minimum number for the specified counter. Arguments should be CounterPattern. (See Argument Types for clarification) |
| * @param counterMin Minimum number for the specified counter. |
| */ |
| @Parameter |
| public void setCounterMin(String counterMin) { |
| <span class="fc" id="L477"> addArg("counter-min", counterMin);</span> |
| <span class="fc" id="L478"> }</span> |
| /** |
| * 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) |
| * @param inputSource File containing file names to process. |
| */ |
| @Parameter |
| public void setInputSources(String[] inputSource) { |
| <span class="nc" id="L485"> addArg("input-source", inputSource);</span> |
| <span class="nc" id="L486"> }</span> |
| /** |
| * 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) |
| * @param inputSource File containing file names to process. |
| */ |
| @Parameter |
| public void setInputSource(String inputSource) { |
| <span class="fc" id="L493"> addArg("input-source", inputSource);</span> |
| <span class="fc" id="L494"> }</span> |
| /** |
| * Excludes files matching &lt;Expression&gt;. Arguments should be Expression. (See Argument Types for clarification) |
| * @param exclude Files matching &lt;Expression&gt;. |
| * @deprecated Deprecated for removal since 0.17: Use &lt;inputExclude&gt; instead. |
| */ |
| @Deprecated |
| @Parameter |
| public void setExcludes(String[] exclude) { |
| <span class="fc" id="L503"> addArg("exclude", exclude);</span> |
| <span class="fc" id="L504"> }</span> |
| /** |
| * Excludes files matching &lt;Expression&gt;. Arguments should be Expression. (See Argument Types for clarification) |
| * @param exclude Files matching &lt;Expression&gt;. |
| * @deprecated Deprecated for removal since 0.17: Use &lt;inputExclude&gt; instead. |
| */ |
| @Deprecated |
| @Parameter |
| public void setExclude(String exclude) { |
| <span class="fc" id="L513"> addArg("exclude", exclude);</span> |
| <span class="fc" id="L514"> }</span> |
| /** |
| * Excludes files matching &lt;Expression&gt;. Arguments should be Expression. (See Argument Types for clarification) |
| * @param inputExclude Files matching &lt;Expression&gt;. |
| */ |
| @Parameter |
| public void setInputExcludes(String[] inputExclude) { |
| <span class="fc" id="L521"> addArg("input-exclude", inputExclude);</span> |
| <span class="fc" id="L522"> }</span> |
| /** |
| * Excludes files matching &lt;Expression&gt;. Arguments should be Expression. (See Argument Types for clarification) |
| * @param inputExclude Files matching &lt;Expression&gt;. |
| */ |
| @Parameter |
| public void setInputExclude(String inputExclude) { |
| <span class="fc" id="L529"> addArg("input-exclude", inputExclude);</span> |
| <span class="fc" id="L530"> }</span> |
| /** |
| * Reads &lt;Expression&gt; entries from a file. Entries will be excluded from processing. Argument should be a File. (See Argument Types for clarification) |
| * @param excludeFile &lt;Expression&gt; entries from a file. |
| * @deprecated Deprecated for removal since 0.17: Use &lt;inputExcludeFile&gt; instead. |
| */ |
| @Deprecated |
| @Parameter(property = "rat.ExcludeFile") |
| public void setExcludeFile(String excludeFile) { |
| <span class="fc" id="L539"> setArg("exclude-file", excludeFile);</span> |
| <span class="fc" id="L540"> }</span> |
| /** |
| * Reads &lt;Expression&gt; entries from a file. Entries will be excluded from processing. Argument should be a File. (See Argument Types for clarification) |
| * @param inputExcludeFile &lt;Expression&gt; entries from a file. |
| */ |
| @Parameter(property = "rat.InputExcludeFile") |
| public void setInputExcludeFile(String inputExcludeFile) { |
| <span class="fc" id="L547"> setArg("input-exclude-file", inputExcludeFile);</span> |
| <span class="fc" id="L548"> }</span> |
| /** |
| * 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) |
| * @param inputExcludeStd Files defined in standard collections based on commonly occurring groups. |
| */ |
| @Parameter |
| public void setInputExcludeStds(String[] inputExcludeStd) { |
| <span class="nc" id="L555"> addArg("input-exclude-std", inputExcludeStd);</span> |
| <span class="nc" id="L556"> }</span> |
| /** |
| * 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) |
| * @param inputExcludeStd Files defined in standard collections based on commonly occurring groups. |
| */ |
| @Parameter |
| public void setInputExcludeStd(String inputExcludeStd) { |
| <span class="fc" id="L563"> addArg("input-exclude-std", inputExcludeStd);</span> |
| <span class="fc" id="L564"> }</span> |
| /** |
| * Excludes files with sizes less than the number of bytes specified. Argument should be a Integer. (See Argument Types for clarification) |
| * @param inputExcludeSize Files with sizes less than the number of bytes specified. |
| */ |
| @Parameter(property = "rat.InputExcludeSize") |
| public void setInputExcludeSize(String inputExcludeSize) { |
| <span class="fc" id="L571"> setArg("input-exclude-size", inputExcludeSize);</span> |
| <span class="fc" id="L572"> }</span> |
| /** |
| * Includes files matching &lt;Expression&gt;. Will override excluded files. Arguments should be Expression. (See Argument Types for clarification) |
| * @param inputInclude Files matching &lt;Expression&gt;. |
| */ |
| @Parameter |
| public void setInputIncludes(String[] inputInclude) { |
| <span class="nc" id="L579"> addArg("input-include", inputInclude);</span> |
| <span class="nc" id="L580"> }</span> |
| /** |
| * Includes files matching &lt;Expression&gt;. Will override excluded files. Arguments should be Expression. (See Argument Types for clarification) |
| * @param inputInclude Files matching &lt;Expression&gt;. |
| */ |
| @Parameter |
| public void setInputInclude(String inputInclude) { |
| <span class="fc" id="L587"> addArg("input-include", inputInclude);</span> |
| <span class="fc" id="L588"> }</span> |
| /** |
| * Includes files matching &lt;Expression&gt;. Will override excluded files. Arguments should be Expression. (See Argument Types for clarification) |
| * @param include Files matching &lt;Expression&gt;. |
| * @deprecated Deprecated for removal since 0.17: Use &lt;inputInclude&gt; instead. |
| */ |
| @Deprecated |
| @Parameter |
| public void setIncludes(String[] include) { |
| <span class="nc" id="L597"> addArg("include", include);</span> |
| <span class="nc" id="L598"> }</span> |
| /** |
| * Includes files matching &lt;Expression&gt;. Will override excluded files. Arguments should be Expression. (See Argument Types for clarification) |
| * @param include Files matching &lt;Expression&gt;. |
| * @deprecated Deprecated for removal since 0.17: Use &lt;inputInclude&gt; instead. |
| */ |
| @Deprecated |
| @Parameter |
| public void setInclude(String include) { |
| <span class="fc" id="L607"> addArg("include", include);</span> |
| <span class="fc" id="L608"> }</span> |
| /** |
| * Reads &lt;Expression&gt; entries from a file. Entries will override excluded files. Argument should be a File. (See Argument Types for clarification) |
| * @param inputIncludeFile &lt;Expression&gt; entries from a file. |
| */ |
| @Parameter(property = "rat.InputIncludeFile") |
| public void setInputIncludeFile(String inputIncludeFile) { |
| <span class="fc" id="L615"> setArg("input-include-file", inputIncludeFile);</span> |
| <span class="fc" id="L616"> }</span> |
| /** |
| * Reads &lt;Expression&gt; entries from a file. Entries will be excluded from processing. Argument should be a File. (See Argument Types for clarification) |
| * @param includesFile &lt;Expression&gt; entries from a file. |
| * @deprecated Deprecated for removal since 0.17: Use &lt;inputIncludeFile&gt; instead. |
| */ |
| @Deprecated |
| @Parameter(property = "rat.IncludesFile") |
| public void setIncludesFile(String includesFile) { |
| <span class="fc" id="L625"> setArg("includes-file", includesFile);</span> |
| <span class="fc" id="L626"> }</span> |
| /** |
| * 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) |
| * @param inputIncludeStd Files defined in standard collections based on commonly occurring groups. |
| */ |
| @Parameter |
| public void setInputIncludeStds(String[] inputIncludeStd) { |
| <span class="nc" id="L633"> addArg("input-include-std", inputIncludeStd);</span> |
| <span class="nc" id="L634"> }</span> |
| /** |
| * 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) |
| * @param inputIncludeStd Files defined in standard collections based on commonly occurring groups. |
| */ |
| @Parameter |
| public void setInputIncludeStd(String inputIncludeStd) { |
| <span class="fc" id="L641"> addArg("input-include-std", inputIncludeStd);</span> |
| <span class="fc" id="L642"> }</span> |
| /** |
| * Scans hidden directories. |
| * @param scanHiddenDirectories The state |
| * @deprecated Deprecated for removal since 0.17: Use &lt;inputIncludeStd&gt; with 'HIDDEN_DIR' argument instead. |
| */ |
| @Deprecated |
| @Parameter(property = "rat.ScanHiddenDirectories") |
| public void setScanHiddenDirectories(boolean scanHiddenDirectories) { |
| <span class="pc bpc" id="L651" title="1 of 2 branches missed."> if (scanHiddenDirectories) {</span> |
| <span class="fc" id="L652"> setArg("scan-hidden-directories", null);</span> |
| } else { |
| <span class="nc" id="L654"> removeArg("scan-hidden-directories");</span> |
| } |
| <span class="fc" id="L656"> }</span> |
| /** |
| * 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) |
| * @param inputExcludeParsedScm SCM based exclusion files to exclude specified files and directories. |
| */ |
| @Parameter |
| public void setInputExcludeParsedScms(String[] inputExcludeParsedScm) { |
| <span class="nc" id="L663"> addArg("input-exclude-parsed-scm", inputExcludeParsedScm);</span> |
| <span class="nc" id="L664"> }</span> |
| /** |
| * 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) |
| * @param inputExcludeParsedScm SCM based exclusion files to exclude specified files and directories. |
| */ |
| @Parameter |
| public void setInputExcludeParsedScm(String inputExcludeParsedScm) { |
| <span class="fc" id="L671"> addArg("input-exclude-parsed-scm", inputExcludeParsedScm);</span> |
| <span class="fc" id="L672"> }</span> |
| /** |
| * 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) |
| * @param outputStyle Stylesheet to use when creating the report. |
| */ |
| @Parameter(property = "rat.OutputStyle") |
| public void setOutputStyle(String outputStyle) { |
| <span class="fc" id="L679"> setArg("output-style", outputStyle);</span> |
| <span class="fc" id="L680"> }</span> |
| /** |
| * XSLT stylesheet to use when creating the report. Argument should be a StyleSheet. (See Argument Types for clarification) |
| * @param stylesheet Stylesheet to use when creating the report. |
| * @deprecated Deprecated for removal since 0.17: Use &lt;outputStyle&gt; instead. |
| */ |
| @Deprecated |
| @Parameter(property = "rat.Stylesheet") |
| public void setStylesheet(String stylesheet) { |
| <span class="fc" id="L689"> setArg("stylesheet", stylesheet);</span> |
| <span class="fc" id="L690"> }</span> |
| /** |
| * forces XML output rather than the textual report. |
| * @param xml The state |
| * @deprecated Deprecated for removal since 0.17: Use &lt;outputStyle&gt; with the 'xml' argument instead. |
| */ |
| @Deprecated |
| @Parameter(property = "rat.Xml") |
| public void setXml(boolean xml) { |
| <span class="pc bpc" id="L699" title="1 of 2 branches missed."> if (xml) {</span> |
| <span class="fc" id="L700"> setArg("xml", null);</span> |
| } else { |
| <span class="nc" id="L702"> removeArg("xml");</span> |
| } |
| <span class="fc" id="L704"> }</span> |
| /** |
| * List the defined licenses. Argument should be a LicenseFilter. (See Argument Types for clarification) |
| * @param outputLicenses The defined licenses. |
| */ |
| @Parameter(property = "rat.OutputLicenses", defaultValue = "NONE") |
| public void setOutputLicenses(String outputLicenses) { |
| <span class="fc" id="L711"> setArg("output-licenses", outputLicenses);</span> |
| <span class="fc" id="L712"> }</span> |
| /** |
| * List the defined licenses. Argument should be a LicenseFilter. (See Argument Types for clarification) |
| * @param listLicenses The defined licenses. |
| * @deprecated Deprecated for removal since 0.17: Use &lt;outputLicenses&gt; instead. |
| */ |
| @Deprecated |
| @Parameter(property = "rat.ListLicenses") |
| public void setListLicenses(String listLicenses) { |
| <span class="fc" id="L721"> setArg("list-licenses", listLicenses);</span> |
| <span class="fc" id="L722"> }</span> |
| /** |
| * List the defined license families. Argument should be a LicenseFilter. (See Argument Types for clarification) |
| * @param outputFamilies The defined license families. |
| */ |
| @Parameter(property = "rat.OutputFamilies", defaultValue = "NONE") |
| public void setOutputFamilies(String outputFamilies) { |
| <span class="fc" id="L729"> setArg("output-families", outputFamilies);</span> |
| <span class="fc" id="L730"> }</span> |
| /** |
| * List the defined license families. Argument should be a LicenseFilter. (See Argument Types for clarification) |
| * @param listFamilies The defined license families. |
| * @deprecated Deprecated for removal since 0.17: Use &lt;outputFamilies&gt; instead. |
| */ |
| @Deprecated |
| @Parameter(property = "rat.ListFamilies") |
| public void setListFamilies(String listFamilies) { |
| <span class="fc" id="L739"> setArg("list-families", listFamilies);</span> |
| <span class="fc" id="L740"> }</span> |
| /** |
| * If set do not update the files but generate the reports. |
| * @param dryRun The state |
| */ |
| @Parameter(property = "rat.DryRun") |
| public void setDryRun(boolean dryRun) { |
| <span class="pc bpc" id="L747" title="1 of 2 branches missed."> if (dryRun) {</span> |
| <span class="fc" id="L748"> setArg("dry-run", null);</span> |
| } else { |
| <span class="nc" id="L750"> removeArg("dry-run");</span> |
| } |
| <span class="fc" id="L752"> }</span> |
| /** |
| * Define the output file where to write a report to. Argument should be a File. (See Argument Types for clarification) |
| * @param out The output file where to write a report to. |
| * @deprecated Deprecated for removal since 0.17: Use &lt;outputFile&gt; instead. |
| */ |
| @Deprecated |
| @Parameter(property = "rat.Out") |
| public void setOut(String out) { |
| <span class="fc" id="L761"> setArg("out", out);</span> |
| <span class="fc" id="L762"> }</span> |
| /** |
| * Define the output file where to write a report to. Argument should be a File. (See Argument Types for clarification) |
| * @param outputFile The output file where to write a report to. |
| */ |
| @Parameter(property = "rat.OutputFile", defaultValue = "${project.build.directory}/rat.txt") |
| public void setOutputFile(String outputFile) { |
| <span class="fc" id="L769"> setArg("output-file", outputFile);</span> |
| <span class="fc" id="L770"> }</span> |
| /** |
| * Specifies the level of detail in ARCHIVE file reporting. Argument should be a ProcessingType. (See Argument Types for clarification) |
| * @param outputArchive The level of detail in ARCHIVE file reporting. |
| */ |
| @Parameter(property = "rat.OutputArchive", defaultValue = "NOTIFICATION") |
| public void setOutputArchive(String outputArchive) { |
| <span class="fc" id="L777"> setArg("output-archive", outputArchive);</span> |
| <span class="fc" id="L778"> }</span> |
| /** |
| * Specifies the level of detail in STANDARD file reporting. Argument should be a ProcessingType. (See Argument Types for clarification) |
| * @param outputStandard The level of detail in STANDARD file reporting. |
| */ |
| @Parameter(property = "rat.OutputStandard", defaultValue = "ABSENCE") |
| public void setOutputStandard(String outputStandard) { |
| <span class="fc" id="L785"> setArg("output-standard", outputStandard);</span> |
| <span class="fc" id="L786"> }</span> |
| /** |
| * Print information about registered licenses. |
| * @param helpLicenses The state |
| */ |
| @Parameter(property = "rat.HelpLicenses") |
| public void setHelpLicenses(boolean helpLicenses) { |
| <span class="pc bpc" id="L793" title="1 of 2 branches missed."> if (helpLicenses) {</span> |
| <span class="fc" id="L794"> setArg("help-licenses", null);</span> |
| } else { |
| <span class="nc" id="L796"> removeArg("help-licenses");</span> |
| } |
| <span class="fc" id="L798"> }</span> |
| } |
| </pre><div class="footer"><span class="right">Created with <a href="http://www.jacoco.org/jacoco">JaCoCo</a> 0.8.14.202510111229</span></div></body></html> |