You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by hb...@apache.org on 2017/12/20 09:44:10 UTC

[maven-pdf-plugin] branch master updated: [MPDF-84] display pdf generated file(s) location

This is an automated email from the ASF dual-hosted git repository.

hboutemy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-pdf-plugin.git


The following commit(s) were added to refs/heads/master by this push:
     new fa4da4f  [MPDF-84] display pdf generated file(s) location
fa4da4f is described below

commit fa4da4fe9c51d70440368c77e08e54bea0076ba0
Author: Herve Boutemy <hb...@apache.org>
AuthorDate: Sat Nov 25 17:44:22 2017 +0000

    [MPDF-84] display pdf generated file(s) location
    
    git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1816336 13f79535-47bb-0310-9956-ffa450edef68
---
 src/main/java/org/apache/maven/plugins/pdf/PdfMojo.java | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/main/java/org/apache/maven/plugins/pdf/PdfMojo.java b/src/main/java/org/apache/maven/plugins/pdf/PdfMojo.java
index 06106db..f5330a5 100644
--- a/src/main/java/org/apache/maven/plugins/pdf/PdfMojo.java
+++ b/src/main/java/org/apache/maven/plugins/pdf/PdfMojo.java
@@ -449,10 +449,7 @@ public class PdfMojo
     private void copyGeneratedPdf()
         throws MojoExecutionException, IOException
     {
-        if ( outputDirectory.getCanonicalPath().equals( workingDirectory.getCanonicalPath() ) )
-        {
-            return;
-        }
+        boolean requireCopy = !outputDirectory.getCanonicalPath().equals( workingDirectory.getCanonicalPath() );
 
         String outputName = getDocumentModel( getDefaultLocale() ).getOutputName().trim();
         if ( !outputName.endsWith( ".pdf" ) )
@@ -472,8 +469,13 @@ public class PdfMojo
 
             File generatedPdfDest = new File( getLocaleDirectory( outputDirectory, locale ), outputName );
 
-            FileUtils.copyFile( generatedPdfSource, generatedPdfDest );
-            generatedPdfSource.delete();
+            if ( requireCopy )
+            {
+                FileUtils.copyFile( generatedPdfSource, generatedPdfDest );
+                generatedPdfSource.delete();
+            }
+
+            getLog().info( "pdf generated: " + generatedPdfDest );
         }
     }
 

-- 
To stop receiving notification emails like this one, please contact
['"commits@maven.apache.org" <co...@maven.apache.org>'].