velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andzy <>
Subject Problems using Velocity with Maven
Date Sun, 19 Aug 2007 13:29:37 GMT

I'm trying to learn how to use Velocity and Maven to generate some HTML
pages. (I'm using Velocity Engine that comes with Maven 2.0.5)
The problem I have is that my .vm file does not "see" structure of the
Maven's site declaration.

When I run Maven without reference to my .vm file, it generates HTML file
with the structure of the site as defined in /src/site/site.xml file (as
well as the contents of the index.apt file).
This works fine.

Then I add my custom Velocity file "maven-site.vm" and reference it in the
pom.xml file:
I can change the generated HTML page with the help of my Velocity file.
However, when I try to retrieve the "site.xml" structure using
$siteDescriptor.getChild() (for example, $siteDescriptor.getChild(
"bannerLeft" ) ), I always get null.
Why is it so?

Is there anything else I have to define?

Or is my file structure incorrect?
Here is the structure of my sample project:
      |-- pom.xml
      |-- build.xml
      |-- maven-site.vm
      +-- src
          |--+ site
              |-- site.xml
              |--+ apt
                 |- index.apt

I've spent a lot of time searching for solution, but haven't been able to
find the answer.

View this message in context:
Sent from the Velocity - User mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message