|
From: <tre...@us...> - 2008-03-25 00:01:54
|
Revision: 796
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=796&view=rev
Author: trevorolio
Date: 2008-03-24 17:01:57 -0700 (Mon, 24 Mar 2008)
Log Message:
-----------
Added a handy extension to the velocity dev-plugin
Modified Paths:
--------------
maven/trunk/dev-plugins/src/main/java/com/ogoglio/plugin/StaticVelocityMojo.java
Modified: maven/trunk/dev-plugins/src/main/java/com/ogoglio/plugin/StaticVelocityMojo.java
===================================================================
--- maven/trunk/dev-plugins/src/main/java/com/ogoglio/plugin/StaticVelocityMojo.java 2008-03-24 19:53:28 UTC (rev 795)
+++ maven/trunk/dev-plugins/src/main/java/com/ogoglio/plugin/StaticVelocityMojo.java 2008-03-25 00:01:57 UTC (rev 796)
@@ -29,6 +29,11 @@
*/
private File targetDirectory;
+ /**
+ * @parameter
+ */
+ private String projectName;
+
public void execute() throws MojoExecutionException {
if (templateDirectory==null) {
getLog().warn("No velocity templates configured!");
@@ -51,7 +56,11 @@
engine.init();
VelocityContext velocityContext = new VelocityContext();
-
+ if(projectName != null){
+ velocityContext.put("projectName", projectName);
+ } else {
+ velocityContext.put("projectName", "No Name");
+ }
File[] children = templateDirectory.listFiles();
for (int i = 0; children != null && i < children.length; i++) {
if (children[i].getName().endsWith(".html")) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|