[ 
http://jira.codehaus.org/browse/MSITE-294?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_123459
 ] 

Andrew Hughes commented on MSITE-294:
-------------------------------------

Hi Dennis,

Thanks for the response, what you are saying is correct... if I put this text 
in I would expect the value to be replaced....

INPUT: index.apt.vm
{noformat}
This project version is ${project.version}
{noformat}
OUTPUT: index.html  [which is correct and I am happy with :)
{noformat}
This project version is 1.0.0-SNAPSHOT
{noformat}


But let's say I really wanted the output to say....

INPUT: index.apt.vm
{noformat}
This project version is ${project.version} and comes from the 
$\{project.version\} property.
{noformat}
OUTPUT: index.html  - which is correct and I am happy with :)]
{noformat}
This project version is 1.0.0-SNAPSHOT and comes from the ${project.version} 
property.
{noformat}

However........ if I want to do the above inside an apt escape box it becomes a 
bit weird... this is the bug...
INPUT: index.apt.vm
{noformat}
+----
This project version is ${project.version} and comes from the 
$\{project.version\} property.
+----
{noformat}
OUTPUT: index.html  - which is not what I want :(
{noformat}
This project version is 1.0.0-SNAPSHOT and comes from the $\{project.version\} 
property.
{noformat}


My real use case, is that I have a plugin I am trying to document. My 
documentation is an XML HowTo snippet (hence the +------ apt escape section). 
The XML HowTo is driven by a mixture of properties to be replaced from values 
in the project, and "you must define a property called xxx.xxx within your 
profile to complete the plugin usage configuration HowTo. My description 
problably sucks so here's my actual input and output I want, and what I get....

INPUT: index.apt.vm
{noformat}
How To Use The ${project.groupId}:${project.artifactId}-${project.version} 
Plugin

Add the following to your pom.xml's plugin section

+-------------------------------------------------------------------------------------------------+
<plugins>
        .....
        <plugin>
            <groupId>${project.groupId}</groupId>
            <artifactId>${project.artifactId}</artifactId>
            <version>${project.version}</version>
            <configuration>
                <host>localhost</host>
                <port>4848</port>
                <user>admin</user>
                <password>adm1nadm1n</password>
                
<target>$\{basedir\}/target/$\{project.artifactId\}-$\{project.version\}.$\{project.packaging\}</target>
                <appname>$\{project.artifactId\}-$\{project.version\}</appname>
            </configuration>
        </plugin>
        .....
</plugins>
+-------------------------------------------------------------------------------------------------+
{noformat}
OUTPUT: index.html (this is what I want)

{noformat}
How To Use The mycompany-maven:glassfish-deployer-1.0.0-SNAPSHOT Plugin

Add the following to your pom.xml's plugin section

<plugins>
        .....
        <plugin>
            <groupId>mycompany-maven</groupId>
            <artifactId>glassfish-deployer</artifactId>
            <version>1.0.0-SNAPSHOT</version>
            <configuration>
                <host>localhost</host>
                <port>4848</port>
                <user>admin</user>
                <password>adm1nadm1n</password>
                
<target>${basedir}/target/${project.artifactId}-${project.version}.${project.packaging}</target>
                <appname>${project.artifactId}-${project.version}</appname>
            </configuration>
        </plugin>
        .....
</plugins>

{noformat}
OUTPUT: index.html (this is what I get) NOTE the backslashes are still there....
{noformat}
How To Use The mycompany-maven:glassfish-deployer-1.0.0-SNAPSHOT Plugin

Add the following to your pom.xml's plugin section

<plugins>
        .....
        <plugin>
            <groupId>mycompany-maven</groupId>
            <artifactId>glassfish-deployer</artifactId>
            <version>1.0.0-SNAPSHOT</version>
            <configuration>
                <host>localhost</host>
                <port>4848</port>
                <user>admin</user>
                <password>adm1nadm1n</password>
                
<target>$\{basedir\}/target/$\{project.artifactId\}-$\{project.version\}.$\{project.packaging\}</target>
                <appname>$\{project.artifactId\}-$\{project.version\}</appname>
            </configuration>
        </plugin>
        .....
</plugins>
{noformat}

> Can't escape ${project.version} as plain text inside apt +---- section, on 
> *.apt.vm files
> -----------------------------------------------------------------------------------------
>
>                 Key: MSITE-294
>                 URL: http://jira.codehaus.org/browse/MSITE-294
>             Project: Maven 2.x Site Plugin
>          Issue Type: Bug
>    Affects Versions: 2.0-beta-6
>         Environment: *.apt.vm files, and +----- escaped section.
>            Reporter: Andrew Hughes
>            Priority: Critical
>
> You can reproduce this the following way.....
> ./src/site/index.apt.vm (start)
> --------------------------------------------------
> This will appear without the backslashes 
> {noformat}$\{project.version\}{noformat} and that's excellent. But you can't 
> get this output in the escaped apt text section below.
> {noformat}
> +---
> However this apt escaped section still shows the backslashes inside this 
> section $\{project.version\} and there is no known way the text can be shown 
> as above.
> To make matters worse, when you put this in without the backslashes, you get 
> the properties value (like a filter). See: ${project.version} not the desired 
> string as above
> +---
> {noformat}
> -------------------------------------------------
> ./src/site/index.apt.vm (start)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to