Apache Velocity

Velocity是一个基于Java的模板引擎。 它允许任何人使用简单而强大的模板语言来引用Java代码中定义的对象。该repo是Apache Velocity Engine的镜像。「Velocity is a Java-based template engine. It permits anyone to use a simple yet powerful template language to reference objects defined in Java code. Mirror of Apache Velocity Engine.」

Github stars Tracking Chart

Velocity是一个基于Java的模板引擎。 它允许任何人使用简单而强大的模板语言来引用Java代码中定义的对象。

当Velocity用于Web开发时,Web设计人员可以与Java程序员并行工作, 根据模型 - 视图 - 控制器(MVC)模型开发Web站点,这意味着网页设计人员可以专注于创建一个看起来很好的站点,程序员可以专注于编写一流的代码。 Velocity将Java代码与网页分开,使网站在其生命周期内更加可维护,并为Java Server Pages(JSP)或PHP提供了可行的替代方案。

Velocity的功能远远超出了网络的范围;例如,它可以用于从模板生成SQL,PostScript和XML。它可以用作生成源代码和报告的独立实用程序,也可以用作其他系统的集成组件。例如,Velocity为各种Web框架提供模板服务,使他们能够根据真正的MVC模型,使视图引擎促进Web应用程序的开发。

Velocity是Apache Software Foundation的一个项目,负责创建和维护与Apache Velocity Engine相关的开源软件。在Velocity项目中创建的所有软件都可以在Apache软件许可证下免费提供给公众。

Overview

Name With Ownerapache/velocity-engine
Primary LanguageJava
Program languageJava (Language Count: 3)
PlatformBSD, Linux, Mac, Solaris, Windows
License:Apache License 2.0
Release Count54
Last Release Name2.3 (Posted on 2021-03-07 12:37:09)
First Release NameV_1_0B1 (Posted on 2006-12-01 16:39:58)
Created At2013-11-22 08:00:13
Pushed At2024-04-14 13:10:03
Last Commit At2024-02-16 22:09:43
Stargazers Count356
Watchers Count38
Fork Count125
Commits Count4.4k
Has Issues Enabled
Issues Count0
Issue Open Count0
Pull Requests Count21
Pull Requests Open Count2
Pull Requests Close Count16
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private

Apache Velocity

Welcome to Apache Velocity Engine! Apache Velocity is a general purpose
template engine written in Java. For more information about Velocity,
please look at the HTML documentation on the Velocity web site:

http://velocity.apache.org/index.html

Here's a description of the top level directories:

velocity-engine-core/       The Velocity Engine core module
velocity-engine-examples/   Several simple examples
velocity-engine-scripting/  JSR-223 implementation for Velocity scripting
src/                        Source for parent modules, mainly changelog

REQUIREMENTS

Apache Velocity 2.1 will run with any Java runtime engine v1.8 or greater.

Building from source requires Java development kit v1.8 or greater and Maven 3 (3.0.5+).

At compile time, Maven should fetch all needed dependencies, which are:

  • commons-lang v3.8.1
  • slf4j-api v1.7.26
    plus the following ones, needed for the integrated tests:
  • slf4j-simple v1.7.26
  • junit v4.12
  • hsqldb v2.3.4
  • commons-io 2.6

At runtime, Velocity only needs:

  • commons-lang v3.8.1+
  • slf4j-api and an slf4j binding, v1.7.26+

BUILDING APACHE VELOCITY

In order to use the latest version of Apache Velocity, you may want to
build it.

Building is easy. All components necessary to build are included or
get downloaded from the internet during the build, except for the Java
SDK and the Maven build tool. You can find details on how to build
Velocity online at:

http://velocity.apache.org/engine/devel/build.html

IMPORTANT As the Apache Velocity build process wants to download a
number of jars from the internet, you must be online when you are
building for the first time.

To build Velocity's jar, just run maven using the command:

mvn

This will create a target/ directory containing the Velocity .jar
file in each sub-module directory.

Be sure to update your classpath to include Velocity's .jar
file, or when using a modern servlet container, put it in the
WEB-INF/lib directory.

TRYING THE EXAMPLES

After building Velocity, you can also build the examples that are
included with the Velocity distribution. These examples show how to
use Velocity in your Java applications.

For more information, please see the README.txt in the
velocity-engine-examples/src/etc/ directory.

  • The Apache Velocity Team
To the top