用户注册



邮箱:

密码:

用户登录


邮箱:

密码:
记住登录一个月忘记密码?

发表随想


还能输入:200字

公园    -  云代码空间

——

(十) 构建dubbo分布式平台-maven构建ant-utils工具项目

2018-01-30|903阅||

摘要:(十) 构建dubbo分布式平台-maven构建ant-utils工具项目

上一篇我们介绍《构建dubbo分布式平台-maven构建ant-framework核心代码Base封装》,今天重点讲解的是ant-utils工具包的构建过程。

导语:ant-utils是核心工具包,提供整个架构通用工具类库

1. 创建ant-utils工具包子项目,继承ant-parent根项目,其中pom.xml配置如下:

<span style="font-size: 14px;"><?xml version="1.0"?>
<project
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
	xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<modelVersion>4.0.0</modelVersion>
	<parent>
		<groupId>com.sml.sz</groupId>
		<artifactId>ant-project</artifactId>
		<version>1.0.0</version>
	</parent>
	<artifactId>ant-utils</artifactId>
	<name>ant-utils</name>
	<url>http://maven.apache.org</url>
	<description>ant核心工具包,提供整个架构通用工具类库</description>

	<dependencies>
		<!-- 通用工具包 -->
		<dependency>
			<groupId>org.apache.commons</groupId>
			<artifactId>commons-lang3</artifactId>
			<version>${commons-lang3.version}</version>
		</dependency>
		<dependency>
			<groupId>commons-io</groupId>
			<artifactId>commons-io</artifactId>
			<version>${commons-io.version}</version>
		</dependency>
		<dependency>
			<groupId>commons-codec</groupId>
			<artifactId>commons-codec</artifactId>
			<version>${commons-codec.version}</version>
		</dependency>
		<dependency>
			<groupId>commons-fileupload</groupId>
			<artifactId>commons-fileupload</artifactId>
			<version>${commons-fileupload.version}</version>
		</dependency>
		<dependency>
			<groupId>commons-beanutils</groupId>
			<artifactId>commons-beanutils</artifactId>
			<version>${commons-beanutils.version}</version>
			<exclusions>
				<exclusion>
					<groupId>commons-logging</groupId>
					<artifactId>commons-logging</artifactId>
				</exclusion>
			</exclusions>
		</dependency>

		<!-- jackson json 包-->
		<dependency>
			<groupId>com.fasterxml.jackson.core</groupId>
			<artifactId>jackson-core</artifactId>
			<version>${jackson.version}</version>
		</dependency>
		<dependency>
			<groupId>com.fasterxml.jackson.core</groupId>
			<artifactId>jackson-databind</artifactId>
			<version>${jackson.version}</version>
		</dependency>
		<dependency>
			<groupId>com.fasterxml.jackson.core</groupId>
			<artifactId>jackson-annotations</artifactId>
			<version>${jackson.version}</version>
		</dependency>
		<dependency>
			<groupId>com.fasterxml.jackson.module</groupId>
			<artifactId>jackson-module-jaxb-annotations</artifactId>
			<version>${jackson.version}</version>
		</dependency>

		<!-- xstream包,将Java对象和xml文档相互转换-->
		<dependency>
			<groupId>com.thoughtworks.xstream</groupId>
			<artifactId>xstream</artifactId>
			<version>${xstream.version}</version>
		</dependency>

		<!-- pojo copy javaBean的映射工具包,可以进行简单的属性映射、复杂的类型映射、双向映射、递归映射-->
		<dependency>
			<groupId>net.sf.dozer</groupId>
			<artifactId>dozer</artifactId>
			<version>${dozer.version}</version>
		</dependency>

		<!-- freemarker 模板引擎包 -->
		<dependency>
			<groupId>org.freemarker</groupId>
			<artifactId>freemarker</artifactId>
			<version>${freemarker.version}</version>
		</dependency>

		<!-- java邮件发送 -->
		<dependency>
			<groupId>javax.mail</groupId>
			<artifactId>mail</artifactId>
			<version>${email.version}</version>
		</dependency>
		<dependency>
			<groupId>javax.activation</groupId>
			<artifactId>activation</artifactId>
			<version>1.1.1</version>
		</dependency>

		<!-- POI相关的包 -->
		<dependency>
			<groupId>org.apache.poi</groupId>
			<artifactId>poi</artifactId>
			<version>${poi.version}</version>
		</dependency>
		<dependency>
			<groupId>org.apache.poi</groupId>
			<artifactId>poi-ooxml</artifactId>
			<version>${poi.version}</version>
		</dependency>
		<dependency>
			<groupId>org.apache.poi</groupId>
			<artifactId>poi-ooxml-schemas</artifactId>
			<version>${poi.version}</version>
		</dependency>

		<!-- 图片数据元提取  -->
		<dependency>
			<groupId>com.drewnoakes</groupId>
			<artifactId>metadata-extractor</artifactId>
			<version>2.6.2</version>
		</dependency>

		<!-- 条形码、二维码生成 -->
		<dependency>
			<groupId>com.google.zxing</groupId>
			<artifactId>core</artifactId>
			<version>2.2</version>
		</dependency>
		<dependency>
			<groupId>com.google.zxing</groupId>
			<artifactId>javase</artifactId>
			<version>2.2</version>
		</dependency>

		<!-- 缓存相关包 -->
		<dependency>
			<groupId>net.sf.ehcache</groupId>
			<artifactId>ehcache-core</artifactId>
			<version>${ehcache.version}</version>
		</dependency>
		<dependency>
			<groupId>net.sf.ehcache</groupId>
			<artifactId>ehcache-web</artifactId>
			<version>${ehcache-web.version}</version>
		</dependency>
		<dependency>
			<groupId>redis.clients</groupId>
			<artifactId>jedis</artifactId>
			<version>2.5.1</version>
		</dependency>

		<!-- spring相关包 -->
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-context-support</artifactId>
			<version>${spring.version}</version>
		</dependency>
		
		<!-- httpclient 依赖包,使用的时候才依赖 -->
		<dependency>
			<groupId>org.apache.httpcomponents</groupId>
			<artifactId>httpclient</artifactId>
			<version>4.5.2</version>
		</dependency>
	</dependencies>
	<profiles>
		<profile>
			<id>sit</id>
			<activation>
				<property>
					<name>environment.type</name>
					<value>sit</value>
				</property>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>com.google.code.maven-replacer-plugin</groupId>
						<artifactId>replacer</artifactId>
						<configuration>
							<includes>
								<include>target/classes/logback.properties</include>
							</includes>
							<replacements>
								<replacement>
									<token>=dev</token>
									<value>=sit</value>
								</replacement>
							</replacements>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>uat</id>
			<activation>
				<property>
					<name>environment.type</name>
					<value>uat</value>
				</property>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>com.google.code.maven-replacer-plugin</groupId>
						<artifactId>replacer</artifactId>
						<configuration>
							<includes>
								<include>target/classes/logback.properties</include>
							</includes>
							<replacements>
								<replacement>
									<token>=dev</token>
									<value>=uat</value>
								</replacement>
							</replacements>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>performance</id>
			<activation>
				<property>
					<name>environment.type</name>
					<value>performance</value>
				</property>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>com.google.code.maven-replacer-plugin</groupId>
						<artifactId>replacer</artifactId>
						<configuration>
							<includes>
								<include>target/classes/logback.properties</include>
							</includes>
							<replacements>
								<replacement>
									<token>=dev</token>
									<value>=perf</value>
								</replacement>
							</replacements>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>production</id>
			<activation>
				<property>
					<name>environment.type</name>
					<value>production</value>
				</property>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>com.google.code.maven-replacer-plugin</groupId>
						<artifactId>replacer</artifactId>
						<configuration>
							<includes>
								<include>target/classes/logback.properties</include>
							</includes>
							<replacements>
								<replacement>
									<token>=dev</token>
									<value>=prd</value>
								</replacement>
							</replacements>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
