Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.2
    • Fix Version/s: 2.4
    • Labels:
      None
    • Environment:
      Windows XP professional version 2002 and
      Linux Red Hat / Maven 1.0.2 / maven-pdf-plugin-2.2.1
    • Number of attachments :
      2

      Description

      Fragment of text of project.xml:

      <?xml version="1.0" encoding="UTF-8"?>

      <project>

      ...

      <organization>

      <logo>/images/XXX.gif</logo>

      </organization>

      <logo>/images/YYY.gif</logo>

      ...

      Fragment of text of maven.xml:

      <postGoal name="site">

      <attainGoal name="pdf"/>

      </postGoal>

      In compile time the error is generated.

      ...

      [java] [ERROR] Error while creating area : Error while recovering Image Informations (file:/images/YYY.gif) : /images/YYY.gif (No such file or directory)

      ...

      As I understand the problem is connected with following code:

      <j:if test="not $

      {maven.pdf.projectLogo.startsWith('http://')}

      ">

      <maven:makeAbsolutePath

      var="maven.pdf.projectLogo"

      basedir="$

      {maven.xdoc.src}"

      path="${maven.pdf.projectLogo}"

      trim="true"/>

      </j:if>





      <logo>/images/YYY.gif</logo> includes the path which is absolute. And so the prefix ${maven.xdoc.src}

      is not concatenated to the path. And so the file YYY.gif cannot be found.

      I have "simplified" code and YYY.gif was found:

      <j:if test="$

      {not maven.pdf.companyLogo.startsWith('http://')}

      ">

      <j:set var="maven.pdf.companyLogo">$

      {maven.xdoc.src}

      $

      {maven.pdf.companyLogo}

      </j:set>

      </j:if>

      I think this problem can be resolved by more general way.

      1. plugin.jelly-logos.patch
        1 kB
        Lukas Theussl
      2. project.properties.patch
        0.7 kB
        Lukas Theussl

        Activity

        Hide
        Oleg F. Vlasenko added a comment -

        This response was written by Arnaud HERITIER :

        I didn't notice it with my projects or maven itself :

        <organization>
        <name>Apache Software Foundation</name>
        <url>http://www.apache.org/</url>
        <logo>/images/apache-maven-project.png</logo>
        </organization>
        <inceptionYear>2001</inceptionYear>
        <package>org.apache.maven</package>
        <logo>/images/maven-small.gif</logo>

        I'll test it a little bit more.

        Thx for your help.

        Arnaud

        Show
        Oleg F. Vlasenko added a comment - This response was written by Arnaud HERITIER : I didn't notice it with my projects or maven itself : <organization> <name>Apache Software Foundation</name> <url> http://www.apache.org/ </url> <logo>/images/apache-maven-project.png</logo> </organization> <inceptionYear>2001</inceptionYear> <package>org.apache.maven</package> <logo>/images/maven-small.gif</logo> I'll test it a little bit more. Thx for your help. Arnaud
        Hide
        Lukas Theussl added a comment -

        You probably don't see that because the logo locations are overridden in the project.properties file (maven.pdf.projectLogo and maven.pdf.companyLogo), at least that's the case with the maven project. This can actually be used as a workaround, or use a maven.pdf.navigationFile with relative paths for the logos.

        However, if you want to stay consistent with the site navigation file, then you cannot use the maven:makeAbsolutePath tag, because the slash in the beginning will make it be interpreted as an absolute path already.

        Show
        Lukas Theussl added a comment - You probably don't see that because the logo locations are overridden in the project.properties file (maven.pdf.projectLogo and maven.pdf.companyLogo), at least that's the case with the maven project. This can actually be used as a workaround, or use a maven.pdf.navigationFile with relative paths for the logos. However, if you want to stay consistent with the site navigation file, then you cannot use the maven:makeAbsolutePath tag, because the slash in the beginning will make it be interpreted as an absolute path already.
        Hide
        Arnaud Heritier added a comment -

        You're right. I'll check this.

        Show
        Arnaud Heritier added a comment - You're right. I'll check this.
        Hide
        Lukas Theussl added a comment -

        A patch that replaces the maven:makeAbsolutePath call by the same algorithm that is used by the xdoc plugin.

        Show
        Lukas Theussl added a comment - A patch that replaces the maven:makeAbsolutePath call by the same algorithm that is used by the xdoc plugin.
        Hide
        Lukas Theussl added a comment -

        A necessary modification to make my patch above work: since all leading slashes are removed now by the pdf plugin (to make it consistent with xdoc), we have to explicitly add one to the logo locations. This is ugly but the fault is really with the xdoc plugin (why do the <logo> entries need a leading slash?).

        Show
        Lukas Theussl added a comment - A necessary modification to make my patch above work: since all leading slashes are removed now by the pdf plugin (to make it consistent with xdoc), we have to explicitly add one to the logo locations. This is ugly but the fault is really with the xdoc plugin (why do the <logo> entries need a leading slash?).
        Hide
        Arnaud Heritier added a comment -

        The leading slash i needed because these images path are absolute from the site root

        Show
        Arnaud Heritier added a comment - The leading slash i needed because these images path are absolute from the site root
        Hide
        Arnaud Heritier added a comment -

        Patch applied. thanks.

        Show
        Arnaud Heritier added a comment - Patch applied. thanks.

          People

          • Assignee:
            Arnaud Heritier
            Reporter:
            Oleg F. Vlasenko
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: