用Eclipse创建Servlet+Velocity的webapp

本文详细介绍了Velocity模版引擎如何与Servlet结合使用,包括配置步骤、数据传递方法及示例代码。重点阐述了如何在Servlet与模版文件之间进行数据交互,以实现动态页面生成。

velocity是模版引擎,简单说就是替代jsp的一个东西。

前一阵子用过webpy和它默认额templetor模版,明白了render(渲染)是怎么会事儿:模版文件主体是html,用于展示页面,页面中会变化的那些数据则使用模版语法调用后端脚本语言的对象来实现。webpy的templetor给我的感觉是渲染是在server端进行的,其他渲染模版应该也一样。简言之,渲染就是server端将夹杂有脚本语言变量对象的模版文件解释为纯html页面的过程!

velocity可以和struts,spring mvc等框架结合使用,当然最基本的是纯Servlet+Velocity的组合。

velocity当前版本1.7,使用Servlet时候需呀velocity和velocity tools包,使用后者中的VelocityViewServlet。以前1.4版本和之前用的VelocityServlet已经不推荐使用。

Eclipse中创建最简单Servlet+Velocity的webapp,过程:

  1. 新建Dynamic web app,配置tomcat等应用容器

  2. 修改web.xml配置文件:

    1. <?xml version="1.0" encoding="UTF-8"?>
      <web-app>
        <servlet>
          <servlet-name>velocity</servlet-name>
          <servlet-class>org.apache.velocity.tools.view.VelocityViewServlet</servlet-class>
        </servlet>
        <servlet-mapping>
          <servlet-name>velocity</servlet-name>
          <url-pattern>*.vm</url-pattern>
        </servlet-mapping>
        <welcome-file-list>
          <welcome-file>index.vm</welcome-file>
        </welcome-file-list>
      </web-app>
  3. 在web.xml同一级路径下添加velocity.properties:

    1. velocimacro.library = /WEB-INF/VM_global_library.vm
      velocimacro.permissions.allow.inline = true
      velocimacro.permissions.allow.inline.to.replace.global = false
      velocimacro.permissions.allow.inline.local.scope = false
      velocimacro.context.localscope = false
  4. 在webapp根目录下创建index.vm模版文件(velocity template,所以后缀是vm):

    1. <html>
      <body>
      I'm a velocity template.
      
      #if ($XHTML)
      	#set( $br="<br />")
      #else
      	#set( $br="<br>")
      #end
      
      $br
      $br
      </body>
      </html>

好了,项目可以运行了。因为就是要run通一个最简单的Servlet+Velocity的webapp。部署到server上,打开localhost://your_app_name/index.vm查看页面

193205_Hssx_869489.png

好吧,确实太简陋了什么都做不了。后台的servlet和前台模版之间连数据交互都没有,怎么搞呢?

=========================

