You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@velocity.apache.org by cb...@apache.org on 2019/06/12 00:46:11 UTC

svn commit: r1861082 - in /velocity/engine/branches/parser_experiments: pom.xml velocity-custom-parser-example/pom.xml velocity-engine-core/src/main/parser/Parser.jjt

Author: cbrisson
Date: Wed Jun 12 00:46:11 2019
New Revision: 1861082

URL: http://svn.apache.org/viewvc?rev=1861082&view=rev
Log:
Fixes following Michael's comments:

+ move common plugin versions from child poms to parent one
+ remove duplicate defaultGoal
+ fix and add comments here and there
+ move fetch-grammar-file to initialize phase
+ fix maven-resources-plugin configuration


Modified:
    velocity/engine/branches/parser_experiments/pom.xml
    velocity/engine/branches/parser_experiments/velocity-custom-parser-example/pom.xml
    velocity/engine/branches/parser_experiments/velocity-engine-core/src/main/parser/Parser.jjt

Modified: velocity/engine/branches/parser_experiments/pom.xml
URL: http://svn.apache.org/viewvc/velocity/engine/branches/parser_experiments/pom.xml?rev=1861082&r1=1861081&r2=1861082&view=diff
==============================================================================
--- velocity/engine/branches/parser_experiments/pom.xml (original)
+++ velocity/engine/branches/parser_experiments/pom.xml Wed Jun 12 00:46:11 2019
@@ -86,6 +86,16 @@
                         </execution>
                     </executions>
                 </plugin>
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-dependency-plugin</artifactId>
+                    <version>3.1.1</version>
+                </plugin>
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-resources-plugin</artifactId>
+                    <version>3.1.0</version>
+                </plugin>
             </plugins>
         </pluginManagement>
         <plugins>

Modified: velocity/engine/branches/parser_experiments/velocity-custom-parser-example/pom.xml
URL: http://svn.apache.org/viewvc/velocity/engine/branches/parser_experiments/velocity-custom-parser-example/pom.xml?rev=1861082&r1=1861081&r2=1861082&view=diff
==============================================================================
--- velocity/engine/branches/parser_experiments/velocity-custom-parser-example/pom.xml (original)
+++ velocity/engine/branches/parser_experiments/velocity-custom-parser-example/pom.xml Wed Jun 12 00:46:11 2019
@@ -28,25 +28,30 @@
     </parent>
 
     <artifactId>velocity-custom-parser-example</artifactId>
-    <name>Apache Velocity Custom Parser - Example</name>
+    <name>Apache Velocity Custom Parser Example</name>
     <description>Custom Parser Example for Apache Velocity</description>
 
     <packaging>jar</packaging>
 
     <!--
-      This plugin demonstrates how to build a custom Velocity parser.
-      The proposed custom parser replaces '#' with '@' and '@' with '%',
+      This module demonstrates how to build a custom Velocity parser.
+      The proposed custom parser replaces '#' with '@' and '@' with '%'
       so that it's suitable to use with Markdown template files, for instance.
 
       The generated parser class is org.apache.velocity.runtime.parser.${parser.name}Parser,
-      and must be specified at runtime using the Velocity property parser.class :
+      and must be specified at runtime using the Velocity property parser.class:
         parser.class = org.apache.velocity.runtime.parser.MyCustomParser
+
+      Please note that:
+
+      + all configurable chars must be specified, even when similar to default ones.
+      + custom parser package **must** be org.apache.velocity.runtime.parser
     -->
 
     <properties>
         <!-- whether to display debug logs while parsing -->
         <parser.debug>false</parser.debug>
-        <!-- parser name -->
+        <!-- parser basename -->
         <parser.name>Custom</parser.name>
         <!-- character to substitute to '*' -->
         <parser.char.asterisk>*</parser.char.asterisk>
@@ -84,7 +89,6 @@
     </dependencies>
 
     <build>
-        <defaultGoal>install</defaultGoal>
         <plugins>
             <!-- generate manifest file -->
             <plugin>
@@ -95,11 +99,10 @@
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-dependency-plugin</artifactId>
-                <version>3.1.1</version>
                 <executions>
                     <execution>
                         <id>fetch-grammar-file</id>
-                        <phase>generate-sources</phase>
+                        <phase>initialize</phase>
                         <goals>
                             <goal>unpack</goal>
                         </goals>
@@ -115,13 +118,6 @@
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-resources-plugin</artifactId>
-                <version>3.1.0</version>
-                <configuration>
-                    <useDefaultDelimiters>false</useDefaultDelimiters>
-                    <delimiters>
-                        <delimiter>${*}</delimiter>
-                    </delimiters>
-                </configuration>
                 <executions>
                     <execution>
                         <id>generate-parser-grammar</id>
@@ -130,6 +126,10 @@
                             <goal>copy-resources</goal>
                         </goals>
                         <configuration>
+                            <useDefaultDelimiters>false</useDefaultDelimiters>
+                            <delimiters>
+                                <delimiter>${*}</delimiter>
+                            </delimiters>
                             <resources>
                                 <resource>
                                     <directory>${project.build.directory}/grammar</directory>

Modified: velocity/engine/branches/parser_experiments/velocity-engine-core/src/main/parser/Parser.jjt
URL: http://svn.apache.org/viewvc/velocity/engine/branches/parser_experiments/velocity-engine-core/src/main/parser/Parser.jjt?rev=1861082&r1=1861081&r2=1861082&view=diff
==============================================================================
--- velocity/engine/branches/parser_experiments/velocity-engine-core/src/main/parser/Parser.jjt (original)
+++ velocity/engine/branches/parser_experiments/velocity-engine-core/src/main/parser/Parser.jjt Wed Jun 12 00:46:11 2019
@@ -108,7 +108,7 @@ import org.slf4j.Logger;
  * @author <a href="hps@intermeta.de">Henning P. Schmiedehausen</a>
  * @version $Id: $
 */
-public class ${parser.name}Parser implements Parser
+public class ${parser.name}Parser implements org.apache.velocity.runtime.parser.Parser
 {
     /**
      * Parser debugging flag.