slachiewicz opened a new pull request, #323:
URL: https://github.com/apache/maven-dependency-analyzer/pull/323

   <!-- Add your description here... what, why and how you resolve the issue -->
   
   This adds a `Path` based analysis API to the 1.x line.
   
   The analysis of an artifact is done on the file of the artifact, which is a 
`java.nio.file.Path`. The API only
   accepted `URL`s, so callers had to convert the file of the artifact to a URL 
first, and jar files were read with a
   `JarInputStream`, which only gives a sequential access to the entries.
   
   The class analysis now also accepts a `Path`:
   
   - `ClassAnalyzer.analyze(Path, ClassesPatterns)` and 
`DependencyAnalyzer.analyzeUsages(Path, ClassesPatterns)`,
     with the matching `analyze(Path)` conveniences,
   - `ClassFileVisitorUtils.accept(Path, ClassFileVisitor)`, which reads a jar 
file given as a `Path` with a `ZipFile`,
     giving a random access to the entries.
   
   This is purely additive: the `URL` based API and its behaviour are 
unchanged, and the existing tests still pass. The
   byte code is still Java 8, so the 1.x baseline is untouched.
   
   The same API is used by the Maven 4 port of the analyzer (#322), so 
consumers that have to support both lines can use
   the same calls with the 1.x and the 2.x artifacts.
   
   Verified with `mvn -Prun-its verify` on Maven 3.9.16: 152 unit tests and 23 
integration tests pass.
   
   ---
   
   To make clear that you license your contribution under
   the [Apache License Version 2.0, January 
2004](https://www.apache.org/licenses/LICENSE-2.0)
   check one of the following:
   
   - [x] I hereby declare this contribution to be licensed under the [Apache 
License Version 2.0, January 2004](https://www.apache.org/licenses/LICENSE-2.0)
   - [ ] I hereby declare that I have filed an [Apache Individual Contributor 
License Agreement](https://www.apache.org/licenses/icla.pdf).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to