Hi!
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:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>2.0-beta-5</version>
<configuration>
<templateFile>maven-site.vm</templateFile>
<inputEncoding>UTF-8</inputEncoding>
<outputEncoding>UTF-8</outputEncoding>
</configuration>
</plugin>
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:
--WebTest
|-- 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.
Thanks!
--
View this message in context:
http://www.nabble.com/Problems-using-Velocity-with-Maven-tf4293420.html#a12222150
Sent from the Velocity - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]