鱼C论坛

 找回密码
 立即注册
查看: 1923|回复: 1

[技术交流] 构建dubbo分布式平台-maven构建ant-utils工具项目

[复制链接]
发表于 2018-8-31 15:56:16 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
1. 创建ant-utils工具包子项目,继承ant-parent根项目,其中pom.xml配置如下:
  1. <span style="font-size: 14px;"><?xml version="1.0"?>
  2. <project
  3.         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
  4.         xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  5.         <modelVersion>4.0.0</modelVersion>
  6.         <parent>
  7.                 <groupId>com.sml.sz</groupId>
  8.                 <artifactId>ant-project</artifactId>
  9.                 <version>1.0.0</version>
  10.         </parent>
  11.         <artifactId>ant-utils</artifactId>
  12.         <name>ant-utils</name>
  13.         <url>http://maven.apache.org</url>
  14.         <description>ant核心工具包,提供整个架构通用工具类库</description>

  15.         <dependencies>
  16.                 <!-- 通用工具包 -->
  17.                 <dependency>
  18.                         <groupId>org.apache.commons</groupId>
  19.                         <artifactId>commons-lang3</artifactId>
  20.                         <version>${commons-lang3.version}</version>
  21.                 </dependency>
  22.                 <dependency>
  23.                         <groupId>commons-io</groupId>
  24.                         <artifactId>commons-io</artifactId>
  25.                         <version>${commons-io.version}</version>
  26.                 </dependency>
  27.                 <dependency>
  28.                         <groupId>commons-codec</groupId>
  29.                         <artifactId>commons-codec</artifactId>
  30.                         <version>${commons-codec.version}</version>
  31.                 </dependency>
  32.                 <dependency>
  33.                         <groupId>commons-fileupload</groupId>
  34.                         <artifactId>commons-fileupload</artifactId>
  35.                         <version>${commons-fileupload.version}</version>
  36.                 </dependency>
  37.                 <dependency>
  38.                         <groupId>commons-beanutils</groupId>
  39.                         <artifactId>commons-beanutils</artifactId>
  40.                         <version>${commons-beanutils.version}</version>
  41.                         <exclusions>
  42.                                 <exclusion>
  43.                                         <groupId>commons-logging</groupId>
  44.                                         <artifactId>commons-logging</artifactId>
  45.                                 </exclusion>
  46.                         </exclusions>
  47.                 </dependency>

  48.                 <!-- jackson json 包-->
  49.                 <dependency>
  50.                         <groupId>com.fasterxml.jackson.core</groupId>
  51.                         <artifactId>jackson-core</artifactId>
  52.                         <version>${jackson.version}</version>
  53.                 </dependency>
  54.                 <dependency>
  55.                         <groupId>com.fasterxml.jackson.core</groupId>
  56.                         <artifactId>jackson-databind</artifactId>
  57.                         <version>${jackson.version}</version>
  58.                 </dependency>
  59.                 <dependency>
  60.                         <groupId>com.fasterxml.jackson.core</groupId>
  61.                         <artifactId>jackson-annotations</artifactId>
  62.                         <version>${jackson.version}</version>
  63.                 </dependency>
  64.                 <dependency>
  65.                         <groupId>com.fasterxml.jackson.module</groupId>
  66.                         <artifactId>jackson-module-jaxb-annotations</artifactId>
  67.                         <version>${jackson.version}</version>
  68.                 </dependency>

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

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

  81.                 <!-- freemarker 模板引擎包 -->
  82.                 <dependency>
  83.                         <groupId>org.freemarker</groupId>
  84.                         <artifactId>freemarker</artifactId>
  85.                         <version>${freemarker.version}</version>
  86.                 </dependency>

  87.                 <!-- java邮件发送 -->
  88.                 <dependency>
  89.                         <groupId>javax.mail</groupId>
  90.                         <artifactId>mail</artifactId>
  91.                         <version>${email.version}</version>
  92.                 </dependency>
  93.                 <dependency>
  94.                         <groupId>javax.activation</groupId>
  95.                         <artifactId>activation</artifactId>
  96.                         <version>1.1.1</version>
  97.                 </dependency>

  98.                 <!-- POI相关的包 -->
  99.                 <dependency>
  100.                         <groupId>org.apache.poi</groupId>
  101.                         <artifactId>poi</artifactId>
  102.                         <version>${poi.version}</version>
  103.                 </dependency>
  104.                 <dependency>
  105.                         <groupId>org.apache.poi</groupId>
  106.                         <artifactId>poi-ooxml</artifactId>
  107.                         <version>${poi.version}</version>
  108.                 </dependency>
  109.                 <dependency>
  110.                         <groupId>org.apache.poi</groupId>
  111.                         <artifactId>poi-ooxml-schemas</artifactId>
  112.                         <version>${poi.version}</version>
  113.                 </dependency>

  114.                 <!-- 图片数据元提取  -->
  115.                 <dependency>
  116.                         <groupId>com.drewnoakes</groupId>
  117.                         <artifactId>metadata-extractor</artifactId>
  118.                         <version>2.6.2</version>
  119.                 </dependency>

  120.                 <!-- 条形码、二维码生成 -->
  121.                 <dependency>
  122.                         <groupId>com.google.zxing</groupId>
  123.                         <artifactId>core</artifactId>
  124.                         <version>2.2</version>
  125.                 </dependency>
  126.                 <dependency>
  127.                         <groupId>com.google.zxing</groupId>
  128.                         <artifactId>javase</artifactId>
  129.                         <version>2.2</version>
  130.                 </dependency>

  131.                 <!-- 缓存相关包 -->
  132.                 <dependency>
  133.                         <groupId>net.sf.ehcache</groupId>
  134.                         <artifactId>ehcache-core</artifactId>
  135.                         <version>${ehcache.version}</version>
  136.                 </dependency>
  137.                 <dependency>
  138.                         <groupId>net.sf.ehcache</groupId>
  139.                         <artifactId>ehcache-web</artifactId>
  140.                         <version>${ehcache-web.version}</version>
  141.                 </dependency>
  142.                 <dependency>
  143.                         <groupId>redis.clients</groupId>
  144.                         <artifactId>jedis</artifactId>
  145.                         <version>2.5.1</version>
  146.                 </dependency>

  147.                 <!-- spring相关包 -->
  148.                 <dependency>
  149.                         <groupId>org.springframework</groupId>
  150.                         <artifactId>spring-context-support</artifactId>
  151.                         <version>${spring.version}</version>
  152.                 </dependency>
  153.                
  154.                 <!-- httpclient 依赖包,使用的时候才依赖 -->
  155.                 <dependency>
  156.                         <groupId>org.apache.httpcomponents</groupId>
  157.                         <artifactId>httpclient</artifactId>
  158.                         <version>4.5.2</version>
  159.                 </dependency>
  160.         </dependencies>
  161.         <profiles>
  162.                 <profile>
  163.                         <id>sit</id>
  164.                         <activation>
  165.                                 <property>
  166.                                         <name>environment.type</name>
  167.                                         <value>sit</value>
  168.                                 </property>
  169.                         </activation>
  170.                         <build>
  171.                                 <plugins>
  172.                                         <plugin>
  173.                                                 <groupId>com.google.code.maven-replacer-plugin</groupId>
  174.                                                 <artifactId>replacer</artifactId>
  175.                                                 <configuration>
  176.                                                         <includes>
  177.                                                                 <include>target/classes/logback.properties</include>
  178.                                                         </includes>
  179.                                                         <replacements>
  180.                                                                 <replacement>
  181.                                                                         <token>=dev</token>
  182.                                                                         <value>=sit</value>
  183.                                                                 </replacement>
  184.                                                         </replacements>
  185.                                                 </configuration>
  186.                                         </plugin>
  187.                                 </plugins>
  188.                         </build>
  189.                 </profile>
  190.                 <profile>
  191.                         <id>uat</id>
  192.                         <activation>
  193.                                 <property>
  194.                                         <name>environment.type</name>
  195.                                         <value>uat</value>
  196.                                 </property>
  197.                         </activation>
  198.                         <build>
  199.                                 <plugins>
  200.                                         <plugin>
  201.                                                 <groupId>com.google.code.maven-replacer-plugin</groupId>
  202.                                                 <artifactId>replacer</artifactId>
  203.                                                 <configuration>
  204.                                                         <includes>
  205.                                                                 <include>target/classes/logback.properties</include>
  206.                                                         </includes>
  207.                                                         <replacements>
  208.                                                                 <replacement>
  209.                                                                         <token>=dev</token>
  210.                                                                         <value>=uat</value>
  211.                                                                 </replacement>
  212.                                                         </replacements>
  213.                                                 </configuration>
  214.                                         </plugin>
  215.                                 </plugins>
  216.                         </build>
  217.                 </profile>
  218.                 <profile>
  219.                         <id>performance</id>
  220.                         <activation>
  221.                                 <property>
  222.                                         <name>environment.type</name>
  223.                                         <value>performance</value>
  224.                                 </property>
  225.                         </activation>
  226.                         <build>
  227.                                 <plugins>
  228.                                         <plugin>
  229.                                                 <groupId>com.google.code.maven-replacer-plugin</groupId>
  230.                                                 <artifactId>replacer</artifactId>
  231.                                                 <configuration>
  232.                                                         <includes>
  233.                                                                 <include>target/classes/logback.properties</include>
  234.                                                         </includes>
  235.                                                         <replacements>
  236.                                                                 <replacement>
  237.                                                                         <token>=dev</token>
  238.                                                                         <value>=perf</value>
  239.                                                                 </replacement>
  240.                                                         </replacements>
  241.                                                 </configuration>
  242.                                         </plugin>
  243.                                 </plugins>
  244.                         </build>
  245.                 </profile>
  246.                 <profile>
  247.                         <id>production</id>
  248.                         <activation>
  249.                                 <property>
  250.                                         <name>environment.type</name>
  251.                                         <value>production</value>
  252.                                 </property>
  253.                         </activation>
  254.                         <build>
  255.                                 <plugins>
  256.                                         <plugin>
  257.                                                 <groupId>com.google.code.maven-replacer-plugin</groupId>
  258.                                                 <artifactId>replacer</artifactId>
  259.                                                 <configuration>
  260.                                                         <includes>
  261.                                                                 <include>target/classes/logback.properties</include>
  262.                                                         </includes>
  263.                                                         <replacements>
  264.                                                                 <replacement>
  265.                                                                         <token>=dev</token>
  266.                                                                         <value>=prd</value>
  267.                                                                 </replacement>
  268.                                                         </replacements>
  269.                                                 </configuration>
  270.                                         </plugin>
  271.                                 </plugins>
  272.                         </build>
  273.                 </profile>
  274.         </profiles>
  275. </project></span>
复制代码

愿意了解框架技术或者源码的朋友直接求求交流分享技术 二零四二八四九二三七

  此项目中只包含了通用的工具类库,包括:配置文件、文件处理、手机短信、email邮箱处理、redis缓存处理、collection集合处理、cookie处理、时间工具、freemarker模板工具、httpclient工具、多线程等。
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

 楼主| 发表于 2018-8-31 15:57:50 | 显示全部楼层
欢迎大家一起交流~
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2024-4-24 08:02

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表