可能是后台servlet和前台vm模版文件之间数据交互太低级了以至于网上的教程中我没找到明确说怎么传递的:(

先前用过web.py+templetor组合中,传递的数据是以参数形式传递的,不过在velocity中,自定义的Servlet通过继承VelocityViewServlet类,并重写protected Template handleRequest(HttpServletRequest request,HttpServletResponse response, Context ctx)这一方法,就相当于原来的HttpServlet的doPost( )方法了,其中的ctx参数是一个「数据容器」,把需要传递给vm模版文件的数据扔进去就好了(调用.put( )方法来插入key-value对)。

比如这么写:

package com.velocity.servlet;

import java.util.ArrayList;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.velocity.Template;
import org.apache.velocity.context.Context;
import org.apache.velocity.tools.view.VelocityViewServlet;

import com.velocity.bean.Department;
import com.velocity.bean.Employee;


@SuppressWarnings("serial")
public class CustomerVelocityServlet extends VelocityViewServlet{

	
	//设置返回视图为text/html编码为utf-8
	@Override
	protected void setContentType(HttpServletRequest request,
			HttpServletResponse response) {
		response.setContentType("text/html;charset=utf-8");
	}
	
	//处理请求
	@Override
	protected Template handleRequest(HttpServletRequest request,
			HttpServletResponse response, Context ctx) {
		ctx.put("username", "张三");
		ctx.put("password", "123456789");
		ctx.put("age", "20");
		ctx.put("address", "陕西西安"); 
		ctx.put("blog", "http://blogjava.net/sxyx2008");
		
		List<Employee> list=new ArrayList<Employee>();
		list.add(new Employee(1,"张三","陕西西安",18,new Department(1,"软件研发部1")));
		list.add(new Employee(2,"张三","陕西西安",19,new Department(2,"软件研发部2")));
		list.add(new Employee(3,"张三","陕西西安",20,new Department(3,"软件研发部3")));
		list.add(new Employee(4,"张三","陕西西安",21,new Department(4,"软件研发部4")));
		list.add(new Employee(5,"张三","陕西西安",22,new Department(5,"软件研发部5")));
		list.add(new Employee(6,"张三","陕西西安",23,new Department(6,"软件研发部6")));
		list.add(new Employee(7,"张三","陕西西安",24,new Department(7,"软件研发部7")));
		list.add(new Employee(8,"张三","陕西西安",25,new Department(8,"软件研发部8")));
		list.add(new Employee(9,"张三","陕西西安",26,new Department(9,"软件研发部9")));
		list.add(new Employee(10,"张三","陕西西安",27,new Department(10,"软件研发部10")));
		
		ctx.put("list", list);
		//调用父类的方法getTemplate()
		//return getTemplate("demo.vm", "utf-8");
		return getTemplate("demo.vm");//!!!调用模版文件
	}
	
}


模版文件demo.vm内容为:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
 <HEAD>
  <TITLE> velocity </TITLE>
 </HEAD>

##嘿嘿,我是velocity中的注释噢
#*
	嘿嘿,我也是velocity中的注释噢
*#

 <BODY>
	<h1>hehe,这是经过由servlet返回的velocity视图</h1>
	hello ${username},这是你的信息
	<ul>
		<li>用户密码为:${password}</li>
		<li>年龄为:${age}</li>
		<li>出生地址为:${address}</li>
		<li>个人主页为:<a href='${blog}'>${blog}</a></li>
	</ul>
	
	<br/>
	
	#foreach($emp in $!{list})
		$!{velocityCount}&nbsp;&nbsp;&nbsp;&nbsp;
		$!{emp.id} &nbsp;&nbsp;&nbsp;&nbsp;
		$!{emp.ename} &nbsp;&nbsp;&nbsp;&nbsp;
		$!{emp.eaddress} &nbsp;&nbsp;&nbsp;&nbsp;
		$!{emp.age} &nbsp;&nbsp;&nbsp;&nbsp;
		$!{emp.department.id} &nbsp;&nbsp;&nbsp;&nbsp;
		$!{emp.department.deptname} <hr/>
	#end
	
 </BODY>
</HTML>

133217_1VKN_869489.png

好吧我承认这段代码也是网上copy来的,我只不过是把velocity的包换成最新的1.7版和velocity-tool2.0版本,发现也能运行,只不过包的引入VelocityViewServlet在新版中换了位置,从org.apache.velocity.tools.view.Servlet.VelocityViewServlet换到了org.apache.velocity.tools.view.VelocityViewServlet(少了包的最后一层路径)

工程下载:http://pan.baidu.com/s/1eQd9Kjg

转载于:https://my.oschina.net/u/869489/blog/374999

D:\dev\ide\IntelliJ IDEA 2025.2.1\plugins\maven\lib\maven3\bin\mvn.cmd -Didea.version=2025.2.1 -Dmaven.ext.class.path=D:\dev\ide\IntelliJ IDEA 2025.2.1\plugins\maven\lib\maven-event-listener.jar -Djansi.passthrough=true -Dstyle.color=always -Dmaven.repo.local=C:\Users\66928\.m2\repository dependency:tree -f pom.xml [INFO] Scanning for projects... Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-antrun-plugin/3.1.0/maven-antrun-plugin-3.1.0.pom Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-antrun-plugin/3.1.0/maven-antrun-plugin-3.1.0.pom (9.1 kB at 12 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-antrun-plugin/3.1.0/maven-antrun-plugin-3.1.0.jar Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-antrun-plugin/3.1.0/maven-antrun-plugin-3.1.0.jar (41 kB at 179 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-assembly-plugin/3.7.1/maven-assembly-plugin-3.7.1.pom Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-assembly-plugin/3.7.1/maven-assembly-plugin-3.7.1.pom (15 kB at 68 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-assembly-plugin/3.7.1/maven-assembly-plugin-3.7.1.jar Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-assembly-plugin/3.7.1/maven-assembly-plugin-3.7.1.jar (240 kB at 395 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-dependency-plugin/3.7.0/maven-dependency-plugin-3.7.0.pom Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-dependency-plugin/3.7.0/maven-dependency-plugin-3.7.0.pom (19 kB at 80 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-dependency-plugin/3.7.0/maven-dependency-plugin-3.7.0.jar Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-dependency-plugin/3.7.0/maven-dependency-plugin-3.7.0.jar (207 kB at 819 kB/s) [INFO] [INFO] --------------------< com.example:bigdata-project >--------------------- [INFO] Building BigDataProject 1.0.0 [INFO] from pom.xml [INFO] --------------------------------[ jar ]--------------------------------- [INFO] [INFO] --- dependency:3.7.0:tree (default-cli) @ bigdata-project --- Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/doxia/doxia-sink-api/1.12.0/doxia-sink-api-1.12.0.pom Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/doxia/doxia-sink-api/1.12.0/doxia-sink-api-1.12.0.pom (1.5 kB at 6.7 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/doxia/doxia/1.12.0/doxia-1.12.0.pom Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/doxia/doxia/1.12.0/doxia-1.12.0.pom (18 kB at 82 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/doxia/doxia-logging-api/1.12.0/doxia-logging-api-1.12.0.pom Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/doxia/doxia-logging-api/1.12.0/doxia-logging-api-1.12.0.pom (1.5 kB at 6.9 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/reporting/maven-reporting-impl/3.2.0/maven-reporting-impl-3.2.0.pom Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/reporting/maven-reporting-impl/3.2.0/maven-reporting-impl-3.2.0.pom (7.6 kB at 36 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/org/apache/commons/commons-text/1.12.0/commons-text-1.12.0.pom Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/commons/commons-text/1.12.0/commons-text-1.12.0.pom (20 kB at 86 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-dependency-analyzer/1.14.1/maven-dependency-analyzer-1.14.1.pom Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-dependency-analyzer/1.14.1/maven-dependency-analyzer-1.14.1.pom (6.4 kB at 27 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-shared-components/42/maven-shared-components-42.pom Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-shared-components/42/maven-shared-components-42.pom (3.8 kB at 17 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/org/assertj/assertj-bom/3.25.3/assertj-bom-3.25.3.pom Downloaded from central: https://repo.maven.apache.org/maven2/org/assertj/assertj-bom/3.25.3/assertj-bom-3.25.3.pom (3.7 kB at 17 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/org/ow2/asm/asm/9.7/asm-9.7.pom Downloaded from central: https://repo.maven.apache.org/maven2/org/ow2/asm/asm/9.7/asm-9.7.pom (2.4 kB at 11 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-dependency-tree/3.3.0/maven-dependency-tree-3.3.0.pom Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-dependency-tree/3.3.0/maven-dependency-tree-3.3.0.pom (7.0 kB at 32 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/resolver/maven-resolver-util/1.4.1/maven-resolver-util-1.4.1.pom Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/resolver/maven-resolver-util/1.4.1/maven-resolver-util-1.4.1.pom (2.8 kB at 13 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/resolver/maven-resolver/1.4.1/maven-resolver-1.4.1.pom Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/resolver/maven-resolver/1.4.1/maven-resolver-1.4.1.pom (18 kB at 82 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/resolver/maven-resolver-api/1.4.1/maven-resolver-api-1.4.1.pom Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/resolver/maven-resolver-api/1.4.1/maven-resolver-api-1.4.1.pom (2.6 kB at 12 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-artifact-transfer/0.13.1/maven-artifact-transfer-0.13.1.pom Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-artifact-transfer/0.13.1/maven-artifact-transfer-0.13.1.pom (11 kB at 52 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-common-artifact-filters/3.1.0/maven-common-artifact-filters-3.1.0.pom Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-common-artifact-filters/3.1.0/maven-common-artifact-filters-3.1.0.pom (5.3 kB at 24 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/doxia/doxia-sink-api/1.12.0/doxia-sink-api-1.12.0.jar Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/doxia/doxia-sink-api/1.12.0/doxia-sink-api-1.12.0.jar (12 kB at 53 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/doxia/doxia-logging-api/1.12.0/doxia-logging-api-1.12.0.jar Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/reporting/maven-reporting-api/3.1.1/maven-reporting-api-3.1.1.jar Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/reporting/maven-reporting-impl/3.2.0/maven-reporting-impl-3.2.0.jar Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/doxia/doxia-decoration-model/1.11.1/doxia-decoration-model-1.11.1.jar Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/doxia/doxia-core/1.11.1/doxia-core-1.11.1.jar Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/doxia/doxia-logging-api/1.12.0/doxia-logging-api-1.12.0.jar (12 kB at 54 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/org/apache/commons/commons-lang3/3.8.1/commons-lang3-3.8.1.jar Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/commons/commons-lang3/3.8.1/commons-lang3-3.8.1.jar (502 kB at 960 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/org/apache/commons/commons-text/1.12.0/commons-text-1.12.0.jar Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/reporting/maven-reporting-impl/3.2.0/maven-reporting-impl-3.2.0.jar (20 kB at 33 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/org/apache/httpcomponents/httpcore/4.4.14/httpcore-4.4.14.jar Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/doxia/doxia-decoration-model/1.11.1/doxia-decoration-model-1.11.1.jar (60 kB at 102 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/doxia/doxia-integration-tools/1.11.1/doxia-integration-tools-1.11.1.jar Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/reporting/maven-reporting-api/3.1.1/maven-reporting-api-3.1.1.jar (11 kB at 18 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/doxia/doxia-site-renderer/1.11.1/doxia-site-renderer-1.11.1.jar Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/commons/commons-text/1.12.0/commons-text-1.12.0.jar (251 kB at 316 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/doxia/doxia-skin-model/1.11.1/doxia-skin-model-1.11.1.jar Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/doxia/doxia-integration-tools/1.11.1/doxia-integration-tools-1.11.1.jar (47 kB at 58 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/doxia/doxia-module-xhtml/1.11.1/doxia-module-xhtml-1.11.1.jar Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/doxia/doxia-core/1.11.1/doxia-core-1.11.1.jar (218 kB at 243 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/doxia/doxia-module-xhtml5/1.11.1/doxia-module-xhtml5-1.11.1.jar Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/doxia/doxia-site-renderer/1.11.1/doxia-site-renderer-1.11.1.jar (65 kB at 66 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-velocity/1.2/plexus-velocity-1.2.jar Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/doxia/doxia-skin-model/1.11.1/doxia-skin-model-1.11.1.jar (16 kB at 16 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/org/apache/velocity/velocity/1.7/velocity-1.7.jar Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/doxia/doxia-module-xhtml/1.11.1/doxia-module-xhtml-1.11.1.jar (17 kB at 17 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/org/apache/velocity/velocity-tools/2.0/velocity-tools-2.0.jar Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/doxia/doxia-module-xhtml5/1.11.1/doxia-module-xhtml5-1.11.1.jar (18 kB at 16 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0.jar Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/httpcomponents/httpcore/4.4.14/httpcore-4.4.14.jar (328 kB at 273 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/commons-chain/commons-chain/1.1/commons-chain-1.1.jar Downloaded from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-velocity/1.2/plexus-velocity-1.2.jar (8.1 kB at 6.7 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/dom4j/dom4j/1.1/dom4j-1.1.jar Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/velocity/velocity/1.7/velocity-1.7.jar (450 kB at 342 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/oro/oro/2.0.8/oro-2.0.8.jar Downloaded from central: https://repo.maven.apache.org/maven2/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0.jar (189 kB at 141 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-archiver/4.9.2/plexus-archiver-4.9.2.jar Downloaded from central: https://repo.maven.apache.org/maven2/commons-chain/commons-chain/1.1/commons-chain-1.1.jar (90 kB at 63 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/commons-io/commons-io/2.15.1/commons-io-2.15.1.jar Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/velocity/velocity-tools/2.0/velocity-tools-2.0.jar (347 kB at 238 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/org/apache/commons/commons-compress/1.26.1/commons-compress-1.26.1.jar Downloaded from central: https://repo.maven.apache.org/maven2/oro/oro/2.0.8/oro-2.0.8.jar (65 kB at 42 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/commons-codec/commons-codec/1.16.1/commons-codec-1.16.1.jar Downloaded from central: https://repo.maven.apache.org/maven2/dom4j/dom4j/1.1/dom4j-1.1.jar (457 kB at 287 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/org/iq80/snappy/snappy/0.4/snappy-0.4.jar Downloaded from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-archiver/4.9.2/plexus-archiver-4.9.2.jar (225 kB at 139 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/org/tukaani/xz/1.9/xz-1.9.jar Downloaded from central: https://repo.maven.apache.org/maven2/org/iq80/snappy/snappy/0.4/snappy-0.4.jar (58 kB at 32 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/com/github/luben/zstd-jni/1.5.5-11/zstd-jni-1.5.5-11.jar Downloaded from central: https://repo.maven.apache.org/maven2/commons-codec/commons-codec/1.16.1/commons-codec-1.16.1.jar (365 kB at 199 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/4.0.1/plexus-utils-4.0.1.jar Downloaded from central: https://repo.maven.apache.org/maven2/org/tukaani/xz/1.9/xz-1.9.jar (116 kB at 63 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-io/3.4.2/plexus-io-3.4.2.jar Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/commons/commons-compress/1.26.1/commons-compress-1.26.1.jar (1.1 MB at 555 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-i18n/1.0-beta-10/plexus-i18n-1.0-beta-10.jar Downloaded from central: https://repo.maven.apache.org/maven2/commons-io/commons-io/2.15.1/commons-io-2.15.1.jar (501 kB at 244 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-dependency-analyzer/1.14.1/maven-dependency-analyzer-1.14.1.jar Downloaded from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-io/3.4.2/plexus-io-3.4.2.jar (79 kB at 38 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/org/ow2/asm/asm/9.7/asm-9.7.jar Downloaded from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/4.0.1/plexus-utils-4.0.1.jar (193 kB at 92 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-dependency-tree/3.3.0/maven-dependency-tree-3.3.0.jar Downloaded from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-i18n/1.0-beta-10/plexus-i18n-1.0-beta-10.jar (12 kB at 5.5 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-common-artifact-filters/3.3.2/maven-common-artifact-filters-3.3.2.jar Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-dependency-analyzer/1.14.1/maven-dependency-analyzer-1.14.1.jar (42 kB at 18 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-artifact-transfer/0.13.1/maven-artifact-transfer-0.13.1.jar Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-dependency-tree/3.3.0/maven-dependency-tree-3.3.0.jar (43 kB at 19 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-component-annotations/2.0.0/plexus-component-annotations-2.0.0.jar Downloaded from central: https://repo.maven.apache.org/maven2/org/ow2/asm/asm/9.7/asm-9.7.jar (125 kB at 54 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/resolver/maven-resolver-util/1.4.1/maven-resolver-util-1.4.1.jar Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-common-artifact-filters/3.3.2/maven-common-artifact-filters-3.3.2.jar (58 kB at 25 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/resolver/maven-resolver-api/1.4.1/maven-resolver-api-1.4.1.jar Downloaded from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-component-annotations/2.0.0/plexus-component-annotations-2.0.0.jar (4.2 kB at 1.7 kB/s) Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-artifact-transfer/0.13.1/maven-artifact-transfer-0.13.1.jar (159 kB at 63 kB/s) Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/resolver/maven-resolver-util/1.4.1/maven-resolver-util-1.4.1.jar (168 kB at 66 kB/s) Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/resolver/maven-resolver-api/1.4.1/maven-resolver-api-1.4.1.jar (149 kB at 57 kB/s) Downloaded from central: https://repo.maven.apache.org/maven2/com/github/luben/zstd-jni/1.5.5-11/zstd-jni-1.5.5-11.jar (6.8 MB at 2.5 MB/s) [INFO] com.example:bigdata-project:jar:1.0.0 [INFO] +- org.apache.hadoop:hadoop-common:jar:3.3.6:compile [INFO] | +- org.apache.hadoop.thirdparty:hadoop-shaded-protobuf_3_7:jar:1.1.1:compile [INFO] | +- org.apache.hadoop:hadoop-annotations:jar:3.3.6:compile [INFO] | | \- jdk.tools:jdk.tools:jar:1.8:system [INFO] | +- org.apache.hadoop.thirdparty:hadoop-shaded-guava:jar:1.1.1:compile [INFO] | +- com.google.guava:guava:jar:27.0-jre:compile [INFO] | | +- com.google.guava:failureaccess:jar:1.0:compile [INFO] | | +- com.google.guava:listenablefuture:jar:9999.0-empty-to-avoid-conflict-with-guava:compile [INFO] | | +- org.checkerframework:checker-qual:jar:2.5.2:compile [INFO] | | +- com.google.j2objc:j2objc-annotations:jar:1.1:compile [INFO] | | \- org.codehaus.mojo:animal-sniffer-annotations:jar:1.17:compile [INFO] | +- commons-cli:commons-cli:jar:1.2:compile [INFO] | +- org.apache.commons:commons-math3:jar:3.1.1:compile [INFO] | +- org.apache.httpcomponents:httpclient:jar:4.5.13:compile [INFO] | | \- org.apache.httpcomponents:httpcore:jar:4.4.13:compile [INFO] | +- commons-codec:commons-codec:jar:1.15:compile [INFO] | +- commons-io:commons-io:jar:2.8.0:compile [INFO] | +- commons-net:commons-net:jar:3.9.0:compile [INFO] | +- commons-collections:commons-collections:jar:3.2.2:compile [INFO] | +- javax.servlet:javax.servlet-api:jar:3.1.0:compile [INFO] | +- jakarta.activation:jakarta.activation-api:jar:1.2.1:compile [INFO] | +- org.eclipse.jetty:jetty-server:jar:9.4.51.v20230217:compile [INFO] | | +- org.eclipse.jetty:jetty-http:jar:9.4.51.v20230217:compile [INFO] | | \- org.eclipse.jetty:jetty-io:jar:9.4.51.v20230217:compile [INFO] | +- org.eclipse.jetty:jetty-util:jar:9.4.51.v20230217:compile [INFO] | +- org.eclipse.jetty:jetty-servlet:jar:9.4.51.v20230217:compile [INFO] | | +- org.eclipse.jetty:jetty-security:jar:9.4.51.v20230217:compile [INFO] | | \- org.eclipse.jetty:jetty-util-ajax:jar:9.4.51.v20230217:compile [INFO] | +- org.eclipse.jetty:jetty-webapp:jar:9.4.51.v20230217:compile [INFO] | | \- org.eclipse.jetty:jetty-xml:jar:9.4.51.v20230217:compile [INFO] | +- javax.servlet.jsp:jsp-api:jar:2.1:runtime [INFO] | +- com.sun.jersey:jersey-core:jar:1.19.4:compile [INFO] | | \- javax.ws.rs:jsr311-api:jar:1.1.1:compile [INFO] | +- com.sun.jersey:jersey-servlet:jar:1.19.4:compile [INFO] | +- com.github.pjfanning:jersey-json:jar:1.20:compile [INFO] | | +- org.codehaus.jettison:jettison:jar:1.1:compile [INFO] | | \- com.sun.xml.bind:jaxb-impl:jar:2.2.3-1:compile [INFO] | +- com.sun.jersey:jersey-server:jar:1.19.4:compile [INFO] | +- commons-logging:commons-logging:jar:1.1.3:compile [INFO] | +- ch.qos.reload4j:reload4j:jar:1.2.22:compile [INFO] | +- commons-beanutils:commons-beanutils:jar:1.9.4:compile [INFO] | +- org.apache.commons:commons-configuration2:jar:2.8.0:compile [INFO] | +- org.apache.commons:commons-lang3:jar:3.12.0:compile [INFO] | +- org.apache.commons:commons-text:jar:1.10.0:compile [INFO] | +- org.slf4j:slf4j-api:jar:1.7.36:compile [INFO] | +- org.slf4j:slf4j-reload4j:jar:1.7.36:compile [INFO] | +- org.apache.avro:avro:jar:1.7.7:compile [INFO] | | +- org.codehaus.jackson:jackson-core-asl:jar:1.9.13:compile [INFO] | | +- org.codehaus.jackson:jackson-mapper-asl:jar:1.9.13:compile [INFO] | | \- com.thoughtworks.paranamer:paranamer:jar:2.3:compile [INFO] | +- com.google.re2j:re2j:jar:1.1:compile [INFO] | +- com.google.code.gson:gson:jar:2.9.0:compile [INFO] | +- org.apache.hadoop:hadoop-auth:jar:3.3.6:compile [INFO] | | +- com.nimbusds:nimbus-jose-jwt:jar:9.8.1:compile [INFO] | | | \- com.github.stephenc.jcip:jcip-annotations:jar:1.0-1:compile [INFO] | | +- org.apache.curator:curator-framework:jar:5.2.0:compile [INFO] | | \- org.apache.kerby:kerb-simplekdc:jar:1.0.1:compile [INFO] | | +- org.apache.kerby:kerb-client:jar:1.0.1:compile [INFO] | | | +- org.apache.kerby:kerby-config:jar:1.0.1:compile [INFO] | | | +- org.apache.kerby:kerb-common:jar:1.0.1:compile [INFO] | | | | \- org.apache.kerby:kerb-crypto:jar:1.0.1:compile [INFO] | | | +- org.apache.kerby:kerb-util:jar:1.0.1:compile [INFO] | | | \- org.apache.kerby:token-provider:jar:1.0.1:compile [INFO] | | \- org.apache.kerby:kerb-admin:jar:1.0.1:compile [INFO] | | +- org.apache.kerby:kerb-server:jar:1.0.1:compile [INFO] | | | \- org.apache.kerby:kerb-identity:jar:1.0.1:compile [INFO] | | \- org.apache.kerby:kerby-xdr:jar:1.0.1:compile [INFO] | +- com.jcraft:jsch:jar:0.1.55:compile [INFO] | +- org.apache.curator:curator-client:jar:5.2.0:compile [INFO] | +- org.apache.curator:curator-recipes:jar:5.2.0:compile [INFO] | +- com.google.code.findbugs:jsr305:jar:3.0.2:compile [INFO] | +- org.apache.zookeeper:zookeeper:jar:3.6.3:compile [INFO] | | +- org.apache.zookeeper:zookeeper-jute:jar:3.6.3:compile [INFO] | | +- io.netty:netty-handler:jar:4.1.63.Final:compile [INFO] | | | +- io.netty:netty-common:jar:4.1.63.Final:compile [INFO] | | | +- io.netty:netty-resolver:jar:4.1.63.Final:compile [INFO] | | | +- io.netty:netty-buffer:jar:4.1.63.Final:compile [INFO] | | | +- io.netty:netty-transport:jar:4.1.63.Final:compile [INFO] | | | \- io.netty:netty-codec:jar:4.1.63.Final:compile [INFO] | | +- io.netty:netty-transport-native-epoll:jar:4.1.63.Final:compile [INFO] | | | \- io.netty:netty-transport-native-unix-common:jar:4.1.63.Final:compile [INFO] | | +- org.slf4j:slf4j-log4j12:jar:1.7.25:compile [INFO] | | \- log4j:log4j:jar:1.2.17:compile [INFO] | +- io.dropwizard.metrics:metrics-core:jar:3.2.4:compile [INFO] | +- org.apache.commons:commons-compress:jar:1.21:compile [INFO] | +- org.apache.kerby:kerb-core:jar:1.0.1:compile [INFO] | | \- org.apache.kerby:kerby-pkix:jar:1.0.1:compile [INFO] | | +- org.apache.kerby:kerby-asn1:jar:1.0.1:compile [INFO] | | \- org.apache.kerby:kerby-util:jar:1.0.1:compile [INFO] | +- com.fasterxml.jackson.core:jackson-databind:jar:2.12.7.1:compile [INFO] | | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.12.7:compile [INFO] | | \- com.fasterxml.jackson.core:jackson-core:jar:2.12.7:compile [INFO] | +- org.codehaus.woodstox:stax2-api:jar:4.2.1:compile [INFO] | +- com.fasterxml.woodstox:woodstox-core:jar:5.4.0:compile [INFO] | +- dnsjava:dnsjava:jar:2.1.7:compile [INFO] | \- org.xerial.snappy:snappy-java:jar:1.1.8.2:compile [INFO] +- org.apache.hadoop:hadoop-mapreduce-client-core:jar:3.3.6:compile [INFO] | +- org.apache.hadoop:hadoop-yarn-client:jar:3.3.6:compile [INFO] | | +- org.eclipse.jetty.websocket:websocket-client:jar:9.4.51.v20230217:compile [INFO] | | | +- org.eclipse.jetty:jetty-client:jar:9.4.51.v20230217:compile [INFO] | | | \- org.eclipse.jetty.websocket:websocket-common:jar:9.4.51.v20230217:compile [INFO] | | | \- org.eclipse.jetty.websocket:websocket-api:jar:9.4.51.v20230217:compile [INFO] | | +- org.apache.hadoop:hadoop-yarn-api:jar:3.3.6:compile [INFO] | | \- org.jline:jline:jar:3.9.0:compile [INFO] | +- org.apache.hadoop:hadoop-yarn-common:jar:3.3.6:compile [INFO] | | +- javax.xml.bind:jaxb-api:jar:2.2.11:compile [INFO] | | +- com.sun.jersey:jersey-client:jar:1.19.4:compile [INFO] | | +- com.google.inject:guice:jar:4.0:compile [INFO] | | | +- javax.inject:javax.inject:jar:1:compile [INFO] | | | \- aopalliance:aopalliance:jar:1.0:compile [INFO] | | +- com.sun.jersey.contribs:jersey-guice:jar:1.19.4:compile [INFO] | | +- com.fasterxml.jackson.module:jackson-module-jaxb-annotations:jar:2.12.7:compile [INFO] | | | \- jakarta.xml.bind:jakarta.xml.bind-api:jar:2.3.2:compile [INFO] | | \- com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:jar:2.12.7:compile [INFO] | | \- com.fasterxml.jackson.jaxrs:jackson-jaxrs-base:jar:2.12.7:compile [INFO] | +- org.apache.hadoop:hadoop-hdfs-client:jar:3.3.6:compile [INFO] | | +- com.squareup.okhttp3:okhttp:jar:4.9.3:compile [INFO] | | | \- com.squareup.okio:okio:jar:2.8.0:compile [INFO] | | +- org.jetbrains.kotlin:kotlin-stdlib:jar:1.4.10:compile [INFO] | | \- org.jetbrains.kotlin:kotlin-stdlib-common:jar:1.4.10:compile [INFO] | +- com.google.inject.extensions:guice-servlet:jar:4.0:compile [INFO] | \- io.netty:netty:jar:3.10.6.Final:compile [INFO] +- org.apache.hadoop:hadoop-mapreduce-client-common:jar:3.3.6:compile [INFO] +- org.apache.hbase:hbase-client:jar:2.4.18:compile [INFO] | +- org.apache.hbase.thirdparty:hbase-shaded-protobuf:jar:4.1.5:compile [INFO] | +- org.apache.hbase:hbase-common:jar:2.4.18:compile [INFO] | | +- org.apache.hbase:hbase-logging:jar:2.4.18:compile [INFO] | | +- org.apache.hbase.thirdparty:hbase-shaded-gson:jar:4.1.5:compile [INFO] | | \- org.apache.hbase.thirdparty:hbase-unsafe:jar:4.1.5:compile [INFO] | +- org.apache.hbase:hbase-hadoop-compat:jar:2.4.18:compile [INFO] | | \- org.apache.hbase:hbase-metrics-api:jar:2.4.18:compile [INFO] | +- org.apache.hbase:hbase-hadoop2-compat:jar:2.4.18:compile [INFO] | | +- org.apache.hbase:hbase-metrics:jar:2.4.18:compile [INFO] | | \- javax.activation:javax.activation-api:jar:1.2.0:runtime [INFO] | +- org.apache.hbase:hbase-protocol-shaded:jar:2.4.18:compile [INFO] | +- org.apache.hbase:hbase-protocol:jar:2.4.18:compile [INFO] | +- org.apache.hbase.thirdparty:hbase-shaded-miscellaneous:jar:4.1.5:compile [INFO] | | \- com.google.errorprone:error_prone_annotations:jar:2.21.1:compile [INFO] | +- org.apache.hbase.thirdparty:hbase-shaded-netty:jar:4.1.5:compile [INFO] | +- org.apache.htrace:htrace-core4:jar:4.2.0-incubating:compile [INFO] | +- org.jruby.jcodings:jcodings:jar:1.0.55:compile [INFO] | +- org.jruby.joni:joni:jar:2.1.31:compile [INFO] | +- org.apache.commons:commons-crypto:jar:1.0.0:compile [INFO] | \- org.apache.yetus:audience-annotations:jar:0.13.0:compile [INFO] +- org.apache.phoenix:phoenix-client-hbase-2.4:jar:5.1.3:compile [INFO] \- com.google.protobuf:protobuf-java:jar:2.5.0:compile [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 10.727 s [INFO] Finished at: 2025-10-09T17:03:53+08:00 [INFO] ------------------------------------------------------------------------
10-10
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值