You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Ma...@cox.com on 2010/08/16 18:05:18 UTC
Maven properties not accessible in xhtml
Hello,
I need some help with the xhtml files in the maven.
I have the apt files in my project and inside the apt file I access the Maven properties of the POM.xml as ${project.name} or ${project.version}. Since formatting and updating the site each time is not easy with the apt files, I am shifting to xhtml files. I used the doxia converter to convert the apt into xhtml and then did a mvn site:site
The site came up as expected but the html did not interpret the ${project.name} and it was printed as it is. In comparison when I used apt, then the html does show the name which maven reads from the POM.xml
Can someone please help with the solution to read the maven.properties in the xhtml?
Regards,
Mani Sikka
Re: Maven properties not accessible in xhtml
Posted by Trevor Harmon <tr...@vocaro.com>.
On Aug 16, 2010, at 9:05 AM, <Ma...@cox.com> wrote:
> The site came up as expected but the html did not interpret the ${project.name} and it was printed as it is. In comparison when I used apt, then the html does show the name which maven reads from the POM.xml
When I use APT, built-in properties such as ${project.name} are not evaluated and instead show up as-is. I have to add a ".vm" extension to the APT file and also define the properties I want to use in my POM, taking care not to use periods. For example:
<properties>
<projectVersion>${project.version}</projectVersion>
</properties>
I can then use ${projectVersion} in my APT file and it is evaluated correctly. This is as directed by the Site plugin docs. See the section on Filtering:
http://maven.apache.org/plugins/maven-site-plugin/examples/creating-content.html#filtering
I'm not sure how you were able to get it to work without doing this. But perhaps the tactic will solve your XHTML problem.
Trevor
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Maven properties not accessible in xhtml
Posted by Trevor Harmon <tr...@vocaro.com>.
On Aug 16, 2010, at 9:05 AM, <Ma...@cox.com> wrote:
> The site came up as expected but the html did not interpret the ${project.name} and it was printed as it is. In comparison when I used apt, then the html does show the name which maven reads from the POM.xml
When I use APT, built-in properties such as ${project.name} are not evaluated and instead show up as-is. I have to add a ".vm" extension to the APT file and also define the properties I want to use in my POM, taking care not to use periods. For example:
<properties>
<projectVersion>${project.version}</projectVersion>
</properties>
I can then use ${projectVersion} in my APT file and it is evaluated correctly. This is as directed by the Site plugin docs. See the section on Filtering:
http://maven.apache.org/plugins/maven-site-plugin/examples/creating-content.html#filtering
I'm not sure how you were able to get it to work without doing this. But perhaps the tactic will solve your XHTML problem.
Trevor
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org