elharo commented on code in PR #389:
URL: 
https://github.com/apache/maven-dependency-plugin/pull/389#discussion_r1611629057


##########
src/main/java/org/apache/maven/plugins/dependency/utils/CopyUtil.java:
##########
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.maven.plugins.dependency.utils;
+
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Singleton;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.logging.Log;
+import org.codehaus.plexus.util.FileUtils;
+import org.sonatype.plexus.build.incremental.BuildContext;
+
+/**
+ * Provide a copyFile method in one place.
+ */
+@Named
+@Singleton
+public class CopyUtil {
+
+    private final BuildContext buildContext;
+
+    @Inject
+    public CopyUtil(BuildContext buildContext) {
+        this.buildContext = buildContext;
+    }
+
+    /**
+     * Does the actual copy of the file and logging.
+     *
+     * @param source represents the file to copy.
+     * @param destination file name of destination file.
+     * @throws IOException with a message if an error occurs.
+     */
+    public void copyFile(Log log, File source, File destination) throws 
IOException, MojoExecutionException {
+        log.info("Copying " + source + " to " + destination);

Review Comment:
   YAGNI. I spend way too much time wading through maven logs trying to 
understand why and how builds failed. Info messages for normal operations just 
get in the way and make developers' jobs harder. That someone somewhere might 
one day want this message is not a good enough reason to include it.
   
   I can sort of see letting this slip through as a separate issue from the 
refactoring, though now that I look at it, I think that refactoring should also 
remove the log argument here too. This is a new public API we did not have 
before, and including that Log argument now makes it harder to remove later 
since it would be a public API change. 
   
   If the choice is between adding this method with the Log argument and not 
doing the refactoring, I think I'm going to pick not doing the refactoring. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to