Java

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • Insert variables in xdoc/apt files

    9 answers - 617 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    Hi,
    I've been battling with xdoc and apt files for some hours now, and looking around on
    the web, too: I haven't found any example of xdoc/apt file with variable insertions
    in them.
    I don't imagine this could _not_ be possible with Maven 2 actually, I don't need
    anything complicated, just some kind of ${project.version} variable that I could
    insert in a download link, for example.
    Even in the Maven svn repository, people use xdoc or apt files without any variables.
    Is it just impossible, or have I not searched enough?
    Thanks :)
    Sebastien
  • No.1 | | 939 bytes | |

    You can probably use a filtering plugin like the resource plugin to
    filter your files before running the site goal.

    Sebastien Pennec wrote:
    Hi,

    I've been battling with xdoc and apt files for some hours now, and
    looking around on the web, too: I haven't found any example of
    xdoc/apt file with variable insertions in them.

    I don't imagine this could _not_ be possible with Maven 2 actually,
    I don't need anything complicated, just some kind of
    ${project.version} variable that I could insert in a download link,
    for example.

    Even in the Maven svn repository, people use xdoc or apt files without
    any variables.

    Is it just impossible, or have I not searched enough?

    Thanks :)

    Sebastien

    To unsubscribe, e-mail: users-unsubscribe (AT) maven (DOT) apache.org
    For additional commands, e-mail: users-help (AT) maven (DOT) apache.org
  • No.2 | | 1807 bytes | |

    Thanks for you answer, Edwin,

    I don't really understand what's the common point between filtering files and
    inserting variables in xdoc files To make a download page, I can surely make a
    filter, or just do so that the assembly plug-in copies the zip/tar files directly in
    the folder that the site will use as a download folder.

    But if I want my download.xml xdoc file to make a link that automatically stays up to
    date by adding the right version number to the href, how do I do it?

    Edwin Punzalan a :

    You can probably use a filtering plugin like the resource plugin to
    filter your files before running the site goal.

    Sebastien Pennec wrote:
    >Hi,
    >>

    >I've been battling with xdoc and apt files for some hours now, and
    >looking around on the web, too: I haven't found any example of
    >xdoc/apt file with variable insertions in them.
    >>

    >I don't imagine this could _not_ be possible with Maven 2 actually,
    >I don't need anything complicated, just some kind of
    >${project.version} variable that I could insert in a download link,
    >for example.
    >>

    >Even in the Maven svn repository, people use xdoc or apt files without
    >any variables.
    >>

    >Is it just impossible, or have I not searched enough?
    >>

    >Thanks :)
    >>

    >Sebastien
    >>


    To unsubscribe, e-mail: users-unsubscribe (AT) maven (DOT) apache.org
    For additional commands, e-mail: users-help (AT) maven (DOT) apache.org
  • No.3 | | 2239 bytes | |

    filtering is the same as processing variables into their values.

    What I'd do is create a folder where the unfiltered xdocs are placed,
    and then configure the resources plugin so that it will copy/filter
    those files to the folder that the assembly expects it to be.

    Sebastien Pennec wrote:
    Thanks for you answer, Edwin,

    I don't really understand what's the common point between filtering
    files and inserting variables in xdoc files To make a download
    page, I can surely make a filter, or just do so that the assembly
    plug-in copies the zip/tar files directly in the folder that the site
    will use as a download folder.

    But if I want my download.xml xdoc file to make a link that
    automatically stays up to date by adding the right version number to
    the href, how do I do it?

    Edwin Punzalan a :
    >>

    >You can probably use a filtering plugin like the resource plugin to
    >filter your files before running the site goal.
    >>
    >>

    >Sebastien Pennec wrote:

    Hi,

    I've been battling with xdoc and apt files for some hours now, and
    looking around on the web, too: I haven't found any example of
    xdoc/apt file with variable insertions in them.

    I don't imagine this could _not_ be possible with Maven 2
    actually, I don't need anything complicated, just some kind of
    ${project.version} variable that I could insert in a download link,
    for example.

    Even in the Maven svn repository, people use xdoc or apt files
    without any variables.

    Is it just impossible, or have I not searched enough?

    Thanks :)

    Sebastien

    >>

    >
    >To unsubscribe, e-mail: users-unsubscribe (AT) maven (DOT) apache.org
    >For additional commands, e-mail: users-help (AT) maven (DOT) apache.org
    >>
    >>

    >


    To unsubscribe, e-mail: users-unsubscribe (AT) maven (DOT) apache.org
    For additional commands, e-mail: users-help (AT) maven (DOT) apache.org
  • No.4 | | 2289 bytes | |

    ok, I'll try that.

    Thanks!

    Edwin Punzalan a :

    filtering is the same as processing variables into their values.

    What I'd do is create a folder where the unfiltered xdocs are placed,
    and then configure the resources plugin so that it will copy/filter
    those files to the folder that the assembly expects it to be.

    Sebastien Pennec wrote:
    >Thanks for you answer, Edwin,
    >>

    >I don't really understand what's the common point between filtering
    >files and inserting variables in xdoc files To make a download
    >page, I can surely make a filter, or just do so that the assembly
    >plug-in copies the zip/tar files directly in the folder that the site
    >will use as a download folder.
    >>

    >But if I want my download.xml xdoc file to make a link that
    >automatically stays up to date by adding the right version number to
    >the href, how do I do it?
    >>

    >Edwin Punzalan a :


    You can probably use a filtering plugin like the resource plugin to
    filter your files before running the site goal.

    Sebastien Pennec wrote:
    Hi,

    I've been battling with xdoc and apt files for some hours now, and
    looking around on the web, too: I haven't found any example of
    xdoc/apt file with variable insertions in them.

    I don't imagine this could _not_ be possible with Maven 2
    actually, I don't need anything complicated, just some kind of
    ${project.version} variable that I could insert in a download link,
    for example.

    Even in the Maven svn repository, people use xdoc or apt files
    without any variables.

    Is it just impossible, or have I not searched enough?

    Thanks :)

    Sebastien

    To unsubscribe, e-mail: users-unsubscribe (AT) maven (DOT) apache.org
    For additional commands, e-mail: users-help (AT) maven (DOT) apache.org


    >>


    To unsubscribe, e-mail: users-unsubscribe (AT) maven (DOT) apache.org
    For additional commands, e-mail: users-help (AT) maven (DOT) apache.org
  • No.5 | | 2670 bytes | |

    Hi,

    If you are successful at doing that, could you post your solution?

    Thanks,

    Alexander

    Sebastien Pennec wrote:
    ok, I'll try that.

    Thanks!

    Edwin Punzalan a :
    >>

    >filtering is the same as processing variables into their values.
    >>

    >What I'd do is create a folder where the unfiltered xdocs are placed,
    >and then configure the resources plugin so that it will copy/filter
    >those files to the folder that the assembly expects it to be.
    >>
    >>

    >Sebastien Pennec wrote:

    Thanks for you answer, Edwin,

    I don't really understand what's the common point between filtering
    files and inserting variables in xdoc files To make a download
    page, I can surely make a filter, or just do so that the assembly
    plug-in copies the zip/tar files directly in the folder that the
    site will use as a download folder.

    But if I want my download.xml xdoc file to make a link that
    automatically stays up to date by adding the right version number to
    the href, how do I do it?

    Edwin Punzalan a :

    You can probably use a filtering plugin like the resource plugin to
    filter your files before running the site goal.

    Sebastien Pennec wrote:
    Hi,

    I've been battling with xdoc and apt files for some hours now, and
    looking around on the web, too: I haven't found any example of
    xdoc/apt file with variable insertions in them.

    I don't imagine this could _not_ be possible with Maven 2
    actually, I don't need anything complicated, just some kind of
    ${project.version} variable that I could insert in a download
    link, for example.

    Even in the Maven svn repository, people use xdoc or apt files
    without any variables.

    Is it just impossible, or have I not searched enough?

    Thanks :)

    Sebastien

    To unsubscribe, e-mail: users-unsubscribe (AT) maven (DOT) apache.org
    For additional commands, e-mail: users-help (AT) maven (DOT) apache.org


    >>

    >
    >To unsubscribe, e-mail: users-unsubscribe (AT) maven (DOT) apache.org
    >For additional commands, e-mail: users-help (AT) maven (DOT) apache.org
    >>
    >>

    >


    To unsubscribe, e-mail: users-unsubscribe (AT) maven (DOT) apache.org
    For additional commands, e-mail: users-help (AT) maven (DOT) apache.org
  • No.6 | | 3913 bytes | |

    Alexander,

    Until now, I've been successful at filtering the values, but no satisfying site is
    generated yet.

    I have this in my pom:

    <resources>
    <resource>
    <directory>src/site/xdoc</directory>
    <targetPath>generated-site</targetPath>
    <filtering>true</filtering>
    </resource>
    </resources>

    When I edit the generated files, the variables have been replaced. For example:

    <a href="xxx-${pom.version}.zip">asd</a>

    is translated into:

    <a href="xxx-0.1-SNAPSHT.zip">asd</a>

    Here's the site-plugin config:

    <reporting>
    <plugins>
    <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-site-plugin</artifactId>
    <configuration>
    <xdocDirectory>
    /target/classes/generated-site
    </xdocDirectory>
    </configuration>
    </plugin>

    The problem I have now is that, if I tell the site plug-in to use the generated
    xdocs, it says that file names clash.
    I guess specifying the xdocDirectory doesn't prevent the plugin to search into the
    convention-based src/site/xdoc directory

    Can you try that and tell me if you have better results?

    Sebastien

    Alexander Hars a :
    Hi,

    If you are successful at doing that, could you post your solution?

    Thanks,

    Alexander

    Sebastien Pennec wrote:
    >ok, I'll try that.
    >>

    >Thanks!
    >>

    >Edwin Punzalan a :


    filtering is the same as processing variables into their values.

    What I'd do is create a folder where the unfiltered xdocs are placed,
    and then configure the resources plugin so that it will copy/filter
    those files to the folder that the assembly expects it to be.

    Sebastien Pennec wrote:
    Thanks for you answer, Edwin,

    I don't really understand what's the common point between filtering
    files and inserting variables in xdoc files To make a download
    page, I can surely make a filter, or just do so that the assembly
    plug-in copies the zip/tar files directly in the folder that the
    site will use as a download folder.

    But if I want my download.xml xdoc file to make a link that
    automatically stays up to date by adding the right version number to
    the href, how do I do it?

    Edwin Punzalan a :

    You can probably use a filtering plugin like the resource plugin to
    filter your files before running the site goal.

    Sebastien Pennec wrote:
    Hi,

    I've been battling with xdoc and apt files for some hours now, and
    looking around on the web, too: I haven't found any example of
    xdoc/apt file with variable insertions in them.

    I don't imagine this could _not_ be possible with Maven 2
    actually, I don't need anything complicated, just some kind of
    ${project.version} variable that I could insert in a download
    link, for example.

    Even in the Maven svn repository, people use xdoc or apt files
    without any variables.

    Is it just impossible, or have I not searched enough?

    Thanks :)

    Sebastien

    To unsubscribe, e-mail: users-unsubscribe (AT) maven (DOT) apache.org
    For additional commands, e-mail: users-help (AT) maven (DOT) apache.org

    To unsubscribe, e-mail: users-unsubscribe (AT) maven (DOT) apache.org
    For additional commands, e-mail: users-help (AT) maven (DOT) apache.org


    >>


    To unsubscribe, e-mail: users-unsubscribe (AT) maven (DOT) apache.org
    For additional commands, e-mail: users-help (AT) maven (DOT) apache.org
  • No.7 | | 4439 bytes | |

    why not use src/site/xdoc as the targetPath and use, say
    src/site/unfiltered-xdoc as the source? That way you do not need to
    reconfigure the site-plugin

    Andy

    Sebastien Pennec wrote:
    Alexander,

    Until now, I've been successful at filtering the values, but no
    satisfying site is generated yet.

    I have this in my pom:

    <resources>
    <resource>
    <directory>src/site/xdoc</directory>
    <targetPath>generated-site</targetPath>
    <filtering>true</filtering>
    </resource>
    </resources>

    When I edit the generated files, the variables have been replaced. For
    example:

    <a href="xxx-${pom.version}.zip">asd</a>

    is translated into:

    <a href="xxx-0.1-SNAPSHT.zip">asd</a>

    Here's the site-plugin config:

    <reporting>
    <plugins>
    <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-site-plugin</artifactId>
    <configuration>
    <xdocDirectory>
    /target/classes/generated-site
    </xdocDirectory>
    </configuration>
    </plugin>

    The problem I have now is that, if I tell the site plug-in to use the
    generated xdocs, it says that file names clash.
    I guess specifying the xdocDirectory doesn't prevent the plugin to
    search into the convention-based src/site/xdoc directory

    Can you try that and tell me if you have better results?

    Sebastien

    Alexander Hars a :
    >Hi,
    >>

    >If you are successful at doing that, could you post your solution?
    >>

    >Thanks,
    >>

    >Alexander
    >>

    >Sebastien Pennec wrote:

    ok, I'll try that.

    Thanks!

    Edwin Punzalan a :

    filtering is the same as processing variables into their values.

    What I'd do is create a folder where the unfiltered xdocs are
    placed, and then configure the resources plugin so that it will
    copy/filter those files to the folder that the assembly expects it
    to be.

    Sebastien Pennec wrote:
    Thanks for you answer, Edwin,

    I don't really understand what's the common point between
    filtering files and inserting variables in xdoc files To make a
    download page, I can surely make a filter, or just do so that the
    assembly plug-in copies the zip/tar files directly in the folder
    that the site will use as a download folder.

    But if I want my download.xml xdoc file to make a link that
    automatically stays up to date by adding the right version number
    to the href, how do I do it?

    Edwin Punzalan a :

    You can probably use a filtering plugin like the resource plugin
    to filter your files before running the site goal.

    Sebastien Pennec wrote:
    Hi,

    I've been battling with xdoc and apt files for some hours now,
    and looking around on the web, too: I haven't found any example
    of xdoc/apt file with variable insertions in them.

    I don't imagine this could _not_ be possible with Maven 2
    actually, I don't need anything complicated, just some kind of
    ${project.version} variable that I could insert in a download
    link, for example.

    Even in the Maven svn repository, people use xdoc or apt files
    without any variables.

    Is it just impossible, or have I not searched enough?

    Thanks :)

    Sebastien

    To unsubscribe, e-mail: users-unsubscribe (AT) maven (DOT) apache.org
    For additional commands, e-mail: users-help (AT) maven (DOT) apache.org

    To unsubscribe, e-mail: users-unsubscribe (AT) maven (DOT) apache.org
    For additional commands, e-mail: users-help (AT) maven (DOT) apache.org


    >>

    >
    >To unsubscribe, e-mail: users-unsubscribe (AT) maven (DOT) apache.org
    >For additional commands, e-mail: users-help (AT) maven (DOT) apache.org
    >>
    >>

    >


    To unsubscribe, e-mail: users-unsubscribe (AT) maven (DOT) apache.org
    For additional commands, e-mail: users-help (AT) maven (DOT) apache.org
  • No.8 | | 5137 bytes | |

    I've tried that, and it doesn't seem to work, mainly because the ressource plug-in's
    <targetPathtag does directly to the ${project.build.outputDirectory} folder. It
    might work using /src/site/xdoc but then it wouldn't work anymore if the target dir
    is modified.

    Here is what works for me:

    PM:

    Andrew Williams a :
    why not use src/site/xdoc as the targetPath and use, say
    src/site/unfiltered-xdoc as the source? That way you do not need to
    reconfigure the site-plugin

    Andy

    Sebastien Pennec wrote:
    >Alexander,
    >>

    >Until now, I've been successful at filtering the values, but no
    >satisfying site is generated yet.
    >>

    >I have this in my pom:
    >>

    ><resources>
    ><resource>
    ><directory>src/site/xdoc</directory>
    ><targetPath>generated-site</targetPath>
    ><filtering>true</filtering>
    ></resource>
    ></resources>
    >>

    >When I edit the generated files, the variables have been replaced. For
    >example:
    >>

    ><a href="xxx-${pom.version}.zip">asd</a>
    >>

    >is translated into:
    >>

    ><a href="xxx-0.1-SNAPSHT.zip">asd</a>
    >>

    >Here's the site-plugin config:
    ><reporting>
    ><plugins>
    ><plugin>
    ><groupId>org.apache.maven.plugins</groupId>
    ><artifactId>maven-site-plugin</artifactId>
    ><configuration>
    ><xdocDirectory>
    >/target/classes/generated-site
    ></xdocDirectory>
    ></configuration>
    ></plugin>
    >
    >>

    >The problem I have now is that, if I tell the site plug-in to use the
    >generated xdocs, it says that file names clash.
    >I guess specifying the xdocDirectory doesn't prevent the plugin to
    >search into the convention-based src/site/xdoc directory
    >>

    >Can you try that and tell me if you have better results?
    >>

    >Sebastien
    >>

    >Alexander Hars a :

    Hi,

    If you are successful at doing that, could you post your solution?

    Thanks,

    Alexander

    Sebastien Pennec wrote:
    ok, I'll try that.

    Thanks!

    Edwin Punzalan a :

    filtering is the same as processing variables into their values.

    What I'd do is create a folder where the unfiltered xdocs are
    placed, and then configure the resources plugin so that it will
    copy/filter those files to the folder that the assembly expects it
    to be.

    Sebastien Pennec wrote:
    Thanks for you answer, Edwin,

    I don't really understand what's the common point between
    filtering files and inserting variables in xdoc files To make a
    download page, I can surely make a filter, or just do so that the
    assembly plug-in copies the zip/tar files directly in the folder
    that the site will use as a download folder.

    But if I want my download.xml xdoc file to make a link that
    automatically stays up to date by adding the right version number
    to the href, how do I do it?

    Edwin Punzalan a :

    You can probably use a filtering plugin like the resource plugin
    to filter your files before running the site goal.

    Sebastien Pennec wrote:
    Hi,

    I've been battling with xdoc and apt files for some hours now,
    and looking around on the web, too: I haven't found any example
    of xdoc/apt file with variable insertions in them.

    I don't imagine this could _not_ be possible with Maven 2
    actually, I don't need anything complicated, just some kind of
    ${project.version} variable that I could insert in a download
    link, for example.

    Even in the Maven svn repository, people use xdoc or apt files
    without any variables.

    Is it just impossible, or have I not searched enough?

    Thanks :)

    Sebastien

    To unsubscribe, e-mail: users-unsubscribe (AT) maven (DOT) apache.org
    For additional commands, e-mail: users-help (AT) maven (DOT) apache.org

    To unsubscribe, e-mail: users-unsubscribe (AT) maven (DOT) apache.org
    For additional commands, e-mail: users-help (AT) maven (DOT) apache.org

    To unsubscribe, e-mail: users-unsubscribe (AT) maven (DOT) apache.org
    For additional commands, e-mail: users-help (AT) maven (DOT) apache.org


    >>


    To unsubscribe, e-mail: users-unsubscribe (AT) maven (DOT) apache.org
    For additional commands, e-mail: users-help (AT) maven (DOT) apache.org
  • No.9 | | 1233 bytes | |

    I've been too fast on the ctrl-enter shortcut, sorry.

    So, here is what works for me:

    In the PM:
    <resources>
    <resource>
    <directory>src/site/xdocTemplates</directory>
    <targetPath>generated-site</targetPath>
    <filtering>true</filtering>
    </resource>
    </resources>

    <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-site-plugin</artifactId>
    <configuration>
    <xdocDirectory>
    ${project.build.outputDirectory}/generated-site
    </xdocDirectory>
    </configuration>
    </plugin>

    It processes the files, then saves them in a tmp directory. The site plugin goes in
    the tmp directory to take the files and put them in the /target/site directory.
    This way, the src/site/xdoc directory is empty, and so no conflict (file name
    clashes) happens.

    This is surely not a nice way of doing things (by bypassing the src/site/xdoc dir),
    but it works.

    Sebastien

    To unsubscribe, e-mail: users-unsubscribe (AT) maven (DOT) apache.org
    For additional commands, e-mail: users-help (AT) maven (DOT) apache.org

Re: Insert variables in xdoc/apt files


max 4000 letters.
Your nickname that display:
In order to stop the spam: 7 + 6 =
QUESTION ON "Java"

EMSDN.COM