You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Roberto Lo Giacco <rl...@smartlab.net> on 2009/10/08 02:03:53 UTC

pdf/site plugin and images not found

The PDF plugin seems not able to find my site images producing this output:

[DEBUG] Configuring mojo 
'org.apache.maven.plugins:maven-pdf-plugin:1.0:pdf' -->
[DEBUG]   (f) aggregate = true
[DEBUG]   (f) docDescriptor = /shared/Java/smartweb/core/doc/site/pdf.xml
[DEBUG]   (f) implementation = fo
[DEBUG]   (f) localRepository = [local] -> file:///shared/.m2
[DEBUG]   (f) outputDirectory = /shared/Java/smartweb/core/etc/out/site
[DEBUG]   (f) pluginVersion = 1.0
[DEBUG]   (f) project = MavenProject: 
net.smartlab.web:smartweb:1.2.14-SNAPSHOT @ 
/shared/Java/smartweb/core/pom.xml
[DEBUG]   (f) siteDirectory = /shared/Java/smartweb/core/doc/site
[DEBUG]   (f) workingDirectory = /shared/Java/smartweb/core/etc/out/pdf
[DEBUG] -- end configuration --
[INFO] [pdf:pdf]
[DEBUG] Mapped url: /shared/Java/smartweb/core/doc/site to relative 
path: doc/site
[DEBUG] maven-default-skin: resolved to version 1.0 from repository central
[DEBUG] Copy resources from skin artifact: 
'/shared/.m2/org/apache/maven/skins/maven-default-skin/1.0/maven-default-skin-1.0.jar'...
[DEBUG] The file '/shared/Java/smartweb/core/etc/out/site/css/site.css' 
does not exists. Creating an empty file.
[DEBUG] Interpolated document descriptor 
(/shared/Java/smartweb/core/doc/site/pdf.xml)
<document xmlns="http://maven.apache.org/DOCUMENT/1.0.1" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/DOCUMENT/1.0.1 
http://maven.apache.org/xsd/document-1.0.1.xsd"
  outputName="maven-pdf-plugin-1.2.14-SNAPSHOT">

  <meta>
    <title>The SmartWeb Framework</title>
    <author>The SmartWeb Project</author>
  </meta>

  <toc name="Table of Contents">
    <item name="Introduction" ref="./introducing.apt"/>
    <item name="Architecture" ref="./architecture.apt"/>
    <item name="Presentation" ref="./presentation.apt"/>
    <item name="Model" ref="./model.apt"/>
    <item name="FAQ" ref="./faq.fml"/>
  </toc>

  <cover>
    <coverTitle>SmartWeb</coverTitle>
    <coverSubTitle>ver. 1.2.14-SNAPSHOT</coverSubTitle>
    <coverType>User Guide</coverType>
    <projectName>SmartWeb</projectName>
    
<projectLogo>http://maven.apache.org/images/maventxt_logo_200.gif</projectLogo>
    <companyName>The SmartWeb Team</companyName>
    
<companyLogo>http://www.apache.org/images/asf_logo_wide.png</companyLogo>
  </cover>
</document>


[DEBUG] Using TOC defined in the document descriptor.
[DEBUG] Parsing file 
/shared/Java/smartweb/core/doc/site/apt/./introducing.apt
[DEBUG] Parsing file 
/shared/Java/smartweb/core/doc/site/apt/./architecture.apt
[DEBUG] Parsing file 
/shared/Java/smartweb/core/doc/site/apt/./presentation.apt
[DEBUG] Parsing file /shared/Java/smartweb/core/doc/site/apt/./model.apt
[DEBUG] Parsing file /shared/Java/smartweb/core/doc/site/fml/./faq.fml
[DEBUG] [FO Sink] Unknown Sink event: 'br', ignoring!
[DEBUG] [FO Sink] Unknown Sink event: 'br', ignoring!
[DEBUG] [FO Sink] Unknown Sink event: 'br', ignoring!
[DEBUG] [FO Sink] Unknown Sink event: 'br', ignoring!
[DEBUG] Generating: 
/shared/Java/smartweb/core/etc/out/site/maven-pdf-plugin-1.2.14-SNAPSHOT.pdf
ERROR [org.apache.fop.fo.FONode:83] 2009-10-08 01:58:59,060 - Image not 
found: images/overview.png
ERROR [org.apache.fop.fo.FONode:83] 2009-10-08 01:58:59,220 - Image not 
found: images/overview-presentation.png
[INFO] 
------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] 
------------------------------------------------------------------------

and the pdf file is generated (without images). The same apt sources 
produce correct HTML output using the correct images. I tried with 
absolute paths and relative paths (with and without the leading / AND 
using the ./ prefix).

