is there a tool that can list third party "packages" that contain (third party) classes referenced in the JAR ? Let say that it would recognize what is "home" package from JAR file definition and it would print out a list of fully qualified names of third party classes up to 3rd level that were referenced within the JAR.
org.apache.commons org.apache.maven javax.servlet.jsp org.eclipse.persistence org.apache.jackrabbit
the purpose is that I need to find maven dependencies for that JAR file and deploy it as a maven artifact.
jar file. Use the -verbose:class option to find class-level dependencies or use the -v or -verbose option to include dependencies from the same JAR file.
a dependency management utility for jar files. It's primary purpose is to traverse through a directory, parse each of the jar files in that directory, and identify the dependencies between the jar files. The output is an xml file representing the PhysicalDependencies between the jar files.
Normally, when we package a project into a jarW file, the jar file doesn't contain its dependencies, so the dependency jar files would need to be included in the classpathW in order to execute a class in the project's jar file that uses one of the dependencies.
You can use Java jar tool. List the content of jar file in a txt file and you can see all the classes in the jar. Also, this won't allow you to inspect annotations, which is likely something you'll want to do if you're scanning classes at runtime.
There is a new tool since JDK 8: jdeps
https://wiki.openjdk.java.net/display/JDK8/Java+Dependency+Analysis+Tool
jdeps is a new command-line tool added since JDK 8 for developers to use to understand the static dependencies of their applications and libraries. jdeps is a static analysis tool on the given class files
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With