java-dependency-analyzer 1.0.1__tar.gz → 1.1.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- java_dependency_analyzer-1.1.1/LICENSE +21 -0
- java_dependency_analyzer-1.0.1/README.md → java_dependency_analyzer-1.1.1/PKG-INFO +260 -198
- java_dependency_analyzer-1.0.1/PKG-INFO → java_dependency_analyzer-1.1.1/README.md +23 -20
- {java_dependency_analyzer-1.0.1 → java_dependency_analyzer-1.1.1}/java_dependency_analyzer/cli.py +32 -6
- {java_dependency_analyzer-1.0.1 → java_dependency_analyzer-1.1.1}/java_dependency_analyzer/parsers/gradle_dep_tree_parser.py +160 -123
- {java_dependency_analyzer-1.0.1 → java_dependency_analyzer-1.1.1}/java_dependency_analyzer/resolvers/__init__.py +11 -11
- {java_dependency_analyzer-1.0.1 → java_dependency_analyzer-1.1.1}/java_dependency_analyzer/scanners/ghsa_scanner.py +224 -205
- {java_dependency_analyzer-1.0.1 → java_dependency_analyzer-1.1.1}/pyproject.toml +39 -38
- {java_dependency_analyzer-1.0.1 → java_dependency_analyzer-1.1.1}/java_dependency_analyzer/__init__.py +0 -0
- {java_dependency_analyzer-1.0.1 → java_dependency_analyzer-1.1.1}/java_dependency_analyzer/cache/__init__.py +0 -0
- {java_dependency_analyzer-1.0.1 → java_dependency_analyzer-1.1.1}/java_dependency_analyzer/cache/db.py +0 -0
- {java_dependency_analyzer-1.0.1 → java_dependency_analyzer-1.1.1}/java_dependency_analyzer/cache/vulnerability_cache.py +0 -0
- {java_dependency_analyzer-1.0.1 → java_dependency_analyzer-1.1.1}/java_dependency_analyzer/models/__init__.py +0 -0
- {java_dependency_analyzer-1.0.1 → java_dependency_analyzer-1.1.1}/java_dependency_analyzer/models/dependency.py +0 -0
- {java_dependency_analyzer-1.0.1 → java_dependency_analyzer-1.1.1}/java_dependency_analyzer/models/report.py +0 -0
- {java_dependency_analyzer-1.0.1 → java_dependency_analyzer-1.1.1}/java_dependency_analyzer/parsers/__init__.py +0 -0
- {java_dependency_analyzer-1.0.1 → java_dependency_analyzer-1.1.1}/java_dependency_analyzer/parsers/base.py +0 -0
- {java_dependency_analyzer-1.0.1 → java_dependency_analyzer-1.1.1}/java_dependency_analyzer/parsers/gradle_parser.py +0 -0
- {java_dependency_analyzer-1.0.1 → java_dependency_analyzer-1.1.1}/java_dependency_analyzer/parsers/maven_dep_tree_parser.py +0 -0
- {java_dependency_analyzer-1.0.1 → java_dependency_analyzer-1.1.1}/java_dependency_analyzer/parsers/maven_parser.py +0 -0
- {java_dependency_analyzer-1.0.1 → java_dependency_analyzer-1.1.1}/java_dependency_analyzer/reporters/__init__.py +0 -0
- {java_dependency_analyzer-1.0.1 → java_dependency_analyzer-1.1.1}/java_dependency_analyzer/reporters/base.py +0 -0
- {java_dependency_analyzer-1.0.1 → java_dependency_analyzer-1.1.1}/java_dependency_analyzer/reporters/html_reporter.py +0 -0
- {java_dependency_analyzer-1.0.1 → java_dependency_analyzer-1.1.1}/java_dependency_analyzer/reporters/json_reporter.py +0 -0
- {java_dependency_analyzer-1.0.1 → java_dependency_analyzer-1.1.1}/java_dependency_analyzer/reporters/templates/report.html +0 -0
- {java_dependency_analyzer-1.0.1 → java_dependency_analyzer-1.1.1}/java_dependency_analyzer/resolvers/transitive.py +0 -0
- {java_dependency_analyzer-1.0.1 → java_dependency_analyzer-1.1.1}/java_dependency_analyzer/scanners/__init__.py +0 -0
- {java_dependency_analyzer-1.0.1 → java_dependency_analyzer-1.1.1}/java_dependency_analyzer/scanners/base.py +0 -0
- {java_dependency_analyzer-1.0.1 → java_dependency_analyzer-1.1.1}/java_dependency_analyzer/scanners/osv_scanner.py +0 -0
- {java_dependency_analyzer-1.0.1 → java_dependency_analyzer-1.1.1}/java_dependency_analyzer/util/__init__.py +0 -0
- {java_dependency_analyzer-1.0.1 → java_dependency_analyzer-1.1.1}/java_dependency_analyzer/util/logger.py +0 -0
- {java_dependency_analyzer-1.0.1 → java_dependency_analyzer-1.1.1}/logging.ini +0 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Ron Webb
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -1,198 +1,260 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
##
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: java-dependency-analyzer
|
|
3
|
+
Version: 1.1.1
|
|
4
|
+
Summary: Java Dependency Analyzer is a tool that inspects dependencies.
|
|
5
|
+
License: MIT License
|
|
6
|
+
|
|
7
|
+
Copyright (c) 2026 Ron Webb
|
|
8
|
+
|
|
9
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
10
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
11
|
+
in the Software without restriction, including without limitation the rights
|
|
12
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
13
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
14
|
+
furnished to do so, subject to the following conditions:
|
|
15
|
+
|
|
16
|
+
The above copyright notice and this permission notice shall be included in all
|
|
17
|
+
copies or substantial portions of the Software.
|
|
18
|
+
|
|
19
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
20
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
21
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
22
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
23
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
24
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
25
|
+
SOFTWARE.
|
|
26
|
+
License-File: LICENSE
|
|
27
|
+
Author: Ron Webb
|
|
28
|
+
Author-email: ron@ronella.xyz
|
|
29
|
+
Requires-Python: >=3.14
|
|
30
|
+
Classifier: License :: Other/Proprietary License
|
|
31
|
+
Classifier: Programming Language :: Python :: 3
|
|
32
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
33
|
+
Requires-Dist: beautifulsoup4 (>=4.14.3,<5.0.0)
|
|
34
|
+
Requires-Dist: click (>=8.3.1,<9.0.0)
|
|
35
|
+
Requires-Dist: httpx (>=0.28.1,<0.29.0)
|
|
36
|
+
Requires-Dist: jinja2 (>=3.1.6,<4.0.0)
|
|
37
|
+
Requires-Dist: lxml (>=6.0.2,<7.0.0)
|
|
38
|
+
Requires-Dist: python-dotenv (>=1.2.2,<2.0.0)
|
|
39
|
+
Description-Content-Type: text/markdown
|
|
40
|
+
|
|
41
|
+
# Java Dependency Analyzer 1.1.1
|
|
42
|
+
|
|
43
|
+
> A Python CLI tool that inspects Java dependency hierarchies in Maven and Gradle projects and reports known vulnerabilities.
|
|
44
|
+
|
|
45
|
+
## Prerequisites
|
|
46
|
+
|
|
47
|
+
- Python `^3.14`
|
|
48
|
+
- [Poetry](https://python-poetry.org/) `2.2`
|
|
49
|
+
|
|
50
|
+
## Installation
|
|
51
|
+
|
|
52
|
+
Clone the repository and install all dependencies:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
git clone <repository-url>
|
|
56
|
+
cd java-dependency-analyzer
|
|
57
|
+
poetry install
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Usage
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
jda <COMMAND> [OPTIONS] [FILE]
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
`COMMAND` is one of `gradle` or `maven`.
|
|
67
|
+
|
|
68
|
+
### gradle
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
jda gradle [OPTIONS] [FILE]
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
`FILE` is the path to a `build.gradle` or `build.gradle.kts` file.
|
|
75
|
+
Omit `FILE` when supplying `--dependencies`.
|
|
76
|
+
|
|
77
|
+
### maven
|
|
78
|
+
|
|
79
|
+
```
|
|
80
|
+
jda maven [OPTIONS] [FILE]
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
`FILE` is the path to a `pom.xml` file.
|
|
84
|
+
Omit `FILE` when supplying `--dependencies`.
|
|
85
|
+
|
|
86
|
+
### Options (both subcommands)
|
|
87
|
+
|
|
88
|
+
| Option | Short | Default | Description |
|
|
89
|
+
|---|---|---|---|
|
|
90
|
+
| `--dependencies` | `-d` | | Path to a pre-resolved dependency tree text file (see below). When supplied, parsing and transitive resolution are skipped. |
|
|
91
|
+
| `--output-format` | `-f` | `all` | Report format: `json`, `html`, or `all` (both). |
|
|
92
|
+
| `--output-dir` | `-o` | `.` | Directory to write the report file(s) into. |
|
|
93
|
+
| `--no-transitive` | | `false` | Skip transitive dependency resolution; analyse direct dependencies only. |
|
|
94
|
+
| `--verbose` | `-v` | `false` | Print progress messages to the console. |
|
|
95
|
+
| `--rebuild-cache` | | `false` | Delete the vulnerability cache before scanning. |
|
|
96
|
+
| `--cache-ttl` | | `7` | Cache TTL in days. Set to `0` to disable caching. |
|
|
97
|
+
|
|
98
|
+
### Exit Codes
|
|
99
|
+
|
|
100
|
+
| Code | Meaning |
|
|
101
|
+
|---|---|
|
|
102
|
+
| `0` | Scan completed successfully; no vulnerabilities found. |
|
|
103
|
+
| `10` | Scan completed successfully; at least one vulnerability was detected. |
|
|
104
|
+
|
|
105
|
+
### Pre-resolved dependency trees (`--dependencies`)
|
|
106
|
+
|
|
107
|
+
When a Gradle or Maven project already has a dependency tree available (e.g. from CI), you can pass it directly to skip the parser and transitive resolver:
|
|
108
|
+
|
|
109
|
+
- **Gradle**: generate with `gradle dependencies --configuration runtimeClasspath > gradle.txt`
|
|
110
|
+
- **Maven**: generate with `mvn dependency:tree -Dscope=runtime > maven.txt`
|
|
111
|
+
|
|
112
|
+
The report will reflect the exact tree from the file, including all transitive dependencies.
|
|
113
|
+
|
|
114
|
+
### Examples
|
|
115
|
+
|
|
116
|
+
Analyse a Maven POM and produce both JSON and HTML reports in the current directory:
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
jda maven pom.xml
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Analyse a Gradle build file and write only an HTML report to `./reports/`:
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
jda gradle build.gradle -f html -o reports/
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Analyse direct dependencies only, with verbose output:
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
jda gradle build.gradle.kts --no-transitive -v
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Scan using a pre-resolved Gradle dependency tree (skips transitive resolution):
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
jda gradle --dependencies runtime.txt -f json -o reports/
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Scan using a pre-resolved Maven dependency tree (skips transitive resolution):
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
jda maven --dependencies maven.txt -f json -o reports/
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
## Logging
|
|
147
|
+
|
|
148
|
+
The tool writes logs to `java_dependency_analyzer.log` in the current working directory, in addition to printing them to the console (`stderr`).
|
|
149
|
+
|
|
150
|
+
Logging requires a `logging.ini` file to be present in the working directory or any of its parent directories. The logger walks up the directory tree until it finds one.
|
|
151
|
+
|
|
152
|
+
**When installed via pip**, no `logging.ini` is bundled. Without it the tool falls back to console-only logging (no log file is created). To enable file logging, copy `logging.ini` from the [repository](https://github.com/rcw3bb/java-dependency-analyzer/blob/master/logging.ini) to your working directory:
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
curl -O https://raw.githubusercontent.com/rcw3bb/java-dependency-analyzer/master/logging.ini
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
Then run `jda` from that same directory.
|
|
159
|
+
|
|
160
|
+
## Architecture
|
|
161
|
+
|
|
162
|
+
```mermaid
|
|
163
|
+
graph TD
|
|
164
|
+
CLI["jda CLI (cli.py)"] --> Parser["DependencyParser (ABC)"]
|
|
165
|
+
Parser --> MavenParser
|
|
166
|
+
Parser --> GradleParser
|
|
167
|
+
Parser --> MavenDepTreeParser
|
|
168
|
+
Parser --> GradleDepTreeParser
|
|
169
|
+
CLI --> Resolver["TransitiveResolver<br/>(Maven Central)"]
|
|
170
|
+
CLI --> Scanner["VulnerabilityScanner (ABC)"]
|
|
171
|
+
Scanner --> OsvScanner["OsvScanner<br/>(OSV.dev API)"]
|
|
172
|
+
Scanner --> GhsaScanner["GhsaScanner<br/>(GitHub Advisory DB)"]
|
|
173
|
+
OsvScanner --> Cache["VulnerabilityCache<br/>(SQLite)"]
|
|
174
|
+
GhsaScanner --> Cache
|
|
175
|
+
CLI --> Reporter["Reporter (ABC)"]
|
|
176
|
+
Reporter --> JsonReporter
|
|
177
|
+
Reporter --> HtmlReporter
|
|
178
|
+
MavenParser --> Dependency["Dependency / Vulnerability<br/>Dataclasses"]
|
|
179
|
+
GradleParser --> Dependency
|
|
180
|
+
MavenDepTreeParser --> Dependency
|
|
181
|
+
GradleDepTreeParser --> Dependency
|
|
182
|
+
Resolver --> Dependency
|
|
183
|
+
OsvScanner --> Dependency
|
|
184
|
+
GhsaScanner --> Dependency
|
|
185
|
+
JsonReporter --> ScanResult["ScanResult"]
|
|
186
|
+
HtmlReporter --> ScanResult
|
|
187
|
+
Dependency --> ScanResult
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### Components
|
|
191
|
+
|
|
192
|
+
| Component | Location | Responsibility |
|
|
193
|
+
|---|---|---|
|
|
194
|
+
| CLI | `java_dependency_analyzer/cli.py` | Entry point (`gradle` / `maven` subcommands); orchestrates parsing, resolving, scanning, and reporting. |
|
|
195
|
+
| `MavenParser` | `parsers/maven_parser.py` | Parses `pom.xml`, resolves `${property}` placeholders, filters by runtime scope. |
|
|
196
|
+
| `GradleParser` | `parsers/gradle_parser.py` | Parses Groovy DSL (`build.gradle`) and Kotlin DSL (`build.gradle.kts`) files. |
|
|
197
|
+
| `MavenDepTreeParser` | `parsers/maven_dep_tree_parser.py` | Parses `mvn dependency:tree` text output into a full dependency tree. |
|
|
198
|
+
| `GradleDepTreeParser` | `parsers/gradle_dep_tree_parser.py` | Parses `gradle dependencies` text output into a full dependency tree. |
|
|
199
|
+
| `TransitiveResolver` | `resolvers/transitive.py` | Fetches transitive dependencies by downloading POM files from Maven Central. |
|
|
200
|
+
| `OsvScanner` | `scanners/osv_scanner.py` | Queries the [OSV.dev](https://osv.dev/) batch API for known CVEs. |
|
|
201
|
+
| `GhsaScanner` | `scanners/ghsa_scanner.py` | Queries the [GitHub Advisory Database](https://github.com/advisories) REST API for security advisories; automatically falls back to OSV when rate-limited (HTTP 403/429). |
|
|
202
|
+
| `VulnerabilityCache` | `cache/vulnerability_cache.py` | SQLite-backed cache for raw vulnerability API payloads with configurable TTL. |
|
|
203
|
+
| `DatabaseManager` | `cache/db.py` | Manages SQLite connection lifecycle and schema initialisation. |
|
|
204
|
+
| `JsonReporter` | `reporters/json_reporter.py` | Writes a `ScanResult` to a JSON file. |
|
|
205
|
+
| `HtmlReporter` | `reporters/html_reporter.py` | Renders a `ScanResult` to a styled HTML report via a Jinja2 template. |
|
|
206
|
+
|
|
207
|
+
## Development Setup
|
|
208
|
+
|
|
209
|
+
Install all dependencies (including dev tools):
|
|
210
|
+
|
|
211
|
+
```bash
|
|
212
|
+
poetry install
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
### Running Tests
|
|
216
|
+
|
|
217
|
+
Run the full test suite with coverage and generate an HTML report:
|
|
218
|
+
|
|
219
|
+
```bash
|
|
220
|
+
poetry run pytest --cov=java_dependency_analyzer tests --cov-report html
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
### Code Quality
|
|
224
|
+
|
|
225
|
+
Format and lint the source code (linter must score 10/10):
|
|
226
|
+
|
|
227
|
+
```bash
|
|
228
|
+
poetry run black java_dependency_analyzer
|
|
229
|
+
poetry run pylint java_dependency_analyzer
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
## Publishing to PyPI
|
|
233
|
+
|
|
234
|
+
### Prerequisites
|
|
235
|
+
|
|
236
|
+
- A [PyPI](https://pypi.org/) account with an API token.
|
|
237
|
+
|
|
238
|
+
### Configure the token
|
|
239
|
+
|
|
240
|
+
```bash
|
|
241
|
+
poetry config pypi-token.pypi <your-token>
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
### Build and publish
|
|
245
|
+
|
|
246
|
+
```bash
|
|
247
|
+
poetry publish --build
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
This builds the source distribution and wheel, then uploads them to PyPI in one step.
|
|
251
|
+
|
|
252
|
+
> **Note:** PyPI releases are immutable. Once a version is published, it cannot be overwritten.
|
|
253
|
+
> To fix a mistake, yank the release via the PyPI web UI and publish a new version.
|
|
254
|
+
|
|
255
|
+
## [Changelog](CHANGELOG.md)
|
|
256
|
+
|
|
257
|
+
## Author
|
|
258
|
+
|
|
259
|
+
Ron Webb <ron@ronella.xyz>
|
|
260
|
+
|
|
@@ -1,21 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Name: java-dependency-analyzer
|
|
3
|
-
Version: 1.0.1
|
|
4
|
-
Summary: Java Dependency Analyzer is a tool that inspects dependencies.
|
|
5
|
-
Author: Ron Webb
|
|
6
|
-
Author-email: ron@ronella.xyz
|
|
7
|
-
Requires-Python: >=3.14
|
|
8
|
-
Classifier: Programming Language :: Python :: 3
|
|
9
|
-
Classifier: Programming Language :: Python :: 3.14
|
|
10
|
-
Requires-Dist: beautifulsoup4 (>=4.14.3,<5.0.0)
|
|
11
|
-
Requires-Dist: click (>=8.3.1,<9.0.0)
|
|
12
|
-
Requires-Dist: httpx (>=0.28.1,<0.29.0)
|
|
13
|
-
Requires-Dist: jinja2 (>=3.1.6,<4.0.0)
|
|
14
|
-
Requires-Dist: lxml (>=6.0.2,<7.0.0)
|
|
15
|
-
Requires-Dist: python-dotenv (>=1.2.2,<2.0.0)
|
|
16
|
-
Description-Content-Type: text/markdown
|
|
17
|
-
|
|
18
|
-
# Java Dependency Analyzer 1.0.1
|
|
1
|
+
# Java Dependency Analyzer 1.1.1
|
|
19
2
|
|
|
20
3
|
> A Python CLI tool that inspects Java dependency hierarchies in Maven and Gradle projects and reports known vulnerabilities.
|
|
21
4
|
|
|
@@ -72,6 +55,13 @@ Omit `FILE` when supplying `--dependencies`.
|
|
|
72
55
|
| `--rebuild-cache` | | `false` | Delete the vulnerability cache before scanning. |
|
|
73
56
|
| `--cache-ttl` | | `7` | Cache TTL in days. Set to `0` to disable caching. |
|
|
74
57
|
|
|
58
|
+
### Exit Codes
|
|
59
|
+
|
|
60
|
+
| Code | Meaning |
|
|
61
|
+
|---|---|
|
|
62
|
+
| `0` | Scan completed successfully; no vulnerabilities found. |
|
|
63
|
+
| `10` | Scan completed successfully; at least one vulnerability was detected. |
|
|
64
|
+
|
|
75
65
|
### Pre-resolved dependency trees (`--dependencies`)
|
|
76
66
|
|
|
77
67
|
When a Gradle or Maven project already has a dependency tree available (e.g. from CI), you can pass it directly to skip the parser and transitive resolver:
|
|
@@ -113,6 +103,20 @@ Scan using a pre-resolved Maven dependency tree (skips transitive resolution):
|
|
|
113
103
|
jda maven --dependencies maven.txt -f json -o reports/
|
|
114
104
|
```
|
|
115
105
|
|
|
106
|
+
## Logging
|
|
107
|
+
|
|
108
|
+
The tool writes logs to `java_dependency_analyzer.log` in the current working directory, in addition to printing them to the console (`stderr`).
|
|
109
|
+
|
|
110
|
+
Logging requires a `logging.ini` file to be present in the working directory or any of its parent directories. The logger walks up the directory tree until it finds one.
|
|
111
|
+
|
|
112
|
+
**When installed via pip**, no `logging.ini` is bundled. Without it the tool falls back to console-only logging (no log file is created). To enable file logging, copy `logging.ini` from the [repository](https://github.com/rcw3bb/java-dependency-analyzer/blob/master/logging.ini) to your working directory:
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
curl -O https://raw.githubusercontent.com/rcw3bb/java-dependency-analyzer/master/logging.ini
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Then run `jda` from that same directory.
|
|
119
|
+
|
|
116
120
|
## Architecture
|
|
117
121
|
|
|
118
122
|
```mermaid
|
|
@@ -154,7 +158,7 @@ graph TD
|
|
|
154
158
|
| `GradleDepTreeParser` | `parsers/gradle_dep_tree_parser.py` | Parses `gradle dependencies` text output into a full dependency tree. |
|
|
155
159
|
| `TransitiveResolver` | `resolvers/transitive.py` | Fetches transitive dependencies by downloading POM files from Maven Central. |
|
|
156
160
|
| `OsvScanner` | `scanners/osv_scanner.py` | Queries the [OSV.dev](https://osv.dev/) batch API for known CVEs. |
|
|
157
|
-
| `GhsaScanner` | `scanners/ghsa_scanner.py` | Queries the [GitHub Advisory Database](https://github.com/advisories) REST API for security advisories. |
|
|
161
|
+
| `GhsaScanner` | `scanners/ghsa_scanner.py` | Queries the [GitHub Advisory Database](https://github.com/advisories) REST API for security advisories; automatically falls back to OSV when rate-limited (HTTP 403/429). |
|
|
158
162
|
| `VulnerabilityCache` | `cache/vulnerability_cache.py` | SQLite-backed cache for raw vulnerability API payloads with configurable TTL. |
|
|
159
163
|
| `DatabaseManager` | `cache/db.py` | Manages SQLite connection lifecycle and schema initialisation. |
|
|
160
164
|
| `JsonReporter` | `reporters/json_reporter.py` | Writes a `ScanResult` to a JSON file. |
|
|
@@ -213,4 +217,3 @@ This builds the source distribution and wheel, then uploads them to PyPI in one
|
|
|
213
217
|
## Author
|
|
214
218
|
|
|
215
219
|
Ron Webb <ron@ronella.xyz>
|
|
216
|
-
|