diff --git a/src/main/groovy/org/codehaus/mojo/spotbugs/BaseViolationCheckMojo.groovy b/src/main/groovy/org/codehaus/mojo/spotbugs/BaseViolationCheckMojo.groovy index 92ed9c84a..f1839786f 100644 --- a/src/main/groovy/org/codehaus/mojo/spotbugs/BaseViolationCheckMojo.groovy +++ b/src/main/groovy/org/codehaus/mojo/spotbugs/BaseViolationCheckMojo.groovy @@ -23,23 +23,17 @@ import org.apache.maven.artifact.repository.ArtifactRepository import org.apache.maven.doxia.siterenderer.Renderer import org.apache.maven.doxia.tools.SiteTool - import org.apache.maven.execution.MavenSession - import org.apache.maven.plugin.AbstractMojo import org.apache.maven.plugin.MojoExecutionException - import org.apache.maven.plugins.annotations.Component import org.apache.maven.plugins.annotations.Execute import org.apache.maven.plugins.annotations.LifecyclePhase import org.apache.maven.plugins.annotations.Mojo import org.apache.maven.plugins.annotations.Parameter import org.apache.maven.plugins.annotations.ResolutionScope - import org.apache.maven.project.MavenProject - import org.apache.maven.shared.transfer.artifact.resolve.ArtifactResolver - import org.codehaus.plexus.resource.ResourceManager abstract class BaseViolationCheckMojo extends AbstractMojo { @@ -77,7 +71,7 @@ abstract class BaseViolationCheckMojo extends AbstractMojo { * * @since 3.1.12.2 */ - @Parameter(property = "spotbugs.outputXmlFilename", defaultValue = "spotbugsXml.xml") + @Parameter(defaultValue = "spotbugsXml.xml", property = "spotbugs.outputXmlFilename") String spotbugsXmlOutputFilename /** Doxia Site Renderer. */ diff --git a/src/main/groovy/org/codehaus/mojo/spotbugs/SpotBugsGui.groovy b/src/main/groovy/org/codehaus/mojo/spotbugs/SpotBugsGui.groovy index 0d13a34d2..18987987b 100644 --- a/src/main/groovy/org/codehaus/mojo/spotbugs/SpotBugsGui.groovy +++ b/src/main/groovy/org/codehaus/mojo/spotbugs/SpotBugsGui.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. @@ -18,22 +18,15 @@ package org.codehaus.mojo.spotbugs import groovy.ant.AntBuilder import org.apache.maven.artifact.repository.ArtifactRepository - import org.apache.maven.execution.MavenSession - import org.apache.maven.plugin.AbstractMojo - import org.apache.maven.plugins.annotations.Component import org.apache.maven.plugins.annotations.Mojo import org.apache.maven.plugins.annotations.Parameter import org.apache.maven.plugins.annotations.ResolutionScope - import org.apache.maven.project.MavenProject - import org.apache.maven.repository.RepositorySystem - import org.apache.maven.shared.transfer.artifact.resolve.ArtifactResolver - import org.codehaus.plexus.resource.ResourceManager /** @@ -120,7 +113,7 @@ class SpotBugsGui extends AbstractMojo implements SpotBugsPluginsTrait { * * @since 3.1.12.2 */ - @Parameter(property = "spotbugs.outputXmlFilename", defaultValue = "spotbugsXml.xml") + @Parameter(defaultValue = "spotbugsXml.xml", property = "spotbugs.outputXmlFilename") String spotbugsXmlOutputFilename /** @@ -130,7 +123,7 @@ class SpotBugsGui extends AbstractMojo implements SpotBugsPluginsTrait { * * @since 2.2 */ - @Parameter(property="encoding", defaultValue = '${project.build.sourceEncoding}') + @Parameter(defaultValue = '${project.build.sourceEncoding}', property="encoding") String encoding /** @@ -138,7 +131,7 @@ class SpotBugsGui extends AbstractMojo implements SpotBugsPluginsTrait { * * @since 2.2 */ - @Parameter(property="spotbugs.maxHeap", defaultValue = "512") + @Parameter(defaultValue = "512", property="spotbugs.maxHeap") int maxHeap /** diff --git a/src/main/groovy/org/codehaus/mojo/spotbugs/SpotBugsMojo.groovy b/src/main/groovy/org/codehaus/mojo/spotbugs/SpotBugsMojo.groovy index 4e539014d..b6c6773b9 100644 --- a/src/main/groovy/org/codehaus/mojo/spotbugs/SpotBugsMojo.groovy +++ b/src/main/groovy/org/codehaus/mojo/spotbugs/SpotBugsMojo.groovy @@ -36,7 +36,6 @@ import org.apache.maven.reporting.AbstractMavenReport import org.apache.maven.reporting.MavenReport import org.apache.maven.repository.RepositorySystem import org.apache.maven.shared.transfer.artifact.resolve.ArtifactResolver - import org.codehaus.plexus.resource.ResourceManager import org.codehaus.plexus.resource.loader.FileResourceLoader @@ -112,7 +111,7 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait { * * @since 4.7.2.2 */ - @Parameter(property = "spotbugs.sarifOutputFilename", defaultValue = "spotbugsSarif.json", required = true) + @Parameter(defaultValue = "spotbugsSarif.json", property = "spotbugs.sarifOutputFilename", required = true) String sarifOutputFilename /** @@ -136,7 +135,7 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait { * * @since 3.1.12.2 */ - @Parameter(property = "spotbugs.outputXmlFilename", defaultValue = "spotbugsXml.xml") + @Parameter(defaultValue = "spotbugsXml.xml", property = "spotbugs.outputXmlFilename") String spotbugsXmlOutputFilename /** Doxia Site Renderer. */ @@ -1255,12 +1254,12 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait { String newFileName = indexer.searchActualFilesLocation(originalFullPath) if (newFileName != null) { - if (getLog().isDebugEnabled()) { - getLog().info("$originalFullPath modified to $newFileName") + if (log.isDebugEnabled()) { + log.info("$originalFullPath modified to $newFileName") } loc.physicalLocation.artifactLocation.uri = newFileName } else { - getLog().warn("No source file found for $originalFullPath. " + + log.warn("No source file found for $originalFullPath. " + "The path include in the SARIF report could be incomplete.") } }