Win a copy of Microservices Testing (Live Project) this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

Problems using Velocity with Maven

 
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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: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:
I've spent a lot of time searching for solution, but haven't been able to find the answer.
Thanks!
[ August 19, 2007: Message edited by: Andris Jekabsons ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic