프로젝트
GitHub에서 보기
avantgardnerio/depends
소개
The missing linker for the JVM.
개발 도구측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
Originaldepends
The missing linker for the JVM.
Problem statement
Have you ever gotten an error like this:
java.lang.NoClassDefFoundError: com/google/gson/JsonParseException
at io.kubernetes.client.ApiClient.<init>(ApiClient.java:85)
at io.kubernetes.client.util.ClientBuilder.build(ClientBuilder.java:202)
at io.kubernetes.client.util.Config.defaultClient(Config.java:104)
Caused by: java.lang.ClassNotFoundException: com.google.gson.JsonParseException
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 26 more
Then spent hours trying different versions of dependencies until it magically goes away?
Solution
Just run:
java -jar build/libs/depends-1.0-SNAPSHOT.jar com.mycompany.app:my-app:1.0-SNAPSHOT --filter=JsonParseException
And get a helpful report of what's broken:
broken apis:
com.fasterxml.jackson.core.JsonParseException.getMessage()Ljava/lang/String; is only present in
[com.fasterxml.jackson.core:jackson-core [2.9.3, 2.9.5, 2.9.4, 2.9.6]]
com.fasterxml.jackson.core.JsonParseException.<init>(Lcom/fasterxml/jackson/core/JsonParser;Ljava/lang/String;Ljava/lang/Throwable;)V is only present in
[com.fasterxml.jackson.core:jackson-core [2.9.3, 2.9.5, 2.9.4, 2.7.8, 2.9.6]]
com.fasterxml.jackson.core.JsonParseException.<init>(Lcom/fasterxml/jackson/core/JsonParser;Ljava/lang/String;)V is only present in
[com.fasterxml.jackson.core:jackson-core [2.9.3, 2.9.5, 2.9.4, 2.7.8, 2.9.6]]
com.fasterxml.jackson.core.JsonParseException.<init>(Lcom/fasterxml/jackson/core/JsonParser;Ljava/lang/String;Lcom/fasterxml/jackson/core/JsonLocation;)V is only present in
[com.fasterxml.jackson.core:jackson-core [2.9.3, 2.9.5, 2.9.4, 2.7.8, 2.9.6]]
Then pick a version from the list!
Building
git clone https://github.com/bgard6977/depends.git
cd dependes
./gradlew build
# This will create depends.jar
# Now, You'll need to run mvn install or gradle install on your project, to put build your code and put the resulting jar into your maven/gradle local cache.
# After you've done artifact install, you can run depends on it like that:
java -jar build/libs/depends-1.0-SNAPSHOT.jar com.mycompany.app:my-app:1.0-SNAPSHOT --filter=JsonParseException
# com.mycompany.app:my-app:1.0-SNAPSHOT is the artifact you want to check.
How it works
- It uses ShrinkWrap Resolver to build a dependency graph of your project.
- It scans through the classes in each jar and uses ASM4 to find function invocations.
- It builds a map of all cross-module function calls.
- It assumes any function called from an external module is a public API.
- It compares all the versions of each module to see which methods are not present in all versions.
- It filters these by a given search term.
- Finally, it prints a report to help you figure out which version to use when a dependency conflict arrises.
Roadmap
- Count all the broken calls, and recommend the version of each library most likely to not have missing method exceptions at run time.
- Produce a report to name-and-shame semver violations.
- Convert this project into a Gradle ResolutionStrategy so it Just Works.
관련 프로젝트 살펴보기
불러오는 중…