</project></span>

2. 此项目中只包含了通用的工具类库,包括:配置文件、文件处理、手机短信、email邮箱处理、

redis缓存处理、collection集合处理、cookie处理、时间工具、freemarker模板工具、httpclient工具、

多线程等。完整项目的源码来源

欢迎大家跟我一起学习《构建dubbo分布式平台》,希望大家持续关注后面的文章!

顶 0踩 0收藏
文章评论
    发表评论

    个人资料

    • 昵称: 公园
    • 等级: 初级设计师
    • 积分: 2760
    • 代码: 0 个
    • 文章: 89 篇
    • 随想: 0 条
    • 访问: 10 次
    • 关注

    人气代码

      标签

      MVC(9)教程(4)Spring(5)Redis分布式缓存(1)spring,spr(1)mvc,web开发,(1)spring,spr(1)mvc,web开发,(1)Zookeeper集(1)restful,(2)kafka,(2)shiro,Spri(1)MVC,mybati(1)跟我学习dubbo,(1)J2ee分布式架构,(1)shiro(1)跟我学习dubbo-(1)跟我学习dubbo-(1)spring+spr(1)Spring4+Sp(1)DUBBO与ZOOK(1)【分享】微服务分布式(1)Springmvc+(1)JEESZ(1)RestFul服务介(1)J2EE分布式架构(3)dubbo+spri(1)基于redis分布式(1)SSM框架Sprin(1)分布式缓存Redis(1)Centos下单节点(1)JEESZ分布式框架(1)JEESZ分布式框架(1)分布式架构sprin(1)+mybatis(8)+shiro+(3)Activiti(3)分布式服务:spri(1)+(11)Dubbo+Zook(1)JEESZ-kafk(1)JEESZ-Zook(1)FastDFS安装、(1)FastDFS分布式(1)分布式服务:spri(1)Dubbo+Zook(1)分布式架构sprin(1)FastDFS分布式(1)FastDFS安装、(1)Maven启用代理访(1)如何从Maven远程(1)Maven安装配置(1)Maven本地资源库(1)使用Maven创建J(1)使用Maven创建W(1)Maven(2)POM(1)构建生命周期(1)SSM框架——详细整(1)JavaEE的13种(1)使用Maven构建和(1)Maven存储库(1)(一)构建dubbo(1)(二)构建dubbo(1)(三)构建dubbo(1)分布式框架简介SSM(1)springmvc+(1)Maven快照(1)Maven项目模板(1)Maven构建自动化(1)dubbo(4)springmvc(4)mybatis(2)java企业架构(1)SSM框架——Spr(1)分布式服务:spri(1)Dubbo+Zook(1)分布式服务:spri(1)Dubbo+Zook(1)springmvc+(1)分布式架构sprin(1)mvc配置(2)dbcp数据源+jd(1)详细介绍(1)(十三)(1)(十四)(1)(十五)(1)MVC原理(1)入门示例讲解(1)(十六)(1)(十七)(1)Springmvc+(1)j2ee分布式架构核(1)【分享】微服务分布式(1)Springmvc+(1)dbcp数据源+jd(1)DUBBO+SPRI(1)JEESZ分布式系统(1)构建dubbo分布式(1)构建springmv(1)构建dubbo分布式(1)构建dubbo分布式(1)构建springmv(1)构建dubbo分布式(1)构建dubbo分布式(1)构建dubbo分布式(1)Springmvc+(1)构建springmv(1)构建springmv(1)构建dubbo分布式(1)构建dubbo分布式(1)跟我学习dubbo-(1)构建dubbo分布式(1)构建dubbo分布式(1)【企业级框架整合】S(1)构建dubbo分布式(1)【推荐】微服务大型分(1)springmvc整(1)【分享】微服务分布式(1)Springmvc+(1)SpringBoot(4)企业级(4)(十七)上传文件(1)(十四)在sprin(1)(十五)Spring(1)(十六)用restT(1)

      站长推荐