TaKiPi网站用数据说话,分析了60678个 GitHub 上的Library。研究了这些库的导入语句,其中包括Github的前5,216个 Java 项目使用的11,939个独特的Java库。
前20名Java库
意料外的
Hadoop
Hadoop排在42位,Apache Spark没有在前100名的列表中。Apache Zookeeper到了75位。
Log4j
Log4j的受欢迎程度是Logback的两倍多 – Log4j在16.76%的项目中被使用,超出了Logback的8.45%。
SQL> MongoDB > PostgreSQL
Java SQL连接器在27位,MongoDB在87位,PostgreSQL仅仅在97位。
结论
JUnit 是Java Libraries的无可争议的王者 – 64%的Github顶级Java项目导入了JUnit。接下来是 Spring 前端的spring-test和testng ,这些是我们在前20名列表中看到的前3名Java测试库。
slf4j 是最受欢迎的日志库 – 无论是使用Log4j,Logback还是其他日志记录引擎,拥有超过22%的Github顶级Java项目中1,184个都使用slf4j的日志facade。
前100中的有14个来自Spring框架 – 前100名中最受欢迎的框架(甚至超过前100名中的有12个库入选的apache-commons),以spring-context为最受欢迎的库。
Guava 是第4名 , google 核心的 Java 常用库,有815个Github顶级Java项目,占15.6%。
apache-commons 确实如其名字一下很common。Apache Commons包含了很多开源的工具,用于解决平时编程经常会遇到的问题,减少重复劳动。commos-io排在第5位/0} ,另外还有11来自apache-commons的库排在前100之内。
Mockito是最受欢迎的Java模拟测试框架 – 559个项目在使用(10.72%),表明了其使其重要地位,排名第七。
开发者爱使用joda-time – 这并不奇怪。但是能到18位,也是挺有意思的。这个库提供了一组Java类包用于处理包括ISO8601标准在内的date和time。可以利用它把JDK Date和Calendar类完全替换掉,而且仍然能够提供很好的集成。
更多
#65 – Bukkit – 前100名榜单中唯一的游戏库,Minecraft服务器。
#66 – Jetty
#81 – PowerMock – 它可以用于解决通常被认为是难以甚至不可能测试的测试问题”。
#90 – Google Protobuf – 语言中立的,平台中立的,可扩展的序列化数据的方式。用于通信协议,数据存储等。
#100 – AssertJ – 为Java提供了流式断言。接受来自FEST Assert的迁移。
前100个库按类型分
下面是原始数据
Org | Library | Type | Projects who use it | % of Projects |
junit | junit | Testing | 3345 | 64.13% |
org.slf4j | slf4j-api | Logging | 1184 | 22.70% |
log4j | log4j | Logging | 876 | 16.79% |
com.google.guava | guava | Utilities | 815 | 15.63% |
commons-io | commons-io | Utilities | 659 | 12.63% |
org.slf4j | slf4j-log4j12 | Logging | 641 | 12.29% |
org.mockito | mockito-all | Mocks | 559 | 10.72% |
commons-lang | commons-lang | Utilities | 494 | 9.47% |
javax.servlet | servlet-api | Java Extension | 444 | 8.51% |
ch.qos.logback | logback-classic | Logging | 441 | 8.45% |
org.springframework | spring-context | Utilities | 388 | 7.44% |
org.mockito | mockito-core | Mocks | 378 | 7.25% |
org.apache.httpcomponents | httpclient | Web | 360 | 6.90% |
org.springframework | spring-test | Testing | 358 | 6.86% |
org.apache.commons | commons-lang3 | Utilities | 353 | 6.77% |
commons-codec | commons-codec | Utilities | 348 | 6.67% |
commons-logging | commons-logging | Logging | 347 | 6.65% |
joda-time | joda-time | Utilities | 326 | 6.25% |
org.testng | testng | Testing | 324 | 6.21% |
org.slf4j | jcl-over-slf4j | Logging | 324 | 6.21% |
org.codehaus.jackson | jackson-mapper-asl | Parsing | 304 | 5.83% |
org.springframework | spring-core | Utilities | 297 | 5.69% |
com.google.code.gson | gson | Parsing | 295 | 5.66% |
com.fasterxml.jackson.core | jackson-databind | Parsing | 293 | 5.62% |
org.springframework | spring-webmvc | Web | 280 | 5.37% |
com.google.android | android | Android | 254 | 4.87% |
mysql | mysql-connector-java | DB | 250 | 4.79% |
org.springframework | spring-web | Web | 247 | 4.74% |
commons-collections | commons-collections | Utilities | 243 | 4.66% |
org.hamcrest | hamcrest-all | Testing | 238 | 4.56% |
org.springframework | spring-beans | Utilities | 220 | 4.22% |
org.slf4j | slf4j-simple | Logging | 210 | 4.03% |
org.springframework | spring-jdbc | DB | 202 | 3.87% |
commons-cli | commons-cli | Parsing | 198 | 3.80% |
org.easymock | easymock | Mocks | 196 | 3.76% |
com.h2database | h2 | DB | 196 | 3.76% |
com.fasterxml.jackson.core | jackson-core | Parsing | 189 | 3.62% |
org.codehaus.jackson | jackson-core-asl | Parsing | 188 | 3.60% |
org.springframework | spring-orm | DB | 185 | 3.55% |
javax.servlet | javax.servlet-api | Java Extension | 181 | 3.47% |
org.hamcrest | hamcrest-library | Testing | 180 | 3.45% |
org.apache.hadoop | hadoop-core | DB | 179 | 3.43% |
commons-httpclient | commons-httpclient | Web | 174 | 3.34% |
org.springframework | spring-tx | DB | 171 | 3.28% |
org.springframework | spring-aop | AOP | 171 | 3.28% |
org.hibernate | hibernate-validator | DB | 169 | 3.24% |
org.hibernate | hibernate-entitymanager | DB | 167 | 3.20% |
org.elasticsearch | elasticsearch | DB | 167 | 3.20% |
javax.servlet | jstl | Java Extension | 166 | 3.18% |
org.hibernate | hibernate-core | DB | 166 | 3.18% |
org.json | json | Parsing | 162 | 3.11% |
commons-dbcp | commons-dbcp | DB | 159 | 3.05% |
org.hamcrest | hamcrest-core | Testing | 158 | 3.03% |
org.apache.maven | maven-plugin-api | Build | 143 | 2.74% |
com.google.inject | guice | Utilities | 141 | 2.70% |
commons-fileupload | commons-fileupload | Web | 140 | 2.68% |
com.google.code.findbugs | jsr305 | Testing | 134 | 2.57% |
org.hsqldb | hsqldb | DB | 133 | 2.55% |
javax.mail | Java Extension | 132 | 2.53% | |
org.springframework | spring-context-support | Utilities | 131 | 2.51% |
ch.qos.logback | logback-core | Logging | 131 | 2.51% |
commons-beanutils | commons-beanutils | Utilities | 131 | 2.51% |
org.aspectj | aspectjrt | AOP | 131 | 2.51% |
com.fasterxml.jackson.core | jackson-annotations | Parsing | 128 | 2.45% |
org.bukkit | bukkit | Gaming | 127 | 2.43% |
org. eclipse .jetty | jetty-server | Web | 124 | 2.38% |
javax.validation | validation-api | Java Extension | 122 | 2.34% |
cglib | cglib-nodep | Mocks | 120 | 2.30% |
org.apache.httpcomponents | httpcore | Web | 117 | 2.24% |
javax.inject | javax.inject | Java Extension | 116 | 2.22% |
cglib | cglib | Mocks | 114 | 2.19% |
com.googlecode.json-simple | json-simple | Parsing | 113 | 2.17% |
xerces | xercesImpl | Parsing | 113 | 2.17% |
org.apache.velocity | velocity | Web | 111 | 2.13% |
org.apache.zookeeper | zookeeper | Web | 110 | 2.11% |
javax.servlet.jsp | jsp-api | Java Extension | 108 | 2.07% |
org.springframework.security | spring-security-config | Web | 107 | 2.05% |
org.aspectj | aspectjweaver | AOP | 106 | 2.03% |
org.codehaus.groovy | groovy-all | Groovy | 105 | 2.01% |
org.springframework.security | spring-security-web | Web | 103 | 1.97% |
org.powermock | powermock-module-junit4 | Mocks | 102 | 1.96% |
org.apache.maven.scm | maven-scm-provider-gitexe | Build | 101 | 1.94% |
org.springframework.security | spring-security-core | Web | 101 | 1.94% |
commons-configuration | commons-configuration | Utilities | 96 | 1.84% |
org.apache.hadoop | hadoop-common | DB | 95 | 1.82% |
org.codehaus.plexus | plexus-utils | Utilities | 95 | 1.82% |
org.mongodb | mongo-java-driver | DB | 94 | 1.80% |
org.slf4j | log4j-over-slf4j | Logging | 94 | 1.80% |
org.apache.lucene | lucene-core | DB | 94 | 1.80% |
com.google.protobuf | protobuf-java | Utilities | 92 | 1.76% |
org.eclipse.jetty | jetty-servlet | Web | 92 | 1.76% |
org.javassist | javassist | AOP | 92 | 1.76% |
org.slf4j | jul-to-slf4j | Logging | 91 | 1.74% |
org.powermock | powermock-api-mockito | Mocks | 91 | 1.74% |
org.slf4j | slf4j-jdk14 | Logging | 91 | 1.74% |
com.sun.jersey | jersey-server | Web | 89 | 1.71% |
postgresql | postgresql | DB | 87 | 1.67% |
org.apache.httpcomponents | httpmime | Web | 87 | 1.67% |
com.thoughtworks.xstream | xstream | Parsing | 86 | 1.65% |
org.assertj | assertj-core | Testing | 86 | 1.65% |