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/08 21:42:07 UTC

svn commit: r1860864 - /velocity/engine/branches/parser_experiments/velocity-engine-core/pom.xml

Author: cbrisson
Date: Sat Jun  8 21:42:07 2019
New Revision: 1860864

URL: http://svn.apache.org/viewvc?rev=1860864&view=rev
Log:
[engine][VELOCITY-917] Expose raw grammar file in final jar

Modified:
    velocity/engine/branches/parser_experiments/velocity-engine-core/pom.xml

Modified: velocity/engine/branches/parser_experiments/velocity-engine-core/pom.xml
URL: http://svn.apache.org/viewvc/velocity/engine/branches/parser_experiments/velocity-engine-core/pom.xml?rev=1860864&r1=1860863&r2=1860864&view=diff
==============================================================================
--- velocity/engine/branches/parser_experiments/velocity-engine-core/pom.xml (original)
+++ velocity/engine/branches/parser_experiments/velocity-engine-core/pom.xml Sat Jun  8 21:42:07 2019
@@ -55,14 +55,12 @@
     <build>
         <plugins>
             <!-- maven lifecycle debugging plugin, see 'mvn buildplan:help' -->
-
             <plugin>
                 <groupId>fr.jcgay.maven.plugins</groupId>
                 <artifactId>buildplan-maven-plugin</artifactId>
                 <version>1.3</version>
             </plugin>
 
-            <!-- prepare parser grammar file -->
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-resources-plugin</artifactId>
@@ -74,8 +72,9 @@
                     </delimiters>
                 </configuration>
                 <executions>
+                    <!-- prepare parser grammar file -->
                     <execution>
-                        <id>gen-parser-grammar</id>
+                        <id>generate-parser-grammar</id>
                         <phase>generate-sources</phase>
                         <goals>
                             <goal>copy-resources</goal>
@@ -90,6 +89,23 @@
                             <outputDirectory>${project.build.directory}/parser</outputDirectory>
                         </configuration>
                     </execution>
+                    <!-- expose the raw grammar file for the custom parser maven plugin -->
+                    <execution>
+                        <id>expose-parser-grammar</id>
+                        <phase>process-resources</phase>
+                        <goals>
+                            <goal>copy-resources</goal>
+                        </goals>
+                        <configuration>
+                            <resources>
+                                <resource>
+                                    <directory>src/main/parser</directory>
+                                    <filtering>false</filtering>
+                                </resource>
+                            </resources>
+                            <outputDirectory>${project.build.outputDirectory}/org/apache/velocity/runtime/parser</outputDirectory>
+                        </configuration>
+                    </execution>
                 </executions>
             </plugin>
 
@@ -161,53 +177,6 @@
                 </executions>
             </plugin>
 
-            <!--
-                patch generated parser and token manager files, so that
-                + token manager implement the ParserTokenManager interface
-                + StandardParser uses the ParserTokenManager interface
-            <plugin>
-                <groupId>com.google.code.maven-replacer-plugin</groupId>
-                <artifactId>replacer</artifactId>
-                <version>1.5.3</version>
-                <executions>
-                    <execution>
-                        <id>patch-parser</id>
-                        <phase>generate-sources</phase>
-                        <goals>
-                            <goal>replace</goal> 
-                        </goals>
-                        <configuration>
-                            <file>${project.build.directory}/generated-sources/javacc/org/apache/velocity/runtime/parser/StandardParser.java</file>
-                            <replacements>
-                                <replacement>
-                                    <token>(?&lt;!new )StandardParserTokenManager</token>
-                                    <value>ParserTokenManager</value>
-                                </replacement>
-                            </replacements>
-                        </configuration>
-                    </execution>
-                    <execution>
-                        <id>patch-token-manager</id>
-                        <phase>generate-sources</phase>
-                        <goals>
-                            <goal>replace</goal> 
-                        </goals> 
-                        <configuration>
-                            <includes>
-                                <include>${project.build.directory}/generated-sources/javacc/org/apache/velocity/runtime/parser/StandardParserTokenManager.java</include>
-                            </includes>
-                            <replacements>
-                                <replacement>
-                                    <token>class StandardParserTokenManager implements StandardParserConstants(?!, ParserTokenManager)</token>
-                                    <value>class StandardParserTokenManager implements StandardParserConstants, ParserTokenManager</value>
-                                </replacement> 
-                            </replacements>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-            -->
-
             <!-- handle OSGi informations -->
             <plugin>
                 <groupId>org.apache.felix</groupId>