- * Set to: {@code rulesets/java/quickstart.xml}
*/
public static final String RULE_SET_DEFAULT = "rulesets/java/quickstart.xml";
private static final Logger LOGGER = Logger.getLogger(PmdOperation.class.getName());
private static final String PMD_DIR = "pmd";
- /**
- * The list of paths to exclude.
- */
- private final Collection The valid values are the standard character sets of {@link java.nio.charset.Charset Charset}.
- * Default is: {@code true}
- *
- * Note: If only violations are found, see {@link #failOnViolation(boolean) failOnViolation}
- *
- * @param failOnError whether to exit and fail the build if recoverable errors occurred
- * @return this operation
- * @see #failOnViolation(boolean)
- */
- public PmdOperation failOnError(boolean failOnError) {
- failOnError_ = failOnError;
- return this;
- }
-
- /**
- * Sets whether the build will continue on violations.
- *
- * Note: If additionally recoverable errors occurred, see {@link #failOnError(boolean) failOnError}
- *
- * @param failOnViolation whether to exit and fail the build if violations are found
- * @return this operation
+ * Sets whether the build will continue on warnings.
*/
public PmdOperation failOnViolation(boolean failOnViolation) {
failOnViolation_ = failOnViolation;
@@ -525,11 +244,8 @@ public class PmdOperation extends AbstractOperation
- * While clicking on the URI works in IntelliJ IDEA, Visual Studio Code, etc.; it might not in terminal emulators.
- *
- * Default: {@code TRUE}
- */
- public PmdOperation includeLineNumber(boolean includeLineNumber) {
- includeLineNumber_ = includeLineNumber;
- return this;
- }
-
/**
* Enables or disables incremental analysis.
*/
@@ -615,22 +294,10 @@ public class PmdOperation extends AbstractOperation
- * Previous entries are disregarded.
- *
- * @param inputPath one or more paths
- * @return this operation
- * @see #addInputPaths(File...)
- */
- public PmdOperation inputPaths(File... inputPath) {
- return inputPathsFiles(List.of(inputPath));
- }
-
- /**
- * Sets paths to source files, or directories containing source files to analyze.
- *
- * Previous entries are disregarded.
- *
- * @param inputPath one or more paths
- * @return this operation
- * @see #addInputPaths(String...)
- */
- public PmdOperation inputPaths(String... inputPath) {
- return inputPathsStrings(List.of(inputPath));
- }
-
- /**
- * Sets paths to source files, or directories containing source files to analyze.
- *
- * Previous entries are disregarded.
- *
- * @param inputPath a collection of input paths
- * @return this operation
- * @see #addInputPaths(Collection)
- */
- public PmdOperation inputPaths(Collection
- * Previous entries are disregarded.
- *
- * @param inputPath a collection of input paths
- * @return this operation
- * @see #addInputPathsFiles(Collection)
- */
- public PmdOperation inputPathsFiles(Collection
- * Previous entries are disregarded.
- *
- * @param inputPath a collection of input paths
- * @return this operation
- * @see #addInputPathsStrings(Collection)
- */
- public PmdOperation inputPathsStrings(Collection
- * If the classpath String looks like a URL to a file (i.e. starts with {@code file://}) the file will be read with
- * each line representing an entry on the classpath.
+ * Sets several paths to shorten paths that are output in the report. Previous relative paths will be disregarded.
*
- * @param classpath one or more classpath
- * @return this operation
- */
- public PmdOperation prependAuxClasspath(String... classpath) {
- prependClasspath_ = String.join(File.pathSeparator, classpath);
- return this;
- }
-
- /**
- * Returns the prepended classpath.
- *
- * @return the classpath
- */
- public String prependAuxClasspath() {
- return prependClasspath_;
- }
-
- /**
- * Adds several paths to shorten paths that are output in the report.
- *
- * @param relativeRoot one or more relative root paths
- * @return this operation
- * @see #relativizeRoots(Collection)
+ * @see #addRelativizeRoot(Path...)
*/
public PmdOperation relativizeRoots(Path... relativeRoot) {
- return relativizeRoots(List.of(relativeRoot));
- }
-
- /**
- * Adds several paths to shorten paths that are output in the report.
- *
- * @param relativeRoot one or more relative root paths
- * @return this operation
- * @see #relativizeRootsFiles(Collection)
- */
- public PmdOperation relativizeRoots(File... relativeRoot) {
- return relativizeRootsFiles(List.of(relativeRoot));
- }
-
- /**
- * Adds several paths to shorten paths that are output in the report.
- *
- * @param relativeRoot one or more relative root paths
- * @return this operation
- * @see #relativizeRootsStrings(Collection)
- */
- public PmdOperation relativizeRoots(String... relativeRoot) {
- return relativizeRootsStrings(List.of(relativeRoot));
- }
-
- /**
- * Adds several paths to shorten paths that are output in the report.
- *
- * @param relativeRoot a collection of relative root paths
- * @return this operation
- * @see #relativizeRoots(Path...)
- */
- public PmdOperation relativizeRoots(Collection
* The built-in rule set paths are:
*
* The built-in rule set paths are:
*
@@ -1087,16 +448,16 @@ public class PmdOperation extends AbstractOperation
*
- * @param ruleSet one or more rule set
- * @return this operation
* @see #addRuleSet(String...)
*/
public PmdOperation ruleSets(String... ruleSet) {
- return ruleSets(List.of(ruleSet));
+ ruleSets_.clear();
+ ruleSets_.addAll(Arrays.asList(ruleSet));
+ return this;
}
/**
- * Sets new rule set paths, disregarding any previous entries.
+ * Sets the rule set path(s), disregarding any previously set paths.
*
@@ -1111,30 +472,16 @@ public class PmdOperation extends AbstractOperation
*
- * @param ruleSet a collection of rule set paths
- * @return this operation
* @see #addRuleSet(Collection)
*/
- public PmdOperation ruleSets(Collection