Skip to content

Commit

Permalink
Upgrade to Velocity 2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-o committed May 15, 2022
1 parent d4f40a8 commit 1ac6129
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 27 deletions.
14 changes: 10 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ limitations under the License.
</distributionManagement>

<properties>
<slf4j.version>1.7.36</slf4j.version>
<slf4jVersion>1.7.36</slf4jVersion>
<project.build.outputTimestamp>2021-07-03T11:34:51Z</project.build.outputTimestamp>
</properties>

Expand All @@ -59,17 +59,23 @@ limitations under the License.
<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity-engine-core</artifactId>
<version>2.0</version>
<version>2.3</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
<version>${slf4jVersion}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>${slf4j.version}</version>
<version>${slf4jVersion}</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ public void initialize()
throws InitializationException
{
engine = new VelocityEngine();
// avoid "unable to find resource 'VM_global_library.vm' in any resource loader."
engine.setProperty( RuntimeConstants.VM_LIBRARY, "" );
if ( properties != null )
{
engine.setProperties( properties );
Expand Down
24 changes: 12 additions & 12 deletions src/main/resources/META-INF/plexus/components.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,44 +7,44 @@
<configuration>
<properties>
<property>
<name>resource.loader</name>
<name>resource.loaders</name>
<value>classpath,file</value>
</property>
<property>
<name>classpath.resource.loader.class</name>
<name>resource.loader.classpath.class</name>
<value>org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader</value>
</property>
<property>
<name>file.resource.loader.class</name>
<name>resource.loader.file.class</name>
<value>org.apache.velocity.runtime.resource.loader.FileResourceLoader</value>
</property>
<property>
<name>file.resource.loader.path</name>
<name>resource.loader.file.path</name>
<!-- This space intended! Actually Velocity expects an empty string but
Plexus/XStream choke on it and skip the remaining configuration.
Luckily, Plexus/XStream trim strings and we achieve the desired effect. -->
<value> </value>
</property>
<property>
<name>runtime.log.invalid.references</name>
<name>runtime.log.log_invalid_references</name>
<value>false</value>
</property>
<property>
<name>velocimacro.messages.on</name>
<name>resource.manager.log_when_found</name>
<value>false</value>
</property>
<property>
<name>resource.manager.logwhenfound</name>
<value>false</value>
</property>
<property>
<name>eventhandler.include.class</name>
<name>event_handler.include.class</name>
<value>org.apache.velocity.app.event.implement.IncludeRelativePath</value>
</property>
<property>
<name>velocimacro.permissions.allow.inline.to.replace.global</name>
<name>velocimacro.inline.replace_global</name>
<value>true</value>
</property>
<property>
<name>parser.space_gobbling</name>
<value>bc</value>
</property>
</properties>
</configuration>
</component>
Expand Down
6 changes: 3 additions & 3 deletions src/site/xdoc/index.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,18 @@ template.merge( context, writer );</source>
<configuration>
<properties>
<property>
<name>resource.loader</name>
<name>resource.loaders</name>
<value>classpath</value>
</property>
<property>
<name>classpath.resource.loader.class</name>
<name>resource.loader.classpath.class</name>
<value>org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader</value>
</property>
</properties>
</configuration>
</component>]]></source>
</p>
<p>See <a href="https://velocity.apache.org/engine/2.0/configuration.html">Velocity Configuration</a>
<p>See <a href="https://velocity.apache.org/engine/2.3/configuration.html">Velocity Configuration</a>
reference documentation for details on available configurations.</p>
</subsection>
</section>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@
<configuration>
<properties>
<property>
<name>resource.loader</name>
<value>classpath</value>
<name>resource.loaders</name>
<value>classpath</value>
</property>
<property>
<name>classpath.resource.loader.class</name>
<value>org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader</value>
<name>resource.loader.classpath.class</name>
<value>org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader</value>
</property>
<property>
<name>hello</name>
<value>world</value>
<name>hello</name>
<value>world</value>
</property>
</properties>
</configuration>
Expand Down

0 comments on commit 1ac6129

Please sign in to comment.