Skip to content

Commit 1ac6129

Browse files
committed
Upgrade to Velocity 2.3
1 parent d4f40a8 commit 1ac6129

File tree

5 files changed

+31
-27
lines changed

5 files changed

+31
-27
lines changed

pom.xml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ limitations under the License.
4747
</distributionManagement>
4848

4949
<properties>
50-
<slf4j.version>1.7.36</slf4j.version>
50+
<slf4jVersion>1.7.36</slf4jVersion>
5151
<project.build.outputTimestamp>2021-07-03T11:34:51Z</project.build.outputTimestamp>
5252
</properties>
5353

@@ -59,17 +59,23 @@ limitations under the License.
5959
<dependency>
6060
<groupId>org.apache.velocity</groupId>
6161
<artifactId>velocity-engine-core</artifactId>
62-
<version>2.0</version>
62+
<version>2.3</version>
63+
</dependency>
64+
<dependency>
65+
<groupId>junit</groupId>
66+
<artifactId>junit</artifactId>
67+
<scope>test</scope>
6368
</dependency>
6469
<dependency>
6570
<groupId>org.slf4j</groupId>
6671
<artifactId>slf4j-api</artifactId>
67-
<version>${slf4j.version}</version>
72+
<version>${slf4jVersion}</version>
73+
<scope>test</scope>
6874
</dependency>
6975
<dependency>
7076
<groupId>org.slf4j</groupId>
7177
<artifactId>slf4j-simple</artifactId>
72-
<version>${slf4j.version}</version>
78+
<version>${slf4jVersion}</version>
7379
<scope>test</scope>
7480
</dependency>
7581
</dependencies>

src/main/java/org/codehaus/plexus/velocity/DefaultVelocityComponent.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@ public void initialize()
6060
throws InitializationException
6161
{
6262
engine = new VelocityEngine();
63-
// avoid "unable to find resource 'VM_global_library.vm' in any resource loader."
64-
engine.setProperty( RuntimeConstants.VM_LIBRARY, "" );
6563
if ( properties != null )
6664
{
6765
engine.setProperties( properties );

src/main/resources/META-INF/plexus/components.xml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,44 +7,44 @@
77
<configuration>
88
<properties>
99
<property>
10-
<name>resource.loader</name>
10+
<name>resource.loaders</name>
1111
<value>classpath,file</value>
1212
</property>
1313
<property>
14-
<name>classpath.resource.loader.class</name>
14+
<name>resource.loader.classpath.class</name>
1515
<value>org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader</value>
1616
</property>
1717
<property>
18-
<name>file.resource.loader.class</name>
18+
<name>resource.loader.file.class</name>
1919
<value>org.apache.velocity.runtime.resource.loader.FileResourceLoader</value>
2020
</property>
2121
<property>
22-
<name>file.resource.loader.path</name>
22+
<name>resource.loader.file.path</name>
2323
<!-- This space intended! Actually Velocity expects an empty string but
2424
Plexus/XStream choke on it and skip the remaining configuration.
2525
Luckily, Plexus/XStream trim strings and we achieve the desired effect. -->
2626
<value> </value>
2727
</property>
2828
<property>
29-
<name>runtime.log.invalid.references</name>
29+
<name>runtime.log.log_invalid_references</name>
3030
<value>false</value>
3131
</property>
3232
<property>
33-
<name>velocimacro.messages.on</name>
33+
<name>resource.manager.log_when_found</name>
3434
<value>false</value>
3535
</property>
3636
<property>
37-
<name>resource.manager.logwhenfound</name>
38-
<value>false</value>
39-
</property>
40-
<property>
41-
<name>eventhandler.include.class</name>
37+
<name>event_handler.include.class</name>
4238
<value>org.apache.velocity.app.event.implement.IncludeRelativePath</value>
4339
</property>
4440
<property>
45-
<name>velocimacro.permissions.allow.inline.to.replace.global</name>
41+
<name>velocimacro.inline.replace_global</name>
4642
<value>true</value>
4743
</property>
44+
<property>
45+
<name>parser.space_gobbling</name>
46+
<value>bc</value>
47+
</property>
4848
</properties>
4949
</configuration>
5050
</component>

src/site/xdoc/index.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,18 @@ template.merge( context, writer );</source>
3434
<configuration>
3535
<properties>
3636
<property>
37-
<name>resource.loader</name>
37+
<name>resource.loaders</name>
3838
<value>classpath</value>
3939
</property>
4040
<property>
41-
<name>classpath.resource.loader.class</name>
41+
<name>resource.loader.classpath.class</name>
4242
<value>org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader</value>
4343
</property>
4444
</properties>
4545
</configuration>
4646
</component>]]></source>
4747
</p>
48-
<p>See <a href="https://velocity.apache.org/engine/2.0/configuration.html">Velocity Configuration</a>
48+
<p>See <a href="https://velocity.apache.org/engine/2.3/configuration.html">Velocity Configuration</a>
4949
reference documentation for details on available configurations.</p>
5050
</subsection>
5151
</section>

src/test/resources/org/codehaus/plexus/velocity/DefaultVelocityComponentTest.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@
77
<configuration>
88
<properties>
99
<property>
10-
<name>resource.loader</name>
11-
<value>classpath</value>
10+
<name>resource.loaders</name>
11+
<value>classpath</value>
1212
</property>
1313
<property>
14-
<name>classpath.resource.loader.class</name>
15-
<value>org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader</value>
14+
<name>resource.loader.classpath.class</name>
15+
<value>org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader</value>
1616
</property>
1717
<property>
18-
<name>hello</name>
19-
<value>world</value>
18+
<name>hello</name>
19+
<value>world</value>
2020
</property>
2121
</properties>
2222
</configuration>

0 commit comments

Comments
 (0)