vmassol 2002/06/16 10:54:15
Modified: src/java/org/apache/maven BaseProjectTask.java
src/templates/xdocs maven-reports.xml
Log:
VTL variables must not have any "." in their names. Replaced any "." found in maven
ant properties by "-"
Revision Changes Path
1.18 +18 -15
jakarta-turbine-maven/src/java/org/apache/maven/BaseProjectTask.java
Index: BaseProjectTask.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/BaseProjectTask.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- BaseProjectTask.java 16 Jun 2002 17:17:50 -0000 1.17
+++ BaseProjectTask.java 16 Jun 2002 17:54:15 -0000 1.18
@@ -90,7 +90,7 @@
* Velocity context use in rendering the build system.
*/
protected Context context;
-
+
/**
* Project
*/
@@ -130,24 +130,24 @@
throws BuildException
{
context = new VelocityContext();
-
+
try
{
mavenProject = MavenUtils.getProject(projectDescriptor);
-
+
context.put("buildElements", new ArrayList());
context.put("delegators", new HashMap());
context.put("project", mavenProject);
-
+
if (listFile != null)
{
context.put("jars", ListTask.getList(listFile));
}
-
+
context.put("callbacks", new HashMap());
context.put("escape", new Escape());
- exportAntProperties(context);
+ exportMavenProperties(context);
return context;
}
@@ -162,20 +162,23 @@
/**
* Export all Ant Maven properties to the Velocity context (ie all
- * properties starting with "maven" will be exported).
+ * properties starting with "maven" will be exported). Exported properties
+ * will have any "." replaced by a "-" as "." is a reserved keyword in
+ * VTL.
*
* @param context the Velocity context
*/
- protected void exportAntProperties(Context context)
+ protected void exportMavenProperties(Context context)
{
- Enumeration props = getProject().getProperties().keys();
- while (props.hasMoreElements())
+ Enumeration propertyNames = getProject().getProperties().keys();
+ while (propertyNames.hasMoreElements())
{
- String property = (String) props.nextElement();
- if (property.startsWith("maven"))
+ String propertyName = (String) propertyNames.nextElement();
+ if (propertyName.startsWith("maven"))
{
- context.put(property,
- getProject().getProperty(property));
+ String normalizedPropertyName = propertyName.replace('.', '-');
+ context.put(normalizedPropertyName,
+ getProject().getProperty(propertyName));
}
}
}
1.10 +1 -1 jakarta-turbine-maven/src/templates/xdocs/maven-reports.xml
Index: maven-reports.xml
===================================================================
RCS file: /home/cvs/jakarta-turbine-maven/src/templates/xdocs/maven-reports.xml,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- maven-reports.xml 16 Jun 2002 17:18:14 -0000 1.9
+++ maven-reports.xml 16 Jun 2002 17:54:15 -0000 1.10
@@ -75,7 +75,7 @@
</td>
</tr>
#end
- #if ($files.file("$maven.docs.dest/clover").exists())
+ #if ($files.file("$maven-docs-dest/clover").exists())
<tr><td><a href="clover/index.html">Clover Test Coverage</a></td>
<td>
This document provides the results of the Clover report. This
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>