Author: cbrisson
Date: Sat Nov  2 22:04:06 2019
New Revision: 1869304

URL: http://svn.apache.org/viewvc?rev=1869304&view=rev
Log:
[core] Easier maven solution for VelocityEngineVersion source file templating

Added:
    velocity/engine/trunk/velocity-engine-core/src/main/java-templates/
    velocity/engine/trunk/velocity-engine-core/src/main/java-templates/org/
    
velocity/engine/trunk/velocity-engine-core/src/main/java-templates/org/apache/
    
velocity/engine/trunk/velocity-engine-core/src/main/java-templates/org/apache/velocity/
    
velocity/engine/trunk/velocity-engine-core/src/main/java-templates/org/apache/velocity/runtime/
    
velocity/engine/trunk/velocity-engine-core/src/main/java-templates/org/apache/velocity/runtime/VelocityEngineVersion.java
Removed:
    
velocity/engine/trunk/velocity-engine-core/src/main/resources/org/apache/velocity/runtime/VelocityEngineVersion.java
Modified:
    velocity/engine/trunk/velocity-engine-core/pom.xml

Modified: velocity/engine/trunk/velocity-engine-core/pom.xml
URL: 
http://svn.apache.org/viewvc/velocity/engine/trunk/velocity-engine-core/pom.xml?rev=1869304&r1=1869303&r2=1869304&view=diff
==============================================================================
--- velocity/engine/trunk/velocity-engine-core/pom.xml (original)
+++ velocity/engine/trunk/velocity-engine-core/pom.xml Sat Nov  2 22:04:06 2019
@@ -66,26 +66,6 @@
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-resources-plugin</artifactId>
                 <executions>
-                    <!-- put engine version in class 
org.apache.velocity.runtime.VelocityEngineVersion -->
-                    <execution>
-                        <id>filter-engine-version</id>
-                        <phase>process-sources</phase>
-                        <goals>
-                            <goal>copy-resources</goal>
-                        </goals>
-                        <configuration>
-                            <resources>
-                                <resource>
-                                    <directory>src/main/resources</directory>
-                                    <includes>
-                                        <include>**/*.java</include>
-                                    </includes>
-                                    <filtering>true</filtering>
-                                </resource>
-                            </resources>
-                            
<outputDirectory>${project.build.directory}/generated-sources/version</outputDirectory>
-                        </configuration>
-                    </execution>
                     <!-- prepare parser grammar file -->
                     <execution>
                         <id>generate-parser-grammar</id>
@@ -219,26 +199,20 @@
                 </executions>
             </plugin>
 
-            <!-- add VelocityEngineVersion source root -->
+            <!-- handle VelocityEngineVersion file -->
             <plugin>
                 <groupId>org.codehaus.mojo</groupId>
-                <artifactId>build-helper-maven-plugin</artifactId>
-                <version>3.0.0</version>
+                <artifactId>templating-maven-plugin</artifactId>
+                <version>1.0.0</version>
                 <executions>
                     <execution>
-                        <id>add-source</id>
-                        <phase>generate-sources</phase>
+                        <id>filter-src</id>
                         <goals>
-                            <goal>add-source</goal>
+                            <goal>filter-sources</goal>
                         </goals>
-                        <configuration>
-                            <sources>
-                                
<source>${project.build.directory}/generated-sources/version</source>
-                            </sources>
-                        </configuration>
                     </execution>
                 </executions>
-            </plugin>            
+            </plugin>
 
             <!-- handle OSGi information -->
             <plugin>
@@ -316,17 +290,8 @@
                     </execution>
                 </executions>
             </plugin>
-        </plugins>
-
-        <resources>
-            <resource>
-                <directory>src/main/resources</directory>
-                <includes>
-                    <include>**/*.properties</include>
-                </includes>
-            </resource>
-        </resources>
 
+        </plugins>
     </build>
 
     <dependencies>

Added: 
velocity/engine/trunk/velocity-engine-core/src/main/java-templates/org/apache/velocity/runtime/VelocityEngineVersion.java
URL: 
http://svn.apache.org/viewvc/velocity/engine/trunk/velocity-engine-core/src/main/java-templates/org/apache/velocity/runtime/VelocityEngineVersion.java?rev=1869304&view=auto
==============================================================================
--- 
velocity/engine/trunk/velocity-engine-core/src/main/java-templates/org/apache/velocity/runtime/VelocityEngineVersion.java
 (added)
+++ 
velocity/engine/trunk/velocity-engine-core/src/main/java-templates/org/apache/velocity/runtime/VelocityEngineVersion.java
 Sat Nov  2 22:04:06 2019
@@ -0,0 +1,6 @@
+package org.apache.velocity.runtime;
+
+public class VelocityEngineVersion
+{
+    public static final String VERSION = "${project.version}";
+}


Reply via email to