Skip to content
This repository was archived by the owner on Apr 22, 2025. It is now read-only.

Commit 0e00848

Browse files
Update dependencies to address CVE-2023-2976 (#286)
Also ensure checkstyle checks run correctly. Current versions require Java 11 or later. Signed-off-by: Mark S. Lewis <Mark.S.Lewis@outlook.com>
1 parent c1693c2 commit 0e00848

26 files changed

+254
-340
lines changed

checkstyle-config.xml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -52,20 +52,23 @@
5252
<property name="message" value="Line has trailing spaces."/>
5353
</module>
5454

55-
<module name="SuppressionCommentFilter">
56-
<property name="offCommentFormat" value="CHECKSTYLE.OFF\: ([\w\|]+)"/>
57-
<property name="onCommentFormat" value="CHECKSTYLE.ON\: ([\w\|]+)"/>
58-
<property name="checkFormat" value="$1"/>
59-
</module>
60-
6155
<module name="SuppressionFilter">
6256
<property name="file" value="suppressions.xml" />
6357
</module>
6458

6559
<module name="TreeWalker">
60+
<!-- Checkstyle ignore current line with a comment: // checkstyle:ignore-line:RuleName1|RuleName2 -->
61+
<module name="SuppressWithNearbyCommentFilter">
62+
<property name="commentFormat" value="checkstyle:ignore-line:(\w+(\|\w+)*)"/>
63+
<property name="checkFormat" value="$1"/>
64+
</module>
6665

67-
<!-- Required for SuppressionCommentFilter module -->
68-
<module name="FileContentsHolder"/>
66+
<!-- Checkstyle ignore next line with a comment: // checkstyle:ignore-next-line:RuleName1|RuleName2 -->
67+
<module name="SuppressWithNearbyCommentFilter">
68+
<property name="commentFormat" value="checkstyle:ignore-next-line:(\w+(\|\w+)*)"/>
69+
<property name="checkFormat" value="$1"/>
70+
<property name="influenceFormat" value="1"/>
71+
</module>
6972

7073
<!-- Checks for Naming Conventions. -->
7174
<!-- See http://checkstyle.sf.net/config_naming.html -->
@@ -90,12 +93,8 @@
9093
<module name="AvoidStarImport"/>
9194
<module name="IllegalImport"/> <!-- defaults to sun.* packages -->
9295
<module name="RedundantImport"/>
93-
<module name="ImportOrder">
94-
<property name="groups" value="/^java\./,javax"/>
95-
<property name="ordered" value="true"/>
96-
<property name="separated" value="false"/>
97-
<property name="sortStaticImportsAlphabetically" value="true"/>
98-
<property name="option" value="bottom"/>
96+
<module name="UnusedImports">
97+
<property name="processJavadoc" value="false"/>
9998
</module>
10099

101100
<!--<module name="MethodLength">-->
@@ -122,6 +121,7 @@
122121
<module name="NoWhitespaceAfter"/>
123122
<module name="NoWhitespaceBefore"/>
124123
<module name="ParenPad"/>
124+
<module name="SingleSpaceSeparator"/>
125125
<module name="TypecastParenPad"/>
126126
<module name="WhitespaceAfter"/>
127127
<module name="WhitespaceAround"/>

pom.xml

Lines changed: 75 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -28,46 +28,20 @@
2828
<url>http://github.com/hyperledger/fabric-sdk-java</url>
2929
</scm>
3030
<properties>
31-
<grpc.version>1.56.0</grpc.version>
31+
<grpc.version>1.57.1</grpc.version>
3232
<protobuf.version>3.22.5</protobuf.version> <!-- Must match version used by grpc-protobuf -->
33-
<bouncycastle.version>1.74</bouncycastle.version>
33+
<bouncycastle.version>1.76</bouncycastle.version>
3434
<httpclient.version>4.5.14</httpclient.version>
35-
<javadoc.version>3.4.1</javadoc.version>
35+
<javadoc.version>3.5.0</javadoc.version>
3636
<skipITs>true</skipITs>
3737
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
3838
<jacoco.version>0.8.10</jacoco.version>
3939
<log4j.version>2.20.0</log4j.version>
4040
<org.hyperledger.fabric.sdktest.ITSuite>IntegrationSuite.java</org.hyperledger.fabric.sdktest.ITSuite>
4141
<gpg.executable>gpg</gpg.executable>
42+
<javaVersion>8</javaVersion>
4243
</properties>
4344

44-
<reporting>
45-
<plugins>
46-
<plugin>
47-
<groupId>org.apache.maven.plugins</groupId>
48-
<artifactId>maven-checkstyle-plugin</artifactId>
49-
<version>3.0.0</version>
50-
<reportSets>
51-
<reportSet>
52-
<reports>
53-
<report>checkstyle</report>
54-
</reports>
55-
</reportSet>
56-
</reportSets>
57-
<configuration>
58-
<suppressionsLocation>suppressions.xml</suppressionsLocation>
59-
<suppressionsFileExpression>checkstyle.suppressions.file</suppressionsFileExpression>
60-
</configuration>
61-
</plugin>
62-
<!-- https://mvnrepository.com/artifact/org.jacoco/jacoco-maven-plugin -->
63-
<plugin>
64-
<groupId>org.jacoco</groupId>
65-
<artifactId>jacoco-maven-plugin</artifactId>
66-
<version>${jacoco.version}</version>
67-
</plugin>
68-
</plugins>
69-
</reporting>
70-
7145
<dependencyManagement>
7246
<dependencies>
7347
<dependency>
@@ -80,14 +54,14 @@
8054
<dependency>
8155
<groupId>io.opentelemetry</groupId>
8256
<artifactId>opentelemetry-bom</artifactId>
83-
<version>1.27.0</version>
57+
<version>1.28.0</version>
8458
<type>pom</type>
8559
<scope>import</scope>
8660
</dependency>
8761
<dependency>
8862
<groupId>io.opentelemetry.instrumentation</groupId>
8963
<artifactId>opentelemetry-instrumentation-bom-alpha</artifactId>
90-
<version>1.27.0-alpha</version>
64+
<version>1.28.0-alpha</version>
9165
<type>pom</type>
9266
<scope>import</scope>
9367
</dependency>
@@ -119,10 +93,11 @@
11993
<groupId>io.grpc</groupId>
12094
<artifactId>grpc-stub</artifactId>
12195
</dependency>
122-
<dependency> <!-- necessary for Java 9+ -->
123-
<groupId>org.apache.tomcat</groupId>
124-
<artifactId>annotations-api</artifactId>
125-
<version>6.0.53</version>
96+
<dependency>
97+
<!-- Necessary for Java 9+ -->
98+
<groupId>jakarta.annotation</groupId>
99+
<artifactId>jakarta.annotation-api</artifactId>
100+
<version>2.1.1</version>
126101
<scope>provided</scope>
127102
</dependency>
128103
<dependency>
@@ -199,24 +174,21 @@
199174
<dependency>
200175
<groupId>com.google.api</groupId>
201176
<artifactId>api-common</artifactId>
202-
<version>2.12.0</version>
177+
<version>2.15.0</version>
203178
</dependency>
204179

205-
<!-- https://mvnrepository.com/artifact/org.glassfish/javax.json -->
206180
<dependency>
207181
<groupId>org.glassfish</groupId>
208182
<artifactId>javax.json</artifactId>
209183
<version>1.1.4</version>
210184
</dependency>
211185

212-
<!-- https://mvnrepository.com/artifact/org.yaml/snakeyaml -->
213186
<dependency>
214187
<groupId>org.yaml</groupId>
215188
<artifactId>snakeyaml</artifactId>
216189
<version>2.0</version>
217190
</dependency>
218191

219-
<!-- https://mvnrepository.com/artifact/org.miracl.milagro.amcl/milagro-crypto-java -->
220192
<dependency>
221193
<groupId>org.miracl.milagro.amcl</groupId>
222194
<artifactId>milagro-crypto-java</artifactId>
@@ -230,13 +202,6 @@
230202
<version>2.3.1</version>
231203
</dependency>
232204

233-
<dependency>
234-
<!-- Required if using Java 11+ as no longer bundled in the core libraries -->
235-
<groupId>javax.annotation</groupId>
236-
<artifactId>javax.annotation-api</artifactId>
237-
<version>1.3.2</version>
238-
</dependency>
239-
240205
<dependency>
241206
<groupId>io.opentelemetry</groupId>
242207
<artifactId>opentelemetry-api</artifactId>
@@ -297,7 +262,7 @@
297262
<plugin>
298263
<groupId>org.apache.maven.plugins</groupId>
299264
<artifactId>maven-surefire-plugin</artifactId>
300-
<version>3.0.0-M7</version>
265+
<version>3.1.2</version>
301266
<configuration>
302267
<argLine>${surefireArgLine}</argLine>
303268
<includes>
@@ -356,10 +321,10 @@
356321
<plugin>
357322
<groupId>org.apache.maven.plugins</groupId>
358323
<artifactId>maven-compiler-plugin</artifactId>
359-
<version>3.10.1</version>
324+
<version>3.11.0</version>
360325
<configuration>
361-
<source>1.8</source>
362-
<target>1.8</target>
326+
<source>${javaVersion}</source>
327+
<target>${javaVersion}</target>
363328
<showDeprecation>true</showDeprecation>
364329
<showWarnings>true</showWarnings>
365330
<compilerArgs>
@@ -427,33 +392,6 @@
427392
</execution>
428393
</executions>
429394
</plugin>
430-
<plugin>
431-
<groupId>org.apache.maven.plugins</groupId>
432-
<artifactId>maven-checkstyle-plugin</artifactId>
433-
<version>3.0.0</version>
434-
<executions>
435-
<execution>
436-
<id>compile</id>
437-
<phase>compile</phase>
438-
<goals>
439-
<goal>check</goal>
440-
</goals>
441-
</execution>
442-
</executions>
443-
<configuration>
444-
<consoleOutput>true</consoleOutput>
445-
<logViolationsToConsole>true</logViolationsToConsole>
446-
<failOnViolation>true</failOnViolation>
447-
<failsOnError>true</failsOnError>
448-
<!--<sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>-->
449-
<sourceDirectories>
450-
<sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
451-
</sourceDirectories>
452-
453-
<configLocation>checkstyle-config.xml</configLocation>
454-
<includeTestSourceDirectory>true</includeTestSourceDirectory>
455-
</configuration>
456-
</plugin>
457395
<plugin>
458396
<groupId>org.jacoco</groupId>
459397
<artifactId>jacoco-maven-plugin</artifactId>
@@ -589,15 +527,15 @@
589527
<plugin>
590528
<groupId>org.apache.maven.plugins</groupId>
591529
<artifactId>maven-antrun-plugin</artifactId>
592-
<version>1.8</version>
530+
<version>3.1.0</version>
593531
<executions>
594532
<execution>
595533
<phase>generate-test-resources</phase>
596534
<configuration>
597-
<tasks>
535+
<target>
598536
<echo message="Creating diagnostic dump output directory"/>
599537
<mkdir dir="./target/diagDump"/>
600-
</tasks>
538+
</target>
601539
</configuration>
602540
<goals>
603541
<goal>run</goal>
@@ -640,7 +578,7 @@
640578
<plugin>
641579
<groupId>org.apache.maven.plugins</groupId>
642580
<artifactId>maven-source-plugin</artifactId>
643-
<version>3.2.1</version>
581+
<version>3.3.0</version>
644582
<executions>
645583
<execution>
646584
<id>attach-sources</id>
@@ -718,13 +656,66 @@
718656
<additionalJavadocOpts>--no-module-directories</additionalJavadocOpts>
719657
</properties>
720658
</profile>
659+
<profile>
660+
<id>maven-compiler-release</id>
661+
<activation>
662+
<jdk>[9,)</jdk>
663+
</activation>
664+
<properties>
665+
<maven.compiler.release>${javaVersion}</maven.compiler.release>
666+
</properties>
667+
</profile>
668+
<profile>
669+
<id>checkstyle</id>
670+
<activation>
671+
<jdk>[11,)</jdk>
672+
</activation>
673+
<build>
674+
<plugins>
675+
<plugin>
676+
<groupId>org.apache.maven.plugins</groupId>
677+
<artifactId>maven-checkstyle-plugin</artifactId>
678+
<version>3.3.0</version>
679+
<executions>
680+
<execution>
681+
<id>validate</id>
682+
<phase>validate</phase>
683+
<goals>
684+
<goal>check</goal>
685+
</goals>
686+
</execution>
687+
</executions>
688+
<configuration>
689+
<consoleOutput>true</consoleOutput>
690+
<logViolationsToConsole>true</logViolationsToConsole>
691+
<failOnViolation>true</failOnViolation>
692+
<failsOnError>true</failsOnError>
693+
<configLocation>checkstyle-config.xml</configLocation>
694+
<includeTestSourceDirectory>true</includeTestSourceDirectory>
695+
<!-- Specify source directories to avoid check of generated protobuf bindings -->
696+
<sourceDirectories>
697+
<sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
698+
<sourceDirectory>${project.build.testSourceDirectory}</sourceDirectory>
699+
</sourceDirectories>
700+
</configuration>
701+
<dependencies>
702+
<dependency>
703+
<groupId>com.puppycrawl.tools</groupId>
704+
<artifactId>checkstyle</artifactId>
705+
<version>10.12.2</version>
706+
</dependency>
707+
</dependencies>
708+
</plugin>
709+
</plugins>
710+
</build>
711+
</profile>
721712
<profile>
722713
<id>release</id>
723714
<build>
724715
<plugins>
725716
<plugin>
726717
<artifactId>maven-assembly-plugin</artifactId>
727-
<version>3.4.2</version>
718+
<version>3.6.0</version>
728719
<configuration>
729720
<descriptorRefs>
730721
<descriptorRef>jar-with-dependencies</descriptorRef>
@@ -742,7 +733,7 @@
742733
<plugin>
743734
<groupId>org.apache.maven.plugins</groupId>
744735
<artifactId>maven-gpg-plugin</artifactId>
745-
<version>3.0.1</version>
736+
<version>3.1.0</version>
746737
<executions>
747738
<execution>
748739
<id>sign-artifacts</id>

src/main/java/org/hyperledger/fabric/sdk/BlockEvent.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,18 @@
1313
*/
1414
package org.hyperledger.fabric.sdk;
1515

16-
import java.util.ArrayList;
17-
import java.util.Iterator;
18-
import java.util.List;
19-
2016
import com.google.protobuf.InvalidProtocolBufferException;
21-
import org.hyperledger.fabric.protos.common.Common.Block;
2217
import org.hyperledger.fabric.protos.peer.EventsPackage;
2318
import org.hyperledger.fabric.sdk.exception.InvalidProtocolBufferRuntimeException;
2419

20+
import java.util.ArrayList;
21+
import java.util.Iterator;
22+
import java.util.List;
23+
2524
/**
2625
* A wrapper for the Block returned in an Event
2726
*
28-
* @see Block
27+
* @see org.hyperledger.fabric.protos.common.Common.Block
2928
*/
3029
public class BlockEvent extends BlockInfo {
3130
private final Peer peer;

src/main/java/org/hyperledger/fabric/sdk/HFClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ private void setDefaultProperties(Properties props) {
156156
props.put("grpc.NettyChannelBuilderOption.keepAliveTimeout", new Object[] {20L, TimeUnit.SECONDS});
157157
}
158158
if (!props.containsKey("grpc.NettyChannelBuilderOption.keepAliveWithoutCalls")) {
159-
props.put("grpc.NettyChannelBuilderOption.keepAliveWithoutCalls", new Object[] {true});
159+
props.put("grpc.NettyChannelBuilderOption.keepAliveWithoutCalls", new Object[] {true});
160160
}
161161
}
162162

src/main/java/org/hyperledger/fabric/sdk/LifecycleApproveChaincodeDefinitionForMyOrgProposalResponse.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,11 @@
88

99
package org.hyperledger.fabric.sdk;
1010

11-
import java.util.Collection;
12-
1311
import org.hyperledger.fabric.sdk.transaction.TransactionContext;
1412

1513
/**
1614
* Result of sending a {@link LifecycleApproveChaincodeDefinitionForMyOrgRequest}.
17-
* Also see {@link Channel#sendLifecycleApproveChaincodeDefinitionForMyOrgProposal(LifecycleApproveChaincodeDefinitionForMyOrgRequest, Collection)}
15+
* Also see {@link Channel#sendLifecycleApproveChaincodeDefinitionForMyOrgProposal(LifecycleApproveChaincodeDefinitionForMyOrgRequest, java.util.Collection)}
1816
* <p>
1917
* Does not return any request specific results.
2018
*/

0 commit comments

Comments
 (0)