diff options
Diffstat (limited to 'velocity-engine-core')
3 files changed, 59 insertions, 4 deletions
diff --git a/velocity-engine-core/pom.xml b/velocity-engine-core/pom.xml index a06956ec..592d1a4b 100644 --- a/velocity-engine-core/pom.xml +++ b/velocity-engine-core/pom.xml @@ -66,6 +66,26 @@ <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> @@ -75,7 +95,6 @@ </goals> <configuration> <useDefaultDelimiters>false</useDefaultDelimiters> - <delimiters> <delimiter>${*}</delimiter> </delimiters> @@ -200,6 +219,27 @@ </executions> </plugin> + <!-- add VelocityEngineVersion source root --> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>build-helper-maven-plugin</artifactId> + <version>3.0.0</version> + <executions> + <execution> + <id>add-source</id> + <phase>generate-sources</phase> + <goals> + <goal>add-source</goal> + </goals> + <configuration> + <sources> + <source>${project.build.directory}/generated-sources/version</source> + </sources> + </configuration> + </execution> + </executions> + </plugin> + <!-- handle OSGi information --> <plugin> <groupId>org.apache.felix</groupId> @@ -276,8 +316,17 @@ </execution> </executions> </plugin> - </plugins> + + <resources> + <resource> + <directory>src/main/resources</directory> + <includes> + <include>**/*.properties</include> + </includes> + </resource> + </resources> + </build> <dependencies> @@ -321,7 +370,7 @@ <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>findbugs-maven-plugin</artifactId> - <version>3.0.4</version> + <version>3.0.5</version> <configuration> <xmlOutput>true</xmlOutput> <threshold>Low</threshold> diff --git a/velocity-engine-core/src/main/java/org/apache/velocity/runtime/RuntimeInstance.java b/velocity-engine-core/src/main/java/org/apache/velocity/runtime/RuntimeInstance.java index 3049e76e..39f3c0aa 100644 --- a/velocity-engine-core/src/main/java/org/apache/velocity/runtime/RuntimeInstance.java +++ b/velocity-engine-core/src/main/java/org/apache/velocity/runtime/RuntimeInstance.java @@ -273,7 +273,7 @@ public class RuntimeInstance implements RuntimeConstants, RuntimeServices initializing = true; log.trace("*****************************"); - log.debug("Starting Apache Velocity v2.0"); + log.debug("Starting Apache Velocity v" + VelocityEngineVersion.VERSION); log.trace("RuntimeInstance initializing."); initializeProperties(); diff --git a/velocity-engine-core/src/main/resources/org/apache/velocity/runtime/VelocityEngineVersion.java b/velocity-engine-core/src/main/resources/org/apache/velocity/runtime/VelocityEngineVersion.java new file mode 100644 index 00000000..e3a2dc8d --- /dev/null +++ b/velocity-engine-core/src/main/resources/org/apache/velocity/runtime/VelocityEngineVersion.java @@ -0,0 +1,6 @@ +package org.apache.velocity.runtime; + +public class VelocityEngineVersion +{ + public static final String VERSION = "${project.version}"; +} |