Author: hboutemy Date: Sat Nov 25 17:44:22 2017 New Revision: 1816336 URL: http://svn.apache.org/viewvc?rev=1816336&view=rev Log: [MPDF-84] display pdf generated file(s) location
Modified: maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins/pdf/PdfMojo.java Modified: maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins/pdf/PdfMojo.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins/pdf/PdfMojo.java?rev=1816336&r1=1816335&r2=1816336&view=diff ============================================================================== --- maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins/pdf/PdfMojo.java (original) +++ maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins/pdf/PdfMojo.java Sat Nov 25 17:44:22 2017 @@ -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 ); } }