java常用jar包

1,050 阅读1分钟

jar包搜索


SSH

// spring  https://mvnrepository.com/artifact/org.springframework/spring-context
compile group: 'org.springframework', name: 'spring-context', version: '5.1.6.RELEASE'
// spring-mvc  https://mvnrepository.com/artifact/org.springframework/spring-webmvc
compile group: 'org.springframework', name: 'spring-webmvc', version: '5.1.6.RELEASE'
// mybaits  https://mvnrepository.com/artifact/org.mybatis/mybatis
compile group: 'org.mybatis', name: 'mybatis', version: '3.5.1'
// mysql数据库 https://mvnrepository.com/artifact/mysql/mysql-connector-java
compile group: 'mysql', name: 'mysql-connector-java', version: '8.0.11'
// c3p0数据库连接池  https://mvnrepository.com/artifact/com.mchange/c3p0
compile group: 'com.mchange', name: 'c3p0', version: '0.9.5.4'


//下面可选
// context扩展  https://mvnrepository.com/artifact/org.springframework/spring-context-support
compile group: 'org.springframework', name: 'spring-context-support', version: '5.1.6.RELEASE'
// spring事务  https://mvnrepository.com/artifact/org.springframework/spring-tx
compile group: 'org.springframework', name: 'spring-tx', version: '5.1.6.RELEASE'
// Spring-JDBC  https://mvnrepository.com/artifact/org.springframework/spring-jdbc
compile group: 'org.springframework', name: 'spring-jdbc', version: '5.1.6.RELEASE'


Spring配置

日志

// https://mvnrepository.com/artifact/org.slf4j/slf4j-api
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.8.0-beta4'
// https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-core
compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.11.2'

Json解析

// https://mvnrepository.com/artifact/com.google.code.gson/gson
compile group: 'com.google.code.gson', name: 'gson', version: '2.8.5'
// https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind
compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.9.8'

数据库连接池

// https://mvnrepository.com/artifact/com.mchange/c3p0
compile group: 'com.mchange', name: 'c3p0', version: '0.9.5.4'

HTML解析

// https://mvnrepository.com/artifact/org.jsoup/jsoup
compile group: 'org.jsoup', name: 'jsoup', version: '1.11.3'
#### HTTP Clients
```gradle
// https://mvnrepository.com/artifact/com.squareup.okhttp3/okhttp
compile group: 'com.squareup.okhttp3', name: 'okhttp', version: '3.14.1'

字节码解释器

// https://mvnrepository.com/artifact/org.javassist/javassist
compile group: 'org.javassist', name: 'javassist', version: '3.25.0-GA'

Aspectj (AOP)

// https://mvnrepository.com/artifact/org.aspectj/aspectjweaver
compile group: 'org.aspectj', name: 'aspectjweaver', version: '1.9.3'

缓存

// https://mvnrepository.com/artifact/org.ehcache/ehcache
compile group: 'org.ehcache', name: 'ehcache', version: '3.7.1'
// https://mvnrepository.com/artifact/net.sf.ehcache/ehcache
compile group: 'net.sf.ehcache', name: 'ehcache', version: '2.10.6'

  • ehcache.xml配置文件
<?xml version="1.0" encoding="UTF-8"?>
<ehcache>
    <diskStore path="java.io.tmpdir"/>
    <defaultCache
            maxElementsInMemory="10000"
            eternal="false"
            timeToIdleSeconds="120"
            timeToLiveSeconds="120"
            maxElementsOnDisk="10000000"
            memoryStoreEvictionPolicy="LRU"
    />
</ehcache>