Skip to content

Commit b15f69e

Browse files
authored
[MDEP-956][MDEP-932] Silence artifact copying (#436)
* [MDEP-956] Silence artifact copying * move logging to debug level
1 parent 706f200 commit b15f69e

File tree

1 file changed

+6
-8
lines changed
  • src/main/java/org/apache/maven/plugins/dependency/utils

1 file changed

+6
-8
lines changed

src/main/java/org/apache/maven/plugins/dependency/utils/CopyUtil.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,36 +41,34 @@
4141
@Singleton
4242
public class CopyUtil {
4343

44-
private final Logger logger = LoggerFactory.getLogger(CopyUtil.class);
45-
4644
private final BuildContext buildContext;
4745

46+
private final Logger logger = LoggerFactory.getLogger(CopyUtil.class);
47+
4848
@Inject
4949
public CopyUtil(BuildContext buildContext) {
5050
this.buildContext = buildContext;
5151
}
5252

5353
/**
54-
* Does the actual copy of the artifact (file) and logging.
54+
* Copies the artifact (file).
5555
*
56-
* @param sourceArtifact represents the artifact (file) to copy.
57-
* @param destination file name of destination file.
56+
* @param sourceArtifact represents the artifact (file) to copy
57+
* @param destination file name of destination file
5858
* @throws IOException if copy has failed
5959
* @throws MojoExecutionException if artifact file is a directory (which has not been packaged yet)
6060
*
6161
* @since 3.7.0
6262
*/
6363
public void copyArtifactFile(Artifact sourceArtifact, File destination) throws IOException, MojoExecutionException {
64-
logger.info("Copying artifact '{}' ({}) to {}", sourceArtifact, sourceArtifact.getFile(), destination);
65-
6664
File source = sourceArtifact.getFile();
6765
if (source.isDirectory()) {
6866
// usual case is a future jar packaging, but there are special cases: classifier and other packaging
6967
throw new MojoExecutionException("Artifact '" + sourceArtifact
7068
+ "' has not been packaged yet (is a directory). When used on reactor artifact, "
7169
+ "copy should be executed after packaging: see MDEP-187.");
7270
}
73-
71+
logger.debug("Copying artifact '{}' ({}) to {}", sourceArtifact, sourceArtifact.getFile(), destination);
7472
FileUtils.copyFile(source, destination);
7573
buildContext.refresh(destination);
7674
}

0 commit comments

Comments
 (0)