-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ARCHETYPE-667] Upgrade Velocity from 1.7 to 2.3
- Loading branch information
1 parent
cc90667
commit 04247f1
Showing
7 changed files
with
87 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
archetype-common/src/main/java/org/apache/maven/archetype/VelocityConfigurator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
package org.apache.maven.archetype; | ||
|
||
import javax.inject.Named; | ||
import javax.inject.Singleton; | ||
|
||
import java.util.Properties; | ||
|
||
import org.codehaus.plexus.velocity.VelocityComponentConfigurator; | ||
|
||
/** | ||
* Velocity configurator. Used by {@link org.codehaus.plexus.velocity.VelocityComponent} | ||
* <p/> | ||
* Preserve compatibility of Velocity 2.2 with Velocity 1.x | ||
* <a href="https://velocity.apache.org/engine/2.3/upgrading.html">Velocity Upgrading</a> | ||
*/ | ||
@Named | ||
@Singleton | ||
class VelocityConfigurator implements VelocityComponentConfigurator { | ||
|
||
@Override | ||
public void configure(Properties properties) { | ||
|
||
// # No automatic conversion of methods arguments | ||
properties.put("introspector.conversion_handler.class", "none"); | ||
|
||
// # Use backward compatible space gobbling | ||
properties.put("parser.space_gobbling", "bc"); | ||
|
||
// # Have #if($foo) only returns false if $foo is false or null | ||
properties.put("directive.if.empty_check", false); | ||
|
||
// # Allow '-' in identifiers (since 2.1) | ||
properties.put("parser.allow_hyphen_in_identifiers", true); | ||
|
||
// # Enable backward compatibility mode for Velocimacros | ||
properties.put("velocimacro.enable_bc_mode", true); | ||
|
||
// # When using an invalid reference handler, also include quiet references (since 2.2) | ||
properties.put("event_handler.invalid_references.quiet", "true"); | ||
|
||
// # When using an invalid reference handler, also include null references (since 2.2) | ||
properties.put("event_handler.invalid_references.null", true); | ||
|
||
// # When using an invalid reference handler, also include tested references (since 2.2) | ||
properties.put("event_handler.invalid_references.tested", true); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters