From b15f69e285145b8e25ec5643409be67a142070d3 Mon Sep 17 00:00:00 2001 From: Elliotte Rusty Harold Date: Sat, 12 Oct 2024 21:32:25 +0000 Subject: [PATCH] [MDEP-956][MDEP-932] Silence artifact copying (#436) * [MDEP-956] Silence artifact copying * move logging to debug level --- .../maven/plugins/dependency/utils/CopyUtil.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/main/java/org/apache/maven/plugins/dependency/utils/CopyUtil.java b/src/main/java/org/apache/maven/plugins/dependency/utils/CopyUtil.java index 21d067ae7..b175fb705 100644 --- a/src/main/java/org/apache/maven/plugins/dependency/utils/CopyUtil.java +++ b/src/main/java/org/apache/maven/plugins/dependency/utils/CopyUtil.java @@ -41,28 +41,26 @@ @Singleton public class CopyUtil { - private final Logger logger = LoggerFactory.getLogger(CopyUtil.class); - private final BuildContext buildContext; + private final Logger logger = LoggerFactory.getLogger(CopyUtil.class); + @Inject public CopyUtil(BuildContext buildContext) { this.buildContext = buildContext; } /** - * Does the actual copy of the artifact (file) and logging. + * Copies the artifact (file). * - * @param sourceArtifact represents the artifact (file) to copy. - * @param destination file name of destination file. + * @param sourceArtifact represents the artifact (file) to copy + * @param destination file name of destination file * @throws IOException if copy has failed * @throws MojoExecutionException if artifact file is a directory (which has not been packaged yet) * * @since 3.7.0 */ public void copyArtifactFile(Artifact sourceArtifact, File destination) throws IOException, MojoExecutionException { - logger.info("Copying artifact '{}' ({}) to {}", sourceArtifact, sourceArtifact.getFile(), destination); - File source = sourceArtifact.getFile(); if (source.isDirectory()) { // usual case is a future jar packaging, but there are special cases: classifier and other packaging @@ -70,7 +68,7 @@ public void copyArtifactFile(Artifact sourceArtifact, File destination) throws I + "' has not been packaged yet (is a directory). When used on reactor artifact, " + "copy should be executed after packaging: see MDEP-187."); } - + logger.debug("Copying artifact '{}' ({}) to {}", sourceArtifact, sourceArtifact.getFile(), destination); FileUtils.copyFile(source, destination); buildContext.refresh(destination); }