OKIO源码分析<Segment的设计智慧>

本文深入探讨了Okio中的Segment类及其管理池SegmentPool的工作原理。Segment通过双向链表实现高效的数据管理和共享,而SegmentPool则通过缓存和复用Segment对象减少内存分配和垃圾回收的开销。

1.Segment.java

a).final class Segment,只看类的修饰符表明这个类不能被继承
b).看看成员变量:

 /*当前segement所占的字节数*/
  static final int SIZE = 8192;
 /*当前segment被分享的最小字节数,也就是当需要达到共享的数据的大小比1024字节数大的时候才共享*/
  static final int SHARE_MINIMUM = 1024;
  //当前segment存储的数据:data数组
  final byte[] data;
  /** The next byte of application data byte to read in this segment. */
  /*segment中有效数据的开始index*/
  int pos;
  /** The first byte of available data ready to be written to. */
  /*segment新数据可写入的index,也是有效数据的结束后一位,也就是segment中的数据index是从pos到limit-1*/
  int limit;
  /** True if other segments or byte strings use the same byte array. */
  /*是否与其他的segment或者byte共享标志位*/
  boolean shared;
  /** True if this segment owns the byte array and can append to it, extending {@code limit}. */
  /*此segment数据是否为独享数据*/
  boolean owner;
  /** Next segment in a linked or circularly-linked list. */
  /*当前节点的后继节点*/
  Segment next;

  /** Previous segment in a circularly-linked list. */
  /*当前节点的先驱节点*/
  Segment prev;

从源码可以看出这是一个双向链表:
这里写图片描述
链表中的每一个结点都有一个data数组:data = new byte[SIZE];
boolean shared:标志位表示data数组是否为其他segment对象共享;
boolean owner:标志data数组是否只能由当前对象操作;
Segment之间使用链表连接,Segment中使用数组存储,兼具读的连续性和写的可插入性。

c).构造函数

  /*构造函数*/
  Segment() {
    this.data = new byte[SIZE];
    this.owner = true;
    this.shared = false;
  }
  /*构造函数*/
  Segment(Segment shareFrom) {
    this(shareFrom.data, shareFrom.pos, shareFrom.limit);
    shareFrom.shared = true;
  }
/*构造函数*/
  Segment(byte[] data, int pos, int limit) {
    this.data = data;
    this.pos = pos;
    this.limit = limit;
    this.owner = false;
    this.shared = true;
  }

d).pop()

  /**
   * Removes this segment of a circularly-linked list and returns its .
   * Returns null if the list is now empty.
   */
   /*
  移除当前节点,将先前节点的后继指针指向当前节点的后继节点,下一节点前驱指向     当前节点的前驱  然后再将当前节点的前驱和后继节点置空,当前节点脱离双向链表
   */
  public Segment pop() {
    Segment result = next != this ? next : null;
    prev.next = next;
    next.prev = prev;
    next = null;
    prev = null;
    return result;
  }

函数作用示意图:

这里写图片描述
e).push()

/**
   * Appends {@code segment} after this segment in the circularly-linked list.
   * Returns the pushed segment.
   */
   /*
  在当前节点的后继位置插入新结点,插入节点的前驱指向当前节点,插入节点的后继节点指向当前节点的后继节点,返回插入的节点
   */
  public Segment push(Segment segment) {
    segment.prev = this;
    segment.next = next;
    next.prev = segment;
    next = segment;
    return segment;
  }

f.split()

  /**
   * Splits this head of a circularly-linked list into two segments. The first
   * segment contains the data in {@code [pos..pos+byteCount)}. The second
   * segment contains the data in {@code [pos+byteCount..limit)}. This can be
   * useful when moving partial segments from one buffer to another.
   *
   * <p>Returns the new head of the circularly-linked list.
   */

   /*
    切割当前segment,前一个的segment的data为当前segment的pos..pos+byteCount字节片段
    当前segment数据段变为pos+byteCount..limit字节片段,
    这可以用来从一个buffer移动部分数据到另外一个buffer
    主要为了实现在移动数据时直接操作Segment而不是data,这样在写数据时可以达到很高的效率。
   */
  public Segment split(int byteCount) {
    if (byteCount <= 0 || byteCount > limit - pos) throw new IllegalArgumentException();
    Segment prefix;

    // We have two competing performance goals:
    //  - Avoid copying data. We accomplish this by sharing segments.
    //  - Avoid short shared segments. These are bad for performance because they are readonly and
    //    may lead to long chains of short segments.
    // To balance these goals we only share segments when the copy will be large.

    /*如果bytecount比最小可共享上限大,
    则不复制这个data数组,两个segment共享这个segment的一部分
    否则就拷贝数据,以达到频繁拷贝数组;同时也要兼顾双向链表的长度,如果共享片段链很长,
    但是链中的每一个segment都很短的话,就会使链表很长,所以在是否拷贝data数组很重要
    */
    if (byteCount >= SHARE_MINIMUM) {
      //共享
      prefix = new Segment(this);
    } else {
      //不共享,拷贝
      prefix = SegmentPool.take();
      System.arraycopy(data, pos, prefix.data, 0, byteCount);
    }

    prefix.limit = prefix.pos + byteCount;
    pos += byteCount;
    prev.push(prefix);
    return prefix;
  }

如果两个segment对象共享一个data数组,则两个segmentdata示意图:
这里写图片描述

并且将共享为修改为TRUE,以防止SegmentPool的回收
g).compact()
/**
* Call this when the tail and its predecessor may both be less than half
* full. This will copy data so that segments can be recycled.
*/

/*
当segment尾部和让的前驱结点中的数据都不足当前segment的一般的时候调用,
会拷贝数据以至于segment的回收
*/
public void compact() {
//当前只有一个节点的时候
if (prev == this) throw new IllegalStateException();
//不能压缩因为当前数据被共享了
if (!prev.owner) return; // Cannot compact: prev isn’t writable.
int byteCount = limit - pos;
//当前节点的前驱segment是否被共享,如果被共享则再加上pos之前的数据(因为之前的是无效数据),共享了则不将pos之前的位置加入可用空间
int availableByteCount = SIZE - prev.limit + (prev.shared ? 0 : prev.pos);
//没有足够的空间,放弃压缩
if (byteCount > availableByteCount) return; // Cannot compact: not enough writable space.
//将当前节点的数据写入前驱结点
writeTo(prev, byteCount);
//从双向链表中删除当前节点,并且让segmentpool回收当前的segment
pop();
SegmentPool.recycle(this);
}
h).writeTo


  /** Moves {@code byteCount} bytes from this segment to {@code sink}. */
  public void writeTo(Segment sink, int byteCount) {
    //当前节点为独享
    if (!sink.owner) throw new IllegalArgumentException();
    if (sink.limit + byteCount > SIZE) {
      //将数据往前移动
      // We can't fit byteCount bytes at the sink's current position. Shift sink first.
      if (sink.shared) throw new IllegalArgumentException();
      if (sink.limit + byteCount - sink.pos > SIZE) throw new IllegalArgumentException();
      System.arraycopy(sink.data, sink.pos, sink.data, 0, sink.limit - sink.pos);
      sink.limit -= sink.pos;
      sink.pos = 0;
    }

    System.arraycopy(data, pos, sink.data, sink.limit, byteCount);
    sink.limit += byteCount;
    pos += byteCount;
  }
}

