Skip to content

Commit 3cafe15

Browse files
committed
build: consolidate transitives/exclusions to avoid dependency clashes
- migrates to maintained org.json:json artifact - removes unnecessary excludes - fixes excludes for bouncycastle and unnecessary guava pieces Signed-off-by: Chad Wilson <29788154+chadlwilson@users.noreply.github.com>
1 parent 46c261e commit 3cafe15

File tree

7 files changed

+91
-108
lines changed

7 files changed

+91
-108
lines changed

ant/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ Copyright (c) 2013 - Jeremy Long. All Rights Reserved.
226226
<groupId>org.owasp</groupId>
227227
<artifactId>dependency-check-core</artifactId>
228228
<version>${project.parent.version}</version>
229-
<type>test-jar</type>
229+
<classifier>tests</classifier>
230230
<scope>test</scope>
231231
</dependency>
232232
<dependency>

cli/pom.xml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,6 @@ Copyright (c) 2012 - Jeremy Long. All Rights Reserved.
174174
<groupId>org.apache.ant</groupId>
175175
<artifactId>ant-launcher</artifactId>
176176
</exclusion>
177-
<exclusion>
178-
<groupId>com.sun</groupId>
179-
<artifactId>tools</artifactId>
180-
</exclusion>
181177
</exclusions>
182178
</dependency>
183179
</dependencies>

core/pom.xml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -163,16 +163,9 @@ Copyright (c) 2012 Jeremy Long. All Rights Reserved.
163163
<artifactId>maven-jar-plugin</artifactId>
164164
<executions>
165165
<execution>
166-
<id>test-jar</id>
167-
<phase>package</phase>
168166
<goals>
169167
<goal>test-jar</goal>
170168
</goals>
171-
<configuration>
172-
<includes>
173-
<include>**/*.class</include>
174-
</includes>
175-
</configuration>
176169
</execution>
177170
</executions>
178171
</plugin>
@@ -278,6 +271,11 @@ Copyright (c) 2012 Jeremy Long. All Rights Reserved.
278271
<groupId>org.slf4j</groupId>
279272
<artifactId>jul-to-slf4j</artifactId>
280273
</dependency>
274+
<!-- Allow redirection of Commons Logging to slf4j -->
275+
<dependency>
276+
<groupId>org.slf4j</groupId>
277+
<artifactId>jcl-over-slf4j</artifactId>
278+
</dependency>
281279
<dependency>
282280
<groupId>org.apache.velocity</groupId>
283281
<artifactId>velocity-engine-core</artifactId>
@@ -377,9 +375,8 @@ Copyright (c) 2012 Jeremy Long. All Rights Reserved.
377375
<version>1.3.1</version>
378376
</dependency>
379377
<dependency>
380-
<groupId>com.vaadin.external.google</groupId>
381-
<artifactId>android-json</artifactId>
382-
<version>0.0.20131108.vaadin1</version>
378+
<groupId>org.json</groupId>
379+
<artifactId>json</artifactId>
383380
</dependency>
384381
</dependencies>
385382
<profiles>

core/src/main/java/org/owasp/dependencycheck/analyzer/YarnAuditAnalyzer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ private static List<Advisory> parseAdvisoryJsons(List<JSONObject> advisoryJsons)
443443
final var advisory = new Advisory();
444444
final var object = advisoryJson.getJSONObject("children");
445445
final var moduleName = advisoryJson.optString("value", null);
446-
final var id = object.getString("ID");
446+
final var id = object.get("ID");
447447
final var url = object.optString("URL", null);
448448
final var ghsaId = extractGhsaId(url);
449449
final var issue = object.optString("Issue", null);

core/src/main/java/org/owasp/dependencycheck/data/nodeaudit/NodeAuditSearch.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
import org.apache.hc.core5.http.Header;
3232
import org.apache.hc.core5.http.HttpHeaders;
3333
import org.apache.hc.core5.http.message.BasicHeader;
34-
import org.json.JSONException;
3534
import org.json.JSONObject;
3635
import org.owasp.dependencycheck.utils.DownloadFailedException;
3736
import org.owasp.dependencycheck.utils.Downloader;
@@ -171,7 +170,7 @@ private List<Advisory> submitPackage(JsonObject packageJson, String key, int cou
171170
cache.put(key, advisories);
172171
}
173172
return advisories;
174-
} catch (RuntimeException | URISyntaxException | JSONException | TooManyRequestsException | ResourceNotFoundException ex) {
173+
} catch (RuntimeException | URISyntaxException | TooManyRequestsException | ResourceNotFoundException ex) {
175174
LOGGER.debug("Error connecting to Node Audit API. Error: {}",
176175
ex.getMessage());
177176
throw new SearchException("Could not connect to Node Audit API: " + ex.getMessage(), ex);

maven/pom.xml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -92,17 +92,6 @@ Copyright (c) 2013 Jeremy Long. All Rights Reserved.
9292
</plugin>
9393
</plugins>
9494
</reporting>
95-
<dependencyManagement>
96-
<dependencies>
97-
<dependency>
98-
<groupId>org.apache.maven</groupId>
99-
<artifactId>maven-resolver-provider</artifactId>
100-
<version>${maven.api.version}</version>
101-
<type>pom</type>
102-
<scope>import</scope>
103-
</dependency>
104-
</dependencies>
105-
</dependencyManagement>
10695
<dependencies>
10796
<dependency>
10897
<groupId>org.owasp</groupId>
@@ -181,11 +170,6 @@ Copyright (c) 2013 Jeremy Long. All Rights Reserved.
181170
<artifactId>maven-artifact</artifactId>
182171
<scope>provided</scope>
183172
</dependency>
184-
<dependency>
185-
<groupId>org.apache.maven.resolver</groupId>
186-
<artifactId>maven-resolver-api</artifactId>
187-
<scope>provided</scope>
188-
</dependency>
189173
<dependency>
190174
<groupId>org.apache.maven.shared</groupId>
191175
<artifactId>maven-common-artifact-filters</artifactId>

0 commit comments

Comments
 (0)