diff --git a/src/it/html-report/verify.groovy b/src/it/html-report/verify.groovy index 227a40978..3d35e444c 100644 --- a/src/it/html-report/verify.groovy +++ b/src/it/html-report/verify.groovy @@ -1,5 +1,5 @@ /* - * Copyright 2005-2023 the original author or authors. + * Copyright 2005-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/groovy/org/codehaus/mojo/spotbugs/BaseViolationCheckMojo.groovy b/src/main/groovy/org/codehaus/mojo/spotbugs/BaseViolationCheckMojo.groovy index 22236fc8a..92ed9c84a 100644 --- a/src/main/groovy/org/codehaus/mojo/spotbugs/BaseViolationCheckMojo.groovy +++ b/src/main/groovy/org/codehaus/mojo/spotbugs/BaseViolationCheckMojo.groovy @@ -44,9 +44,7 @@ import org.codehaus.plexus.resource.ResourceManager abstract class BaseViolationCheckMojo extends AbstractMojo { - /** - * Location where generated html will be created. - */ + /** Location where generated html will be created. */ @Parameter(defaultValue = '${project.reporting.outputDirectory}', required = true) File outputDirectory @@ -82,39 +80,27 @@ abstract class BaseViolationCheckMojo extends AbstractMojo { @Parameter(property = "spotbugs.outputXmlFilename", defaultValue = "spotbugsXml.xml") String spotbugsXmlOutputFilename - /** - * Doxia Site Renderer. - */ + /** Doxia Site Renderer. */ @Component(role = Renderer.class) Renderer siteRenderer - /** - * Directory containing the class files for Spotbugs to analyze. - */ + /** Directory containing the class files for Spotbugs to analyze. */ @Parameter(defaultValue = '${project.build.outputDirectory}', required = true) File classFilesDirectory - /** - * Directory containing the test class files for Spotbugs to analyze. - */ + /** Directory containing the test class files for Spotbugs to analyze. */ @Parameter(defaultValue = '${project.build.testOutputDirectory}', required = true) File testClassFilesDirectory - /** - * Location of the Xrefs to link to. - */ + /** Location of the Xrefs to link to. */ @Parameter(defaultValue = '${project.reporting.outputDirectory}/xref') File xrefLocation - /** - * Location of the Test Xrefs to link to. - */ + /** Location of the Test Xrefs to link to. */ @Parameter(defaultValue = '${project.reporting.outputDirectory}/xref-test') File xrefTestLocation - /** - * The directories containing the sources to be compiled. - */ + /** The directories containing the sources to be compiled. */ @Parameter(defaultValue = '${project.compileSourceRoots}', required = true, readonly = true) List compileSourceRoots @@ -134,9 +120,7 @@ abstract class BaseViolationCheckMojo extends AbstractMojo { @Parameter(defaultValue = "false", property = "spotbugs.includeTests") boolean includeTests - /** - * List of artifacts this plugin depends on. Used for resolving the Spotbugs core plugin. - */ + /** List of artifacts this plugin depends on. Used for resolving the Spotbugs core plugin. */ @Parameter(property = "plugin.artifacts", required = true, readonly = true) List pluginArtifacts @@ -146,27 +130,19 @@ abstract class BaseViolationCheckMojo extends AbstractMojo { @Parameter(property = "localRepository", required = true, readonly = true) ArtifactRepository localRepository - /** - * Remote repositories which will be searched for the coreplugin jar. - */ + /** Remote repositories which will be searched for the coreplugin jar. */ @Parameter(property = "project.remoteArtifactRepositories", required = true, readonly = true) List remoteArtifactRepositories - /** - * Maven Session. - */ + /** Maven Session. */ @Parameter (defaultValue = '${session}', required = true, readonly = true) MavenSession session - /** - * Maven Project. - */ + /** Maven Project. */ @Parameter(property = "project", required = true, readonly = true) MavenProject project - /** - * Encoding used for xml files. Default value is UTF-8. - */ + /** Encoding used for xml files. Default value is UTF-8. */ @Parameter(defaultValue = "UTF-8", readonly = true) String xmlEncoding @@ -188,24 +164,18 @@ abstract class BaseViolationCheckMojo extends AbstractMojo { @Parameter(defaultValue = '${project.reporting.outputEncoding}', property = "outputEncoding") String outputEncoding - /** - * Threshold of minimum bug severity to report. Valid values are High, Default, Low, Ignore, and Exp (for experimental). - */ + /** Threshold of minimum bug severity to report. Valid values are High, Default, Low, Ignore, and Exp (for experimental). */ @Parameter(defaultValue = "Default", property = "spotbugs.threshold") String threshold - /** - * Artifact resolver, needed to download the coreplugin jar. - */ + /** Artifact resolver, needed to download the coreplugin jar. */ @Component(role = ArtifactResolver.class) ArtifactResolver artifactResolver /** * File name of the include filter. Only bugs in matching the filters are reported. - * *
* Potential values are a filesystem path, a URL, or a classpath resource. - * *
* This parameter is resolved as resource, URL, then file. If successfully * resolved, the contents of the configuration is copied into the @@ -220,10 +190,8 @@ abstract class BaseViolationCheckMojo extends AbstractMojo { /** * File name of the exclude filter. Bugs matching the filters are not reported. - * *
* Potential values are a filesystem path, a URL, or a classpath resource. - * *
* This parameter is resolved as resource, URL, then file. If successfully * resolved, the contents of the configuration is copied into the @@ -238,10 +206,8 @@ abstract class BaseViolationCheckMojo extends AbstractMojo { /** * File names of the baseline files. Bugs found in the baseline files won't be reported. - * *
* Potential values are a filesystem path, a URL, or a classpath resource. - * *
* This parameter is resolved as resource, URL, then file. If successfully * resolved, the contents of the configuration is copied into the @@ -263,9 +229,7 @@ abstract class BaseViolationCheckMojo extends AbstractMojo { @Parameter(defaultValue = "Default", property = "spotbugs.effort") String effort - /** - * Turn on Spotbugs debugging. - */ + /** Turn on Spotbugs debugging. */ @Parameter(defaultValue = "false", property = "spotbugs.debug") boolean debug @@ -296,10 +260,8 @@ abstract class BaseViolationCheckMojo extends AbstractMojo { /** * The plugin list to include in the report. This is a comma-delimited list. - * *
* Potential values are a filesystem path, a URL, or a classpath resource. - * *
* This parameter is resolved as resource, URL, then file. If successfully
* resolved, the contents of the configuration is copied into the
@@ -364,7 +326,7 @@ abstract class BaseViolationCheckMojo extends AbstractMojo {
/**
* SiteTool.
*
- * @since 2.1-SNAPSHOT
+ * @since 2.1
*/
@Component(role = SiteTool.class)
SiteTool siteTool
@@ -430,9 +392,7 @@ abstract class BaseViolationCheckMojo extends AbstractMojo {
@Parameter(property = "spotbugs.maxAllowedViolations", defaultValue = "0")
int maxAllowedViolations
- /**
- * Disable bugs log.
- */
+ /** Disable bugs log. */
@Parameter(defaultValue = "false", property = "spotbugs.quiet")
boolean quiet
diff --git a/src/main/groovy/org/codehaus/mojo/spotbugs/PluginArtifact.groovy b/src/main/groovy/org/codehaus/mojo/spotbugs/PluginArtifact.groovy
index 92ed151fe..ff3cbadda 100644
--- a/src/main/groovy/org/codehaus/mojo/spotbugs/PluginArtifact.groovy
+++ b/src/main/groovy/org/codehaus/mojo/spotbugs/PluginArtifact.groovy
@@ -1,5 +1,5 @@
/*
- * Copyright 2005-2023 the original author or authors.
+ * Copyright 2005-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,9 +16,18 @@
package org.codehaus.mojo.spotbugs
class PluginArtifact {
+ /** The group id. */
String groupId
+
+ /** The artifact id. */
String artifactId
+
+ /** The version. */
String version
+
+ /** The type defaulted as jar. */
String type = "jar"
+
+ /** The classifier. */
String classifier
}
diff --git a/src/main/groovy/org/codehaus/mojo/spotbugs/ResourceHelper.groovy b/src/main/groovy/org/codehaus/mojo/spotbugs/ResourceHelper.groovy
index 62be1836c..e15dc8bf0 100644
--- a/src/main/groovy/org/codehaus/mojo/spotbugs/ResourceHelper.groovy
+++ b/src/main/groovy/org/codehaus/mojo/spotbugs/ResourceHelper.groovy
@@ -1,5 +1,5 @@
/*
- * Copyright 2005-2023 the original author or authors.
+ * Copyright 2005-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -23,8 +23,13 @@ import org.codehaus.plexus.resource.ResourceManager
final class ResourceHelper {
+ /** The log. */
Log log
+
+ /** The output directory. */
File outputDirectory
+
+ /** The resource manager. */
ResourceManager resourceManager
ResourceHelper(Log log, File outputDirectory, ResourceManager resourceManager) {
diff --git a/src/main/groovy/org/codehaus/mojo/spotbugs/SourceFileIndexer.groovy b/src/main/groovy/org/codehaus/mojo/spotbugs/SourceFileIndexer.groovy
index e0c7dde8c..d5ead41a7 100644
--- a/src/main/groovy/org/codehaus/mojo/spotbugs/SourceFileIndexer.groovy
+++ b/src/main/groovy/org/codehaus/mojo/spotbugs/SourceFileIndexer.groovy
@@ -1,5 +1,5 @@
/*
- * Copyright 2005-2023 the original author or authors.
+ * Copyright 2005-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -27,9 +27,7 @@ import java.nio.file.Paths
*/
class SourceFileIndexer {
- /**
- * List of source files found in the current Maven project
- */
+ /** List of source files found in the current Maven project. */
private List
* This will facilitate searches.
*
* @param path Path to clean up
diff --git a/src/main/groovy/org/codehaus/mojo/spotbugs/SpotBugsGui.groovy b/src/main/groovy/org/codehaus/mojo/spotbugs/SpotBugsGui.groovy
index 4689852a8..0d13a34d2 100644
--- a/src/main/groovy/org/codehaus/mojo/spotbugs/SpotBugsGui.groovy
+++ b/src/main/groovy/org/codehaus/mojo/spotbugs/SpotBugsGui.groovy
@@ -47,40 +47,26 @@ import org.codehaus.plexus.resource.ResourceManager
@Mojo(name = "gui", requiresDependencyResolution = ResolutionScope.TEST, requiresProject = true)
class SpotBugsGui extends AbstractMojo implements SpotBugsPluginsTrait {
- /**
- * locale to use for Resource bundle.
- */
+ /** Locale to use for Resource bundle. */
static Locale locale = Locale.ENGLISH
- /**
- * Directory containing the class files for Spotbugs to analyze.
- */
+ /** Directory containing the class files for Spotbugs to analyze. */
@Parameter(defaultValue = '${project.build.outputDirectory}', required = true)
File classFilesDirectory
- /**
- * Turn on Spotbugs debugging.
- *
- */
+ /** Turn on Spotbugs debugging. */
@Parameter(defaultValue = "false", property="spotbugs.debug")
boolean debug
- /**
- * List of artifacts this plugin depends on. Used for resolving the Spotbugs core plugin.
- */
+ /** List of artifacts this plugin depends on. Used for resolving the Spotbugs core plugin. */
@Parameter(property="plugin.artifacts", required = true, readonly = true)
List pluginArtifacts
- /**
- * Effort of the bug finders. Valid values are Min, Default and Max.
- *
- */
+ /** Effort of the bug finders. Valid values are Min, Default and Max. */
@Parameter(defaultValue = "Default", property="spotbugs.effort")
String effort
- /**
- * The plugin list to include in the report. This is a SpotbugsInfo.COMMA-delimited list.
- */
+ /** The plugin list to include in the report. This is a SpotbugsInfo.COMMA-delimited list. */
@Parameter(property="spotbugs.pluginList")
String pluginList
@@ -94,23 +80,15 @@ class SpotBugsGui extends AbstractMojo implements SpotBugsPluginsTrait {
@Parameter
PluginArtifact[] plugins
- /**
- * Artifact resolver, needed to download the coreplugin jar.
- */
+ /** Artifact resolver, needed to download the coreplugin jar. */
@Component(role = ArtifactResolver.class)
ArtifactResolver artifactResolver
- /**
- * Used to look up Artifacts in the remote repository.
- *
- */
+ /** Used to look up Artifacts in the remote repository. */
@Component(role = RepositorySystem.class)
RepositorySystem factory
- /**
- * List of Remote Repositories used by the resolver.
- *
- */
+ /** List of Remote Repositories used by the resolver. */
@Parameter(property = "project.remoteArtifactRepositories", required = true, readonly = true)
List remoteRepositories
@@ -121,30 +99,19 @@ class SpotBugsGui extends AbstractMojo implements SpotBugsPluginsTrait {
@Parameter(property = "localRepository", required = true, readonly = true)
ArtifactRepository localRepository
- /**
- * Maven Session.
- */
+ /** Maven Session. */
@Parameter (defaultValue = '${session}', required = true, readonly = true)
MavenSession session
- /**
- * Maven Project.
- *
- */
+ /** Maven Project. */
@Parameter(property="project", required = true, readonly = true)
MavenProject project
- /**
- * Resource bundle for a specific locale.
- *
- */
+ /** Resource bundle for a specific locale. */
@Parameter(readonly = true)
ResourceBundle bundle
- /**
- * Specifies the directory where the Spotbugs native xml output will be generated.
- *
- */
+ /** Specifies the directory where the Spotbugs native xml output will be generated. */
@Parameter(defaultValue = '${project.build.directory}', required = true)
File spotbugsXmlOutputDirectory
diff --git a/src/main/groovy/org/codehaus/mojo/spotbugs/SpotBugsInfo.groovy b/src/main/groovy/org/codehaus/mojo/spotbugs/SpotBugsInfo.groovy
index 10c353c41..f707e05ef 100644
--- a/src/main/groovy/org/codehaus/mojo/spotbugs/SpotBugsInfo.groovy
+++ b/src/main/groovy/org/codehaus/mojo/spotbugs/SpotBugsInfo.groovy
@@ -24,70 +24,63 @@ package org.codehaus.mojo.spotbugs
*/
interface SpotBugsInfo {
- /**
- * The name of the Plug-In.
- */
+ /** The name of the Plug-In. */
static final String PLUGIN_NAME = "spotbugs"
- /**
- * The name of the property resource bundle (Filesystem).
- */
+ /** The name of the property resource bundle (Filesystem). */
static final String BUNDLE_NAME = "spotbugs"
- /**
- * The key to get the name of the Plug-In from the bundle.
- */
+ /** The key to get the name of the Plug-In from the bundle. */
static final String NAME_KEY = "report.spotbugs.name"
- /**
- * The key to get the description of the Plug-In from the bundle.
- */
+ /** The key to get the description of the Plug-In from the bundle. */
static final String DESCRIPTION_KEY = "report.spotbugs.description"
- /**
- * The key to get the source directory message of the Plug-In from the bundle.
- */
+ /** The key to get the source directory message of the Plug-In from the bundle. */
static final String SOURCE_ROOT_KEY = "report.spotbugs.sourceRoot"
- /**
- * The key to get the source directory message of the Plug-In from the bundle.
- */
+ /** The key to get the source directory message of the Plug-In from the bundle. */
static final String TEST_SOURCE_ROOT_KEY = "report.spotbugs.testSourceRoot"
- /**
- * The key to get the java source message of the Plug-In from the bundle.
- */
+ /** The key to get the java source message of the Plug-In from the bundle. */
static final String JAVA_SOURCES_KEY = "report.spotbugs.javasources"
- /**
- * The extensions to search files for.
- */
+ /** The extensions to search files for. */
static final String[] EXTENSIONS = [ "class" ]
+ /** The comma character. */
static final String COMMA = ","
+ /** The forward slash character. */
static final String FORWARD_SLASH = '/'
+ /** The backward slash character. */
static final String BACKWARD_SLASH = '\\'
- /**
- * The character to separate URL tokens.
- */
+ /** The character to separate URL tokens. */
static final String URL_SEPARATOR = "/"
+ /** The blank character. */
static final String BLANK = " "
+ /** The period character. */
static final String PERIOD = "."
+ /** The end of line separator. */
static final EOL = System.lineSeparator()
+ /** The url static string. */
static final String URL = "url"
+ /** The static class suffix. */
static final String CLASS_SUFFIX = '.class'
+ /** The spotbugs efforts as max, min, and default as default. */
Map