maven resource builder: show path to problematic file if copying failed (ZD-66983)
authornik <Nikolay.Chashnikov@jetbrains.com>
Fri, 17 Jul 2015 08:11:24 +0000 (11:11 +0300)
committernik <Nikolay.Chashnikov@jetbrains.com>
Fri, 17 Jul 2015 08:11:46 +0000 (11:11 +0300)
plugins/maven/jps-plugin/src/org/jetbrains/jps/maven/compiler/MavenResourcesBuilder.java

index 607316544a1c8d6d91d77b068a55737a50007339..1ccb52b544b8df483ac3a9db9bc00a75d27c5a79 100644 (file)
@@ -1,5 +1,6 @@
 package org.jetbrains.jps.maven.compiler;
 
+import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.openapi.util.io.FileUtil;
 import com.intellij.openapi.util.io.FileUtilRt;
 import org.jetbrains.annotations.NotNull;
@@ -27,6 +28,7 @@ import java.util.*;
  *         Date: 10/6/11
  */
 public class MavenResourcesBuilder extends TargetBuilder<MavenResourceRootDescriptor, MavenResourcesTarget> {
+  private static final Logger LOG = Logger.getInstance(MavenResourcesBuilder.class);
   public static final String BUILDER_NAME = "Maven Resources Compiler";
 
   public MavenResourcesBuilder() {
@@ -114,6 +116,10 @@ public class MavenResourcesBuilder extends TargetBuilder<MavenResourceRootDescri
           context.processMessage(
             new CompilerMessage(BUILDER_NAME, BuildMessage.Kind.INFO, "Resource was not copied: " + e.getMessage(), sourcePath));
         }
+        catch (IOException e) {
+          context.processMessage(new CompilerMessage(BUILDER_NAME, BuildMessage.Kind.ERROR, "Failed to copy '" + sourcePath + "' to '" + outputFile.getAbsolutePath() + "': " + e.getMessage()));
+          LOG.info(e);
+        }
 
         if (context.getCancelStatus().isCanceled()) {
           return;