2.segmentPool.java

final class SegmentPool {
  /** The maximum number of bytes to pool. */
  /*
  Segment池所能维护的最大的字节数
  */
  // TODO: Is 64 KiB a good maximum size? Do we ever have that many idle segments?
  static final long MAX_SIZE = 64 * 1024; // 64 KiB.

//segment池中链表的头节点
  /** Singly-linked list of segments. */
  static Segment next;
//当前segment池的字节数
  /** Total bytes in this pool. */
  static long byteCount;
//构造函数
  private SegmentPool() {
  }
//从segment池中获取一个segment
  static Segment take() {
    //加锁将池中当前的链表头返回
    synchronized (SegmentPool.class) {
      if (next != null) {
        Segment result = next;
        next = result.next;
        result.next = null;
        byteCount -= Segment.SIZE;
        return result;
      }
    }
    //如果池维护的链表为空就重新实例化一个segment
    return new Segment(); // Pool is empty. Don't zero-fill while holding a lock.
  }
//回收segment,将所回收的segment添加到池维护的链表头
  static void recycle(Segment segment) {
    if (segment.next != null || segment.prev != null) throw new IllegalArgumentException();
    if (segment.shared) return; // This segment cannot be recycled.
    synchronized (SegmentPool.class) {
      if (byteCount + Segment.SIZE > MAX_SIZE) return; // Pool is full.
      byteCount += Segment.SIZE;
      segment.next = next;
      segment.pos = segment.limit = 0;
      next = segment;
    }
  }
}

如何回收?
看看当前SegmentPool池中的维护的链表:

这里写图片描述

首先判断void recycle(Segment segment)的前驱后继指针是否为null,非null抛出异常,不能回收;
如果当前Segment的data数组还被其他的Segment对象共享,回收失败;
如果当前节点均满足不满足上述条件开始真正的回收,将当前对象加入当前SegmentPool池链表表头,以备需要之时通过take()函数取出。

每一次通过Segment take()函数取出一个可用的Segment对象的时候会从这个链表表头取出,然后将当前表头的下一Segment对象作为链表的表头。如果链表为空的话就重新实例化一个Segment对象。

3.池的智慧

okio采用了segment的机制进行内存共享和复用,尽可能少的去申请内存,同时也就降低了GC的频率。我们知道,过于频繁的GC会给应用程序带来性能问题。
可以看到这里有一个SegmentPool和线程池的设计思想相同,因为每一次实例化Segment对象开销都会比较大,如果能在Segment对象已经不被使用的时候将它“存起来”,等到需要之时才取出来,这样就比重新申请一个内存来实例化一个Segment对象的开销要小,而且快。但是这个池并不是回收所有的已经被废弃的Segment对象,它只回收一定数量的Segment对象,从代码中可以看出池中所能保存的Segment对象总大小只有
static final long MAX_SIZE = 64 * 1024; // 64 KiB.
超过这个最大值的时候,就不再回收,交由JVM的GC回收。否则Segment池保存太多的Segment对象会浪费内存。