Actually my POM is heavily customized to fit the directory structure I 
want impose on my project.
I think the PDF plugin heavily relies on the SITE plugin to get 
configurations and informations so I'm going to attach here both plugin 
configuration:

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-site-plugin</artifactId>
        <version>2.0-beta-4</version>
        <configuration>
          <locales>en</locales>
          <outputDirectory>etc/site</outputDirectory>
          <siteDirectory>doc/site</siteDirectory>
          <resourcesDirectory>res/site</resourcesDirectory>
          <outputEncoding>UTF-8</outputEncoding>
          
<templateDirectory>file://${basedir}/res/site/css/</templateDirectory>
          <template>maven-site.vm</template>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-pdf-plugin</artifactId>
        <executions>
          <execution>
            <phase>site</phase>
            <goals><goal>pdf</goal></goals>
          </execution>
        </executions>
        <configuration>
          <siteDirectory>${basedir}/doc/site</siteDirectory>
          <docDescriptor>${basedir}/doc/site/pdf.xml</docDescriptor>
          <outputDirectory>${basedir}/etc/site</outputDirectory>
        </configuration>
    </plugin>

I'm experiencing two distinct problems:

1) when I generate my site an additional target/site/images directory 
structure is created on my project root folder and it contains only the 
images used by the surefire report, those images are available under the 
correct etc/out/site directory I explicitly setted as output folder. 
This is a minor problem as I usually remove that directory structure 
after site creation and I considered it a side effect may be caused by 
I've not specified a <generatedSiteDirectory> configuration**

2) when I generate the pdf the contents of etc/out/pdf/images is:
collapsed.gif
expanded.gif
external.png
icon_error_sml.gif
icon_info_sml.gif
icon_success_sml.gif
icon_warning_sml.gif
newwindow.png
logos/build-by-maven-black.png
logos/build-by-maven-white.png
logos/maven-feather.png

-- 

  Roberto Lo Giacco

  Chief Technical Officer
  SmartLab s.r.l.
  via Spagna, snc - 87036 Rende (CS) - Italy

  Mobile: +39 392 8765657
  Email: rlogiacco@smartlab.net
  Skype: longisland-75 
  Web: http://www.smartlab.it 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: pdf/site plugin and images not found

Posted by Lukas Theussl <lt...@apache.org>.
Can you attach a simple test project to http://jira.codehaus.org/browse/MPDF, that 
would help me reproduce that.

First guess is that the pdf plugin doesn't have a 'resourcesDirectory' parameter 
like the site plugin, resources are expected to be in ${siteDirectory}/resources 
("resources" being hard-coded). Can you try to put your images there, if it works 
that would give an indication.

Cheers,
-Lukas


Roberto Lo Giacco wrote:
> The PDF plugin seems not able to find my site images producing this output:
> 
> [DEBUG] Configuring mojo 
> 'org.apache.maven.plugins:maven-pdf-plugin:1.0:pdf' -->
> [DEBUG]   (f) aggregate = true
> [DEBUG]   (f) docDescriptor = /shared/Java/smartweb/core/doc/site/pdf.xml
> [DEBUG]   (f) implementation = fo
> [DEBUG]   (f) localRepository = [local] -> file:///shared/.m2
> [DEBUG]   (f) outputDirectory = /shared/Java/smartweb/core/etc/out/site
> [DEBUG]   (f) pluginVersion = 1.0
> [DEBUG]   (f) project = MavenProject: 
> net.smartlab.web:smartweb:1.2.14-SNAPSHOT @ 
> /shared/Java/smartweb/core/pom.xml
> [DEBUG]   (f) siteDirectory = /shared/Java/smartweb/core/doc/site
> [DEBUG]   (f) workingDirectory = /shared/Java/smartweb/core/etc/out/pdf
> [DEBUG] -- end configuration --
> [INFO] [pdf:pdf]
> [DEBUG] Mapped url: /shared/Java/smartweb/core/doc/site to relative 
> path: doc/site
> [DEBUG] maven-default-skin: resolved to version 1.0 from repository central
> [DEBUG] Copy resources from skin artifact: 
> '/shared/.m2/org/apache/maven/skins/maven-default-skin/1.0/maven-default-skin-1.0.jar'... 
> 
> [DEBUG] The file '/shared/Java/smartweb/core/etc/out/site/css/site.css' 
> does not exists. Creating an empty file.
> [DEBUG] Interpolated document descriptor 
> (/shared/Java/smartweb/core/doc/site/pdf.xml)
> <document xmlns="http://maven.apache.org/DOCUMENT/1.0.1" 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>  xsi:schemaLocation="http://maven.apache.org/DOCUMENT/1.0.1 
> http://maven.apache.org/xsd/document-1.0.1.xsd"
>  outputName="maven-pdf-plugin-1.2.14-SNAPSHOT">
> 
>  <meta>
>    <title>The SmartWeb Framework</title>
>    <author>The SmartWeb Project</author>
>  </meta>
> 
>  <toc name="Table of Contents">
>    <item name="Introduction" ref="./introducing.apt"/>
>    <item name="Architecture" ref="./architecture.apt"/>
>    <item name="Presentation" ref="./presentation.apt"/>
>    <item name="Model" ref="./model.apt"/>
>    <item name="FAQ" ref="./faq.fml"/>
>  </toc>
> 
>  <cover>
>    <coverTitle>SmartWeb</coverTitle>
>    <coverSubTitle>ver. 1.2.14-SNAPSHOT</coverSubTitle>
>    <coverType>User Guide</coverType>
>    <projectName>SmartWeb</projectName>
>    
> <projectLogo>http://maven.apache.org/images/maventxt_logo_200.gif</projectLogo> 
> 
>    <companyName>The SmartWeb Team</companyName>
>    
> <companyLogo>http://www.apache.org/images/asf_logo_wide.png</companyLogo>
>  </cover>
> </document>
> 
> 
> [DEBUG] Using TOC defined in the document descriptor.
> [DEBUG] Parsing file 
> /shared/Java/smartweb/core/doc/site/apt/./introducing.apt
> [DEBUG] Parsing file 
> /shared/Java/smartweb/core/doc/site/apt/./architecture.apt
> [DEBUG] Parsing file 
> /shared/Java/smartweb/core/doc/site/apt/./presentation.apt
> [DEBUG] Parsing file /shared/Java/smartweb/core/doc/site/apt/./model.apt
> [DEBUG] Parsing file /shared/Java/smartweb/core/doc/site/fml/./faq.fml
> [DEBUG] [FO Sink] Unknown Sink event: 'br', ignoring!
> [DEBUG] [FO Sink] Unknown Sink event: 'br', ignoring!
> [DEBUG] [FO Sink] Unknown Sink event: 'br', ignoring!
> [DEBUG] [FO Sink] Unknown Sink event: 'br', ignoring!
> [DEBUG] Generating: 
> /shared/Java/smartweb/core/etc/out/site/maven-pdf-plugin-1.2.14-SNAPSHOT.pdf 
> 
> ERROR [org.apache.fop.fo.FONode:83] 2009-10-08 01:58:59,060 - Image not 
> found: images/overview.png
> ERROR [org.apache.fop.fo.FONode:83] 2009-10-08 01:58:59,220 - Image not 
> found: images/overview-presentation.png
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] BUILD SUCCESSFUL
> [INFO] 
> ------------------------------------------------------------------------
> 
> and the pdf file is generated (without images). The same apt sources 
> produce correct HTML output using the correct images. I tried with 
> absolute paths and relative paths (with and without the leading / AND 
> using the ./ prefix).
> 
> Actually my POM is heavily customized to fit the directory structure I 
> want impose on my project.
> I think the PDF plugin heavily relies on the SITE plugin to get 
> configurations and informations so I'm going to attach here both plugin 
> configuration:
> 
>      <plugin>
>        <groupId>org.apache.maven.plugins</groupId>
>        <artifactId>maven-site-plugin</artifactId>
>        <version>2.0-beta-4</version>
>        <configuration>
>          <locales>en</locales>
>          <outputDirectory>etc/site</outputDirectory>
>          <siteDirectory>doc/site</siteDirectory>
>          <resourcesDirectory>res/site</resourcesDirectory>
>          <outputEncoding>UTF-8</outputEncoding>
>          
> <templateDirectory>file://${basedir}/res/site/css/</templateDirectory>
>          <template>maven-site.vm</template>
>        </configuration>
>      </plugin>
>      <plugin>
>        <groupId>org.apache.maven.plugins</groupId>
>        <artifactId>maven-pdf-plugin</artifactId>
>        <executions>
>          <execution>
>            <phase>site</phase>
>            <goals><goal>pdf</goal></goals>
>          </execution>
>        </executions>
>        <configuration>
>          <siteDirectory>${basedir}/doc/site</siteDirectory>
>          <docDescriptor>${basedir}/doc/site/pdf.xml</docDescriptor>
>          <outputDirectory>${basedir}/etc/site</outputDirectory>
>        </configuration>
>    </plugin>
> 
> I'm experiencing two distinct problems:
> 
> 1) when I generate my site an additional target/site/images directory 
> structure is created on my project root folder and it contains only the 
> images used by the surefire report, those images are available under the 
> correct etc/out/site directory I explicitly setted as output folder. 
> This is a minor problem as I usually remove that directory structure 
> after site creation and I considered it a side effect may be caused by 
> I've not specified a <generatedSiteDirectory> configuration**
> 
> 2) when I generate the pdf the contents of etc/out/pdf/images is:
> collapsed.gif
> expanded.gif
> external.png
> icon_error_sml.gif
> icon_info_sml.gif
> icon_success_sml.gif
> icon_warning_sml.gif
> newwindow.png
> logos/build-by-maven-black.png
> logos/build-by-maven-white.png
> logos/maven-feather.png
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org