现在我将给你个子服务依赖,一个是父项目的依赖文件,帮我看一下为啥我子服务还需要配置数据库才能启动 子服务依赖<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.picc.xzpt.ai</groupId> <artifactId>piccxzpt_ai</artifactId> <version>0.0.1</version> <packaging>jar</packaging> <parent> <groupId>com.picc.xzpt</groupId> <artifactId>piccxzpt</artifactId> <version>0.0.1</version> <relativePath>../pom.xml</relativePath> </parent> <dependencies> <dependency> <groupId>com.bes.appserver</groupId> <artifactId>bes-lite-spring-boot-2.x-starter</artifactId> <version>9.5.5.013</version> </dependency> <dependency> <groupId>com.github.xiaoymin</groupId> <artifactId>swagger-bootstrap-ui</artifactId> <version>1.9.3</version> </dependency> <dependency> <groupId>com.github.ulisesbocchio</groupId> <artifactId>jasypt-spring-boot-starter</artifactId> <!-- <version>3.0.4</version>--> </dependency> <dependency> <groupId>com.google.guava</groupId> <artifactId>guava</artifactId> <version>${guava.version}</version> </dependency> <dependency> <groupId>org.redisson</groupId> <artifactId>redisson</artifactId> <version>3.22.0</version> <scope>compile</scope> </dependency> <!-- <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-pool2</artifactId> <version>2.8.0</version> </dependency>--> <!-- <dependency>--> <!-- <groupId>org.mybatis.spring.boot</groupId>--> <!-- <artifactId>mybatis-spring-boot-starter</artifactId>--> <!-- <version>1.3.1</version>--> <!-- <exclusions>--> <!-- <exclusion>--> <!-- <groupId>ch.qos.logback</groupId>--> <!-- <artifactId>logback-classic</artifactId>--> <!-- </exclusion>--> <!-- <exclusion>--> <!-- <groupId>org.mybatis</groupId>--> <!-- <artifactId>mybatis</artifactId>--> <!-- </exclusion>--> <!-- </exclusions>--> <!-- </dependency>--> <!-- <dependency>--> <!-- <groupId>org.mybatis</groupId>--> <!-- <artifactId>mybatis</artifactId>--> <!-- <version>3.5.6</version>--> <!-- </dependency>--> <dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId> <version>1.2.13</version> </dependency> <!--基础库--> <dependency> <groupId>com.picc.xzpt.baselib</groupId> <artifactId>piccxzpt_baselib</artifactId> <version>0.0.75</version> <exclusions> <exclusion> <groupId>commons-httpclient</groupId> <artifactId>commons-httpclient</artifactId> </exclusion> <exclusion> <groupId>log4j</groupId> <artifactId>log4j</artifactId> </exclusion> <!-- 添加以下排除项 --> <exclusion> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-jdbc</artifactId> </exclusion> <exclusion> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-jpa</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpclient</artifactId> <version>4.5.14</version> </dependency> <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-core</artifactId> <version>2.3.2</version> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <!-- 热部署启动 --> <fork>true</fork> </configuration> </plugin> <!-- <plugin>--> <!-- <groupId>org.mybatis.generator</groupId>--> <!-- <artifactId>mybatis-generator-maven-plugin</artifactId>--> <!-- <version>1.3.5</version>--> <!-- <configuration>--> <!-- <!– generator 工具配置文件的位置 –>--> <!-- <configurationFile>src/main/resources/xml/generatorConfig.xml</configurationFile>--> <!-- <verbose>true</verbose>--> <!-- <overwrite>true</overwrite>--> <!-- </configuration>--> <!-- <dependencies>--> <!-- <!– oracle –>--> <!-- <dependency>--> <!-- <groupId>com.ibm.informix</groupId>--> <!-- <artifactId>jdbc</artifactId>--> <!-- <version>4.10.8.1</version>--> <!-- </dependency>--> <!-- <dependency>--> <!-- <groupId>org.mybatis.generator</groupId>--> <!-- <artifactId>mybatis-generator-core</artifactId>--> <!-- <version>1.3.5</version>--> <!-- </dependency>--> <!-- </dependencies>--> <!-- </plugin>--> </plugins> <resources> <resource> <directory>src/main/java</directory> <includes> <include>**/*.xml</include> </includes> </resource> <resource> <directory>src/main/resources</directory> </resource> </resources> </build> </project> 父项目依赖 <groupId>com.picc.xzpt</groupId> <artifactId>piccxzpt</artifactId> <packaging>pom</packaging> <version>0.0.1</version> <!-- <parent>--> <!-- <groupId>org.springframework.boot</groupId>--> <!-- <artifactId>spring-boot-starter-parent</artifactId>--> <!-- <version>2.5.15</version>--> <!-- <relativePath/>--> <!-- </parent>--> <parent> <groupId>pdfc</groupId> <artifactId>pdfc-parent</artifactId> <version>4.2.8.4</version> </parent> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <java.version>1.8</java.version> <!-- <spring-cloud.version>2020.0.5</spring-cloud.version>--> <pdfc.version>4.2.8.4</pdfc.version> </properties> <dependencies> <!-- Web类型 --> <dependency> <groupId>pdfc</groupId> <artifactId>pdfc-web</artifactId> <version>${pdfc.version}</version> <exclusions> <exclusion> <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId> </exclusion> <exclusion> <groupId>com.squareup.okio</groupId> <artifactId>okio</artifactId> </exclusion> <exclusion> <groupId>com.squareup.okio</groupId> <artifactId>okio-jvm</artifactId> </exclusion> <exclusion> <groupId>org.bouncycastle</groupId> <artifactId>bcprov-jdk18on</artifactId> </exclusion> <exclusion> <groupId>org.bouncycastle</groupId> <artifactId>bcpkix-jdk18on</artifactId> </exclusion> <exclusion> <groupId> org.apache.tomcat.embed</groupId> <artifactId>tomcat-embed-websocket</artifactId> </exclusion> <exclusion> <groupId> org.apache.tomcat.embed</groupId> <artifactId>tomcat-embed-core</artifactId> </exclusion> <exclusion> <groupId>io.github.classgraph</groupId> <artifactId>classgraph</artifactId> </exclusion> <exclusion> <groupId>org.owasp.antisamy</groupId> <artifactId>antisamy</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>com.squareup.okio</groupId> <artifactId>okio</artifactId> <version>3.4.0</version> </dependency> <dependency> <groupId>com.squareup.okio</groupId> <artifactId>okio-jvm</artifactId> <version>3.4.0</version> </dependency> <dependency> <groupId>org.bouncycastle</groupId> <artifactId>bcprov-jdk18on</artifactId> <version>1.78.1</version> </dependency> <dependency> <groupId>org.bouncycastle</groupId> <artifactId>bcpkix-jdk18on</artifactId> <version>1.78.1</version> </dependency> <dependency> <groupId>io.github.classgraph</groupId> <artifactId>classgraph</artifactId> <version>4.8.112</version> </dependency> <dependency> <groupId>org.owasp.antisamy</groupId> <artifactId>antisamy</artifactId> <version>1.7.5</version> </dependency> <!-- 微服务应用 --> <dependency> <groupId>pdfc</groupId> <artifactId>pdfc-cloud</artifactId> <version>${pdfc.version}</version> <exclusions> <exclusion> <artifactId>pdfc-config</artifactId> <groupId>pdfc</groupId> </exclusion> </exclusions> </dependency> <dependency> <groupId>com.thoughtworks.xstream</groupId> <artifactId>xstream</artifactId> <version>1.4.20</version> </dependency> <dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId>mybatis-spring-boot-starter</artifactId> <version>1.3.1</version> <exclusions> <exclusion> <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId> </exclusion> <exclusion> <groupId>org.mybatis</groupId> <artifactId>mybatis</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.mybatis</groupId> <artifactId>mybatis</artifactId> <version>3.5.6</version> </dependency> <dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId> <version>1.2.13</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> <!-- <version>2.5.15</version>--> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-consul-discovery</artifactId> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-openfeign</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-configuration-processor</artifactId> <optional>true</optional> </dependency> <!-- 热更新 开始 --> <!--<dependency>--> <!--<groupId>org.springframework.boot</groupId>--> <!--<artifactId>spring-boot-devtools</artifactId>--> <!--</dependency>--> <!-- 热更新 结束--> <!--sswagger2开始--> <!-- <dependency>--> <!-- <groupId>io.springfox</groupId>--> <!-- <artifactId>springfox-swagger2</artifactId>--> <!-- <version>2.9.2</version>--> <!-- <exclusions>--> <!-- <exclusion>--> <!-- <groupId>com.google.guava</groupId>--> <!-- <artifactId>guava</artifactId>--> <!-- </exclusion>--> <!-- </exclusions>--> <!-- </dependency>--> <!-- <dependency>--> <!-- <groupId>com.google.guava</groupId>--> <!-- <artifactId>guava</artifactId>--> <!-- <version>32.0.1-android</version>--> <!-- </dependency>--> <!-- <dependency>--> <!-- <groupId>io.springfox</groupId>--> <!-- <artifactId>springfox-swagger-ui</artifactId>--> <!-- <version>2.10.0</version>--> <!-- </dependency>--> <dependency> <groupId>com.github.xiaoymin</groupId> <artifactId>swagger-bootstrap-ui</artifactId> <version>1.9.3</version> </dependency> <!--sswagger2结束--> <!--缓存方案--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-cache</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId> </dependency> <!--缓存方案结束--> <!-- 加密的依赖 开始--> <dependency> <groupId>com.github.ulisesbocchio</groupId> <artifactId>jasypt-spring-boot-starter</artifactId> </dependency> <!-- 加密的依赖 结束--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> <exclusions> <exclusion> <groupId>org.apache.tomcat.embed</groupId> <artifactId>tomcat-embed-websocket</artifactId> </exclusion> <exclusion> <groupId>org.apache.tomcat.embed</groupId> <artifactId>tomcat-embed-core</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.apache.tomcat.embed</groupId> <artifactId>tomcat-embed-websocket</artifactId> <version>9.0.86</version> </dependency> <dependency> <groupId>org.apache.tomcat.embed</groupId> <artifactId>tomcat-embed-core</artifactId> <version>9.0.90</version> </dependency> <!-- 链路追踪 --> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-sleuth</artifactId> </dependency> <dependency> <groupId>net.logstash.logback</groupId> <artifactId>logstash-logback-encoder</artifactId> <version>4.11</version> <exclusions> <exclusion> <groupId>ch.qos.logback</groupId> <artifactId>logback-core</artifactId> </exclusion> <exclusion> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> <version>2.12.7.2</version> </dependency> <dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-core</artifactId> <version>1.2.13</version> </dependency> <dependency> <groupId>de.codecentric</groupId> <artifactId>spring-boot-admin-starter-client</artifactId> <version>2.4.1</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-websocket</artifactId> </dependency> <dependency> <groupId>com.alibaba</groupId> <artifactId>druid-spring-boot-starter</artifactId> <version>1.2.4</version> </dependency> <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi</artifactId> <version>4.1.1</version> </dependency> <dependency> <groupId>com.sun.mail</groupId> <artifactId>javax.mail</artifactId> <version>1.6.2</version> </dependency> <dependency> <groupId>org.freemarker</groupId> <artifactId>freemarker</artifactId> </dependency> <dependency> <groupId>com.ibm.informix</groupId> <artifactId>jdbc</artifactId> <version>4.10.8.1</version> </dependency> <dependency> <groupId>com.alibaba</groupId> <artifactId>fastjson</artifactId> <version>1.2.83</version> </dependency> <dependency> <groupId>commons-fileupload</groupId> <artifactId>commons-fileupload</artifactId> <version>1.5</version> </dependency> <!--基础库--> <dependency> <groupId>com.picc.xzpt.baselib</groupId> <artifactId>piccxzpt_baselib</artifactId> <version>0.0.97</version> <exclusions> <exclusion> <groupId>xerces</groupId> <artifactId>xercesImpl</artifactId> </exclusion> <exclusion> <groupId>org.apache.tika</groupId> <artifactId>tika-core</artifactId> </exclusion> <exclusion> <groupId>log4j</groupId> <artifactId>log4j</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.apache.tika</groupId> <artifactId>tika-core</artifactId> <version>1.28.4</version> </dependency> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-text</artifactId> <version>1.10.0</version> </dependency> <dependency> <groupId>xerces</groupId> <artifactId>xercesImpl</artifactId> <version>2.12.2</version> </dependency> <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-core</artifactId> <version>2.3.2</version> </dependency> <!-- https://mvnrepository.com/artifact/org.owasp.esapi/esapi --> <dependency> <groupId>org.owasp.esapi</groupId> <artifactId>esapi</artifactId> <version>2.5.3.0</version> <exclusions> <exclusion> <groupId>org.owasp.antisamy</groupId> <artifactId>antisamy</artifactId> </exclusion> </exclusions> </dependency> </dependencies> <dependencyManagement> <dependencies> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-dependencies</artifactId> <version>${spring-cloud.version}</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement>
最新发布
11-19
pom文件如下:<?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.nineclient</groupId> <artifactId>rob-iRobotChatAdapter-parent</artifactId> <version>0.0.1-SNAPSHOT</version> </parent> <artifactId>iRobotChatAdapter</artifactId> <packaging>war</packaging> <name>iRobotChatAdapter Maven Webapp</name> <dependencyManagement> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-dependencies</artifactId> <version>3.5.3</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <java.version>17</java.version> </properties> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> <exclusions> <exclusion> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-tomcat</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>jakarta.servlet</groupId> <artifactId>jakarta.servlet-api</artifactId> <version>6.0.0</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> <version>2.16.0</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-core</artifactId> <version>2.16.0</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-annotations</artifactId> <version>2.16.0</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId> <exclusions> <!-- 排除Lettuce依赖 --> <exclusion> <groupId>io.lettuce</groupId> <artifactId>lettuce-core</artifactId> </exclusion> <exclusion> <groupId>redis.clients</groupId> <artifactId>jedis</artifactId> </exclusion> </exclusions> </dependency> <!-- <dependency> <groupId>org.redisson</groupId> <artifactId>redisson</artifactId> <version>3.17.5</version> </dependency>--> <dependency> <groupId>io.netty</groupId> <artifactId>netty-handler</artifactId> <version>4.2.2.Final</version> </dependency> <dependency> <groupId>org.yaml</groupId> <artifactId>snakeyaml</artifactId> <version>2.0</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-aop</artifactId> </dependency> <dependency> <groupId>com.alibaba</groupId> <artifactId>fastjson</artifactId> <version>2.0.57</version> </dependency> <dependency> <groupId>cn.hutool</groupId> <artifactId>hutool-all</artifactId> <version>5.8.39</version> </dependency> <!-- Swagger依赖 --> <dependency> <groupId>org.springdoc</groupId> <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId> <version>2.8.9</version> </dependency> <dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpclient</artifactId> <exclusions> <exclusion> <groupId>org.apache.httpcomponents.client5</groupId> <artifactId>httpclient5</artifactId> </exclusion> </exclusions> <version>4.5.14</version> </dependency> <dependency> <groupId>org.apache.httpcomponents.client5</groupId> <artifactId>httpclient5</artifactId> <version>5.5</version> </dependency> <dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpmime</artifactId> <version>4.5.14</version> </dependency> <dependency> <groupId>org.jsoup</groupId> <artifactId>jsoup</artifactId> <version>1.15.3</version> </dependency> <!-- <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId> </dependency>--> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-collections4</artifactId> <version>4.2</version> </dependency> <dependency> <groupId>com.aliyun.api.gateway</groupId> <artifactId>sdk-core-java</artifactId> <version>1.2.2</version> <exclusions> <exclusion> <artifactId>commons-collections4</artifactId> <groupId>org.apache.commons</groupId> </exclusion> <exclusion> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> </exclusion> <exclusion> <groupId>com.squareup.okhttp3</groupId> <artifactId>okhttp</artifactId> </exclusion> <exclusion> <groupId>org.apache.httpcomponents.client5</groupId> <artifactId>httpclient5</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> <version>3.18.0</version> </dependency> <dependency> <groupId>com.squareup.okhttp3</groupId> <artifactId>okhttp</artifactId> <version>4.9.2</version> <exclusions> <exclusion> <groupId>com.squareup.okio</groupId> <artifactId>okio</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>com.squareup.okio</groupId> <artifactId>okio</artifactId> <version>3.4.0</version> </dependency> <dependency> <groupId>redis.clients</groupId> <artifactId>jedis</artifactId> <version>5.2.0</version> </dependency> <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <version>1.18.36</version> </dependency> <dependency> <groupId>cn.com.aia.utils</groupId> <artifactId>crypto</artifactId> <version>0.0.3</version> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <version>3.5.3</version> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>3.4.0</version> <configuration> <failOnMissingWebXml>false</failOnMissingWebXml> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>17</source> <target>17</target> </configuration> </plugin> </plugins> <finalName>iRobotChatAdapter</finalName> </build> </project> 主类如下: package com.nineclient; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; import org.springframework.scheduling.annotation.EnableScheduling; /** * springboot 打war包进行发布,增加war包的启动类 * @author NSNP731 * */ @EnableConfigurationProperties @SpringBootApplication /* (scanBasePackages = {"com"}) */ @EnableScheduling public class Any800MessageAdapterApplication extends SpringBootServletInitializer { @Override public SpringApplicationBuilder configure(SpringApplicationBuilder application) { return application.sources(Any800MessageAdapterApplication.class); } public static void main(String[] args) { SpringApplication.run(Any800MessageAdapterApplication.class, args); } } 帮我改成打jar包部署的方式
08-15
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>cn.com.aia.gdm</groupId> <artifactId>gdm-dependencies</artifactId> <version>JDK17-0.0.1-SNAPSHOT</version> <packaging>pom</packaging> <properties> <maven.compiler.source>17</maven.compiler.source> <maven.compiler.target>17</maven.compiler.target> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <java.version>17</java.version> <compiler.plugin.version>3.10.1</compiler.plugin.version> <spring-cloud.version>4.3.0</spring-cloud.version> <spring-boot.version>3.5.3</spring-boot.version> <snakeyaml.version>2.3</snakeyaml.version> <guava.version>32.0.0-android</guava.version> <knife4j.version>4.5.0</knife4j.version> <jaxb.version>4.0.5</jaxb.version> <commons-io.version>2.17.0</commons-io.version> <mysql-connector.version>9.1.0</mysql-connector.version> <mybatis-plus.version>3.5.8</mybatis-plus.version> <pagehelper.version>2.1.0</pagehelper.version> <jsch.version>0.1.54</jsch.version> <easyexcel.version>3.3.2</easyexcel.version> <poi-ooxml.version>5.4.0</poi-ooxml.version> <commons-collections4.version>4.4</commons-collections4.version> <hutool.version>5.8.32</hutool.version> <thumbnailator.version>0.4.14</thumbnailator.version> <commons-compress>1.27.1</commons-compress> <logstash-logback.version>5.1</logstash-logback.version> <janino.version>3.1.10</janino.version> <skywalking.version>8.3.0</skywalking.version> <zxing-core.version>3.3.3</zxing-core.version> <lombok.version>1.18.36</lombok.version> <session.version>3.4.1</session.version> <httpclient.version>4.5.14</httpclient.version> <commons-lang3.version>3.18.0</commons-lang3.version> <twelvemonkeys.version>3.8.1</twelvemonkeys.version> <xhtmlrenderer.version>9.4.1</xhtmlrenderer.version> <openpdf.version>1.3.33</openpdf.version> <aliyun-oss.version>3.18.1</aliyun-oss.version> <pdfbox.version>2.0.25</pdfbox.version> <tea-openapi.version>0.2.6</tea-openapi.version> <jaxb-core.version>2.3.0.1</jaxb-core.version> <okio.version>3.5.0</okio.version> <gson.version>2.11.0</gson.version> <commons-pool2.version>2.12.0</commons-pool2.version> <lettuce-core.version>6.5.1.RELEASE</lettuce-core.version> <netty.version>4.1.118.Final</netty.version> <apigateway-spring-boot.version>1.2.0</apigateway-spring-boot.version> <apigateway-sdk-core.version>1.1.9</apigateway-sdk-core.version> <aia-crypto.version>0.0.4</aia-crypto.version> <bcprov-jdk18on.version>1.78</bcprov-jdk18on.version> <ons-client.version>2.0.6.Final</ons-client.version> <junit-jupiter.version>5.8.2</junit-jupiter.version> <credentials-java.version>0.2.8</credentials-java.version> <jakarta.version>1.3.4</jakarta.version> <jdom2.version>2.0.6.1</jdom2.version> <jettison.version>1.5.4</jettison.version> <ini4j.version>0.5.4</ini4j.version> <protobuf.version>4.28.2</protobuf.version> <commons-code.version>1.17.1</commons-code.version> <plexus-utils.version>3.4.1</plexus-utils.version> <esapi.version>2.6.0.0</esapi.version> <servlet-api.version>4.0.1</servlet-api.version> <httpclient5.version>5.4.3</httpclient5.version> <xmlunit.version>2.10.0</xmlunit.version> <fastjson.version>2.0.51</fastjson.version> <onelogin-saml.version>2.9.0</onelogin-saml.version> <xmlsec.version>2.2.6</xmlsec.version> <json-smart.version>2.5.2</json-smart.version> <aia-file.version>2.0.3-SNAPSHOT</aia-file.version> <spring-security-crypto.version>6.4.4</spring-security-crypto.version> <tomcat-embed-core>11.0.8</tomcat-embed-core> <activiti.version>7.1.0.M4</activiti.version> </properties> <dependencyManagement> <dependencies> <dependency> <groupId>org.activiti</groupId> <artifactId>activiti-spring-boot-starter</artifactId> <version>${activiti.version}</version> <exclusions> <!-- 排除旧版 Spring 依赖(避免冲突) --> <exclusion> <groupId>org.springframework</groupId> <artifactId>spring-beans</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>cn.com.aia.gdm</groupId> <artifactId>gdm-component-common</artifactId> <version>JDK17-0.0.1-SNAPSHOT</version> <scope>compile</scope> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-context</artifactId> <version>${spring-cloud.version}</version> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-bootstrap</artifactId> <version>${spring-cloud.version}</version> <exclusions> <exclusion> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter</artifactId> </exclusion> <exclusion> <groupId>org.bouncycastle</groupId> <artifactId>bcpkix-jdk15on</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-crypto</artifactId> <version>${spring-security-crypto.version}</version> </dependency> <dependency> <groupId>org.apache.tomcat.embed</groupId> <artifactId>tomcat-embed-core</artifactId> <version>${tomcat-embed-core}</version> </dependency> <dependency> <groupId>org.yaml</groupId> <artifactId>snakeyaml</artifactId> <version>${snakeyaml.version}</version> <exclusions> <exclusion> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-aop</artifactId> <version>${spring-boot.version}</version> <exclusions> <exclusion> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter</artifactId> </exclusion> <exclusion> <groupId>org.springframework</groupId> <artifactId>spring-jcl</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-validation</artifactId> <version>${spring-boot.version}</version> <exclusions> <exclusion> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> <version>${spring-boot.version}</version> <exclusions> <exclusion> <groupId>io.micrometer</groupId> <artifactId>micrometer-observation</artifactId> </exclusion> <exclusion> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-to-slf4j</artifactId> </exclusion> <exclusion> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <version>${spring-boot.version}</version> <exclusions> <exclusion> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> </exclusion> <exclusion> <groupId>org.springframework</groupId> <artifactId>spring-beans</artifactId> </exclusion> <exclusion> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> </exclusion> <exclusion> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-to-slf4j</artifactId> </exclusion> <exclusion> <groupId>jakarta.xml.bind</groupId> <artifactId>jakarta.xml.bind-api</artifactId> </exclusion> <exclusion> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-autoconfigure</artifactId> </exclusion> <exclusion> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter</artifactId> </exclusion> <exclusion> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> </exclusion> <exclusion> <groupId>org.xmlunit</groupId> <artifactId>xmlunit-core</artifactId> </exclusion> <exclusion> <groupId>net.minidev</groupId> <artifactId>json-smart</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>net.minidev</groupId> <artifactId>json-smart</artifactId> <version>${json-smart.version}</version> </dependency> <dependency> <groupId>org.xmlunit</groupId> <artifactId>xmlunit-core</artifactId> <version>${xmlunit.version}</version> <exclusions> <exclusion> <groupId>jakarta.activation</groupId> <artifactId>jakarta.activation-api</artifactId> </exclusion> <exclusion> <groupId>jakarta.xml.bind</groupId> <artifactId>jakarta.xml.bind-api</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> <version>${spring-boot.version}</version> <exclusions> <exclusion> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-freemarker</artifactId> <version>${spring-boot.version}</version> <exclusions> <exclusion> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-jdbc</artifactId> <version>${spring-boot.version}</version> <exclusions> <exclusion> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter</artifactId> </exclusion> <exclusion> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-mail</artifactId> <version>${spring-boot.version}</version> <exclusions> <exclusion> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter</artifactId> </exclusion> </exclusions> </dependency> <!-- redis --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId> <version>${spring-boot.version}</version> <exclusions> <exclusion> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-aop</artifactId> </exclusion> <exclusion> <groupId>org.springframework</groupId> <artifactId>spring-aop</artifactId> </exclusion> <exclusion> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> </exclusion> <exclusion> <groupId>org.springframework</groupId> <artifactId>spring-tx</artifactId> </exclusion> <exclusion> <groupId>org.springframework</groupId> <artifactId>spring-context-support</artifactId> </exclusion> <exclusion> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> </exclusion> <exclusion> <groupId>org.springframework</groupId> <artifactId>spring-beans</artifactId> </exclusion> <exclusion> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> </exclusion> <exclusion> <groupId>io.lettuce</groupId> <artifactId>lettuce-core</artifactId> </exclusion> <exclusion> <groupId>jakarta.xml.bind</groupId> <artifactId>jakarta.xml.bind-api</artifactId> </exclusion> </exclusions> </dependency> <!-- redis lettuce底层依赖commons-pool2 --> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-pool2</artifactId> <version>${commons-pool2.version}</version> </dependency> <dependency> <groupId>io.lettuce</groupId> <artifactId>lettuce-core</artifactId> <version>${lettuce-core.version}</version> <exclusions> <exclusion> <groupId>io.netty</groupId> <artifactId>netty-common</artifactId> </exclusion> <exclusion> <groupId>io.netty</groupId> <artifactId>netty-handler</artifactId> </exclusion> <exclusion> <groupId>io.netty</groupId> <artifactId>netty-transport</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>io.netty</groupId> <artifactId>netty-common</artifactId> <version>${netty.version}</version> <scope>compile</scope> </dependency> <dependency> <groupId>io.netty</groupId> <artifactId>netty-handler</artifactId> <version>${netty.version}</version> <scope>compile</scope> </dependency> <dependency> <groupId>io.netty</groupId> <artifactId>netty-transport</artifactId> <version>${netty.version}</version> <scope>compile</scope> </dependency> <dependency> <groupId>io.netty</groupId> <artifactId>netty-transport-native-epoll</artifactId> <version>${netty.version}</version> <!-- Linux平台区分x86_64架构或aarch64 --> <classifier>linux-x86_64</classifier> </dependency> <!-- session --> <dependency> <groupId>org.springframework.session</groupId> <artifactId>spring-session-core</artifactId> <version>${session.version}</version> <exclusions> <exclusion> <groupId>org.springframework</groupId> <artifactId>spring-jcl</artifactId> </exclusion> </exclusions> </dependency> <!-- lombok --> <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <version>${lombok.version}</version> </dependency> <!-- SFTP --> <!-- <dependency>--> <!-- <groupId>com.jcraft</groupId>--> <!-- <artifactId>jsch</artifactId>--> <!-- <version>${jsch.version}</version>--> <!-- </dependency>--> <!-- 工具包 --> <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>org.apache.commons</groupId> <artifactId>commons-collections4</artifactId> <version>${commons-collections4.version}</version> </dependency> <!--整合Knife4j--> <dependency> <groupId>com.github.xiaoymin</groupId> <artifactId>knife4j-openapi3-jakarta-spring-boot-starter</artifactId> <version>${knife4j.version}</version> <exclusions> <exclusion> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-autoconfigure</artifactId> </exclusion> <exclusion> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> </exclusion> <exclusion> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-core</artifactId> </exclusion> <exclusion> <groupId>com.fasterxml.jackson.datatype</groupId> <artifactId>jackson-datatype-jsr310</artifactId> </exclusion> <exclusion> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> </exclusion> <exclusion> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-annotations</artifactId> </exclusion> <exclusion> <groupId>jakarta.validation</groupId> <artifactId>jakarta.validation-api</artifactId> </exclusion> <exclusion> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> </exclusion> <exclusion> <groupId>jakarta.xml.bind</groupId> <artifactId>jakarta.xml.bind-api</artifactId> </exclusion> <exclusion> <groupId>org.springdoc</groupId> <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.springdoc</groupId> <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId> <version>2.7.0</version> </dependency> <dependency> <groupId>org.glassfish.jaxb</groupId> <artifactId>jaxb-runtime</artifactId> <version>${jaxb.version}</version> </dependency> <!-- mybatisplus --> <!--<dependency> <groupId>com.microsoft.sqlserver</groupId> <artifactId>mssql-jdbc</artifactId> <version>12.8.1.jre11</version> </dependency>--> <dependency> <groupId>com.mysql</groupId> <artifactId>mysql-connector-j</artifactId> <version>${mysql-connector.version}</version> </dependency> <dependency> <groupId>com.google.protobuf</groupId> <artifactId>protobuf-java</artifactId> <version>${protobuf.version}</version> </dependency> <dependency> <groupId>com.baomidou</groupId> <artifactId>mybatis-plus-generator</artifactId> <version>${mybatis-plus.version}</version> </dependency> <dependency> <groupId>com.baomidou</groupId> <artifactId>mybatis-plus-spring-boot3-starter</artifactId> <version>${mybatis-plus.version}</version> <exclusions> <exclusion> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-jdbc</artifactId> </exclusion> <exclusion> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-autoconfigure</artifactId> </exclusion> <exclusion> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> </exclusion> <exclusion> <groupId>org.freemarker</groupId> <artifactId>freemarker</artifactId> </exclusion> <exclusion> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-commons</artifactId> </exclusion> <exclusion> <groupId>org.jetbrains.kotlin</groupId> <artifactId>kotlin-stdlib-jdk8</artifactId> </exclusion> </exclusions> </dependency> <!-- pagehelper --> <dependency> <groupId>com.github.pagehelper</groupId> <artifactId>pagehelper-spring-boot-starter</artifactId> <version>${pagehelper.version}</version> <exclusions> <exclusion> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter</artifactId> </exclusion> <exclusion> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-jdbc</artifactId> </exclusion> <exclusion> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-autoconfigure</artifactId> </exclusion> <exclusion> <groupId>com.baomidou</groupId> <artifactId>mybatis-plus-core</artifactId> </exclusion> <exclusion> <groupId>org.mybatis</groupId> <artifactId>mybatis</artifactId> </exclusion> <exclusion> <groupId>com.github.jsqlparser</groupId> <artifactId>jsqlparser</artifactId> </exclusion> <exclusion> <groupId>org.mybatis</groupId> <artifactId>mybatis-spring</artifactId> </exclusion> </exclusions> </dependency> <!-- excel --> <dependency> <groupId>com.alibaba</groupId> <artifactId>easyexcel</artifactId> <version>${easyexcel.version}</version> <exclusions> <exclusion> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> </exclusion> <exclusion> <groupId>commons-codec</groupId> <artifactId>commons-codec</artifactId> </exclusion> <exclusion> <groupId>org.ow2.asm</groupId> <artifactId>asm</artifactId> </exclusion> <exclusion> <groupId>org.apache.poi</groupId> <artifactId>poi-ooxml</artifactId> </exclusion> <exclusion> <groupId>org.apache.poi</groupId> <artifactId>poi-ooxml-schemas</artifactId> </exclusion> <exclusion> <groupId>org.apache.poi</groupId> <artifactId>poi</artifactId> </exclusion> <exclusion> <groupId>org.apache.xmlbeans</groupId> <artifactId>xmlbeans</artifactId> </exclusion> <exclusion> <groupId>commons-io</groupId> <artifactId>commons-io</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi-ooxml</artifactId> <version>${poi-ooxml.version}</version> <exclusions> <exclusion> <groupId>commons-io</groupId> <artifactId>commons-io</artifactId> </exclusion> <exclusion> <groupId>org.apache.commons</groupId> <artifactId>commons-compress</artifactId> </exclusion> </exclusions> </dependency> <!-- hutool工具包 --> <dependency> <groupId>cn.hutool</groupId> <artifactId>hutool-all</artifactId> <version>${hutool.version}</version> </dependency> <!-- thumbnailator 图片处理工具 --> <dependency> <groupId>net.coobird</groupId> <artifactId>thumbnailator</artifactId> <version>${thumbnailator.version}</version> </dependency> <!-- 文件压缩工具包 --> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-compress</artifactId> <version>${commons-compress}</version> </dependency> <!-- 日志跟踪 --> <dependency> <groupId>net.logstash.logback</groupId> <artifactId>logstash-logback-encoder</artifactId> <version>${logstash-logback.version}</version> <exclusions> <exclusion> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> </exclusion> <exclusion> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> </exclusion> <exclusion> <groupId>ch.qos.logback</groupId> <artifactId>logback-core</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.codehaus.janino</groupId> <artifactId>janino</artifactId> <version>${janino.version}</version> </dependency> <!-- skywalking链路追踪 --> <dependency> <groupId>org.apache.skywalking</groupId> <artifactId>apm-toolkit-logback-1.x</artifactId> <version>${skywalking.version}</version> </dependency> <!-- 二维码生成 --> <dependency> <groupId>com.google.zxing</groupId> <artifactId>core</artifactId> <version>${zxing-core.version}</version> </dependency> <!-- twelvemonkeys TIFF处理工具 --> <dependency> <groupId>com.twelvemonkeys.imageio</groupId> <artifactId>imageio-jpeg</artifactId> <version>${twelvemonkeys.version}</version> </dependency> <dependency> <groupId>com.twelvemonkeys.imageio</groupId> <artifactId>imageio-tiff</artifactId> <version>${twelvemonkeys.version}</version> </dependency> <!-- html转pdf --> <dependency> <groupId>org.xhtmlrenderer</groupId> <artifactId>flying-saucer-pdf</artifactId> <version>${xhtmlrenderer.version}</version> </dependency> <!-- pdf util --> <dependency> <groupId>com.github.librepdf</groupId> <artifactId>openpdf</artifactId> <version>${openpdf.version}</version> </dependency> <!-- 阿里OSS --> <dependency> <groupId>com.aliyun.oss</groupId> <artifactId>aliyun-sdk-oss</artifactId> <version>${aliyun-oss.version}</version> <exclusions> <exclusion> <groupId>com.google.code.gson</groupId> <artifactId>gson</artifactId> </exclusion> <exclusion> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> </exclusion> <exclusion> <groupId>javax.xml.bind</groupId> <artifactId>jaxb-api</artifactId> </exclusion> <exclusion> <groupId>org.jdom</groupId> <artifactId>jdom2</artifactId> </exclusion> <exclusion> <groupId>org.codehaus.jettison</groupId> <artifactId>jettison</artifactId> </exclusion> <exclusion> <groupId>org.ini4j</groupId> <artifactId>ini4j</artifactId> </exclusion> <exclusion> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.jdom</groupId> <artifactId>jdom2</artifactId> <version>${jdom2.version}</version> </dependency> <dependency> <groupId>org.codehaus.jettison</groupId> <artifactId>jettison</artifactId> <version>${jettison.version}</version> </dependency> <dependency> <groupId>org.ini4j</groupId> <artifactId>ini4j</artifactId> <version>${ini4j.version}</version> </dependency> <!-- PDF工具 --> <dependency> <groupId>org.apache.pdfbox</groupId> <artifactId>pdfbox</artifactId> <version>${pdfbox.version}</version> <exclusions> <exclusion> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>com.sun.xml.bind</groupId> <artifactId>jaxb-core</artifactId> <version>${jaxb-core.version}</version> </dependency> <!-- 阿里SDK gson引入冲突,单独引入 --> <dependency> <groupId>com.google.code.gson</groupId> <artifactId>gson</artifactId> <version>${gson.version}</version> </dependency> <!-- apiGateway --> <dependency> <groupId>com.aia.cloudsolution</groupId> <artifactId>apigateway-spring-boot-starter</artifactId> <version>${apigateway-spring-boot.version}</version> </dependency> <dependency> <groupId>com.aliyun.api.gateway</groupId> <artifactId>sdk-core-java</artifactId> <version>${apigateway-sdk-core.version}</version> <exclusions> <exclusion> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> </exclusion> <exclusion> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpclient</artifactId> </exclusion> <exclusion> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> </exclusion> <exclusion> <groupId>com.squareup.okhttp3</groupId> <artifactId>okhttp</artifactId> </exclusion> <exclusion> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> </exclusion> <exclusion> <groupId>org.codehaus.plexus</groupId> <artifactId>plexus-utils</artifactId> </exclusion> <exclusion> <groupId>commons-codec</groupId> <artifactId>commons-codec</artifactId> </exclusion> <exclusion> <groupId>commons-io</groupId> <artifactId>commons-io</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>commons-codec</groupId> <artifactId>commons-codec</artifactId> <version>${commons-code.version}</version> </dependency> <dependency> <groupId>org.codehaus.plexus</groupId> <artifactId>plexus-utils</artifactId> <version>${plexus-utils.version}</version> </dependency> <!-- 友邦配置文件加解密工具包 --> <dependency> <groupId>cn.com.aia.utils</groupId> <artifactId>crypto</artifactId> <version>${aia-crypto.version}</version> <exclusions> <exclusion> <groupId>org.bouncycastle</groupId> <artifactId>bcprov-jdk18on</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>cn.com.aia.utils</groupId> <artifactId>file-server</artifactId> <version>${aia-file.version}</version> <exclusions> <exclusion> <groupId>com.jcraft</groupId> <artifactId>jsch</artifactId> </exclusion> <exclusion> <groupId>cn.com.aia</groupId> <artifactId>aia-passwd-alg</artifactId> </exclusion> <exclusion> <groupId>org.bouncycastle</groupId> <artifactId>bcprov-jdk15on</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.bouncycastle</groupId> <artifactId>bcprov-jdk18on</artifactId> <version>${bcprov-jdk18on.version}</version> </dependency> <!-- rocketMq --> <dependency> <groupId>com.aliyun.openservices</groupId> <artifactId>ons-client</artifactId> <version>${ons-client.version}</version> </dependency> <!-- esapi --> <dependency> <groupId>org.owasp.esapi</groupId> <artifactId>esapi</artifactId> <version>${esapi.version}</version> <classifier>jakarta</classifier> <exclusions> <exclusion> <groupId>log4j</groupId> <artifactId>log4j</artifactId> </exclusion> <exclusion> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> </exclusion> <exclusion> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> </exclusion> <exclusion> <groupId>commons-io</groupId> <artifactId>commons-io</artifactId> </exclusion> <exclusion> <groupId>commons-collections</groupId> <artifactId>commons-collections</artifactId> </exclusion> <exclusion> <groupId>org.apache.httpcomponents.client5</groupId> <artifactId>httpclient5</artifactId> </exclusion> <exclusion> <groupId>org.apache.httpcomponents.core5</groupId> <artifactId>httpcore5</artifactId> </exclusion> <exclusion> <groupId>xerces</groupId> <artifactId>xercesImpl</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.apache.httpcomponents.client5</groupId> <artifactId>httpclient5</artifactId> <version>${httpclient5.version}</version> </dependency> <dependency> <groupId>com.alibaba</groupId> <artifactId>fastjson</artifactId> <version>${fastjson.version}</version> </dependency> <dependency> <groupId>com.onelogin</groupId> <artifactId>java-saml</artifactId> <version>${onelogin-saml.version}</version> <exclusions> <exclusion> <artifactId>commons-codec</artifactId> <groupId>commons-codec</groupId> </exclusion> <exclusion> <artifactId>woodstox-core</artifactId> <groupId>com.fasterxml.woodstox</groupId> </exclusion> <exclusion> <artifactId>xmlsec</artifactId> <groupId>org.apache.santuario</groupId> </exclusion> </exclusions> </dependency> <dependency> <artifactId>xmlsec</artifactId> <groupId>org.apache.santuario</groupId> <version>${xmlsec.version}</version> <exclusions> <exclusion> <groupId>jakarta.xml.bind</groupId> <artifactId>jakarta.xml.bind-api</artifactId> </exclusion> <exclusion> <groupId>org.glassfish.jaxb</groupId> <artifactId>jaxb-runtime</artifactId> </exclusion> </exclusions> </dependency> </dependencies> </dependencyManagement> <!-- 设置deploy的地址 --> <distributionManagement> <snapshotRepository> <id>nexus-snapshots</id> <url>https://cn.tci.aia.biz/nexus/repository/maven-snapshots/</url> </snapshotRepository> <repository> <id>nexus-releases</id> <url>https://cn.tci.aia.biz/nexus/repository/maven-releases/</url> </repository> </distributionManagement> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>${compiler.plugin.version}</version> <configuration> <source>${java.version}</source> <target>${java.version}</target> </configuration> </plugin> </plugins> </build> </project>这个依赖如何整合activiti
07-27
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值