Skip to content

Commit 556c890

Browse files
authored
feat: pin java dependency versions (#727)
1 parent 3c380dd commit 556c890

File tree

19 files changed

+530
-333
lines changed

19 files changed

+530
-333
lines changed

packages/infrastructure/src/projects/java/infrastructure-java-project.ts

+16-8
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ SPDX-License-Identifier: Apache-2.0 */
33
import * as fs from "fs";
44
import * as path from "path";
55
import { CloudscapeReactTsWebsiteProject } from "@aws/cloudscape-react-ts-website";
6-
import { NxProject } from "@aws/monorepo";
6+
import { NxProject, ProjectUtils } from "@aws/monorepo";
77
import { TypeSafeApiProject } from "@aws/type-safe-api";
88
import * as Mustache from "mustache";
9-
import { SampleFile } from "projen";
9+
import { DependencyType, SampleFile } from "projen";
1010
import { AwsCdkJavaApp } from "projen/lib/awscdk";
1111
import { AwsCdkJavaAppOptions } from "./aws-cdk-java-app-options";
1212
import { InfrastructureCommands } from "../../components/infrastructure-commands";
@@ -56,7 +56,8 @@ export class InfrastructureJavaProject extends AwsCdkJavaApp {
5656

5757
super({
5858
...options,
59-
cdkVersion: options.cdkVersion ?? "2.1.0",
59+
cdkVersion: options.cdkVersion ?? "2.133.0",
60+
cdkVersionPinning: true,
6061
sample: false,
6162
junit: false,
6263
groupId,
@@ -76,6 +77,13 @@ export class InfrastructureJavaProject extends AwsCdkJavaApp {
7677
},
7778
});
7879

80+
// Pin constructs version
81+
this.deps.removeDependency(
82+
"software.constructs/constructs",
83+
DependencyType.RUNTIME
84+
);
85+
this.addDependency("software.constructs/[email protected]");
86+
7987
InfrastructureCommands.ensure(this);
8088

8189
this.pom.addPlugin("org.apache.maven.plugins/[email protected]");
@@ -87,16 +95,16 @@ export class InfrastructureJavaProject extends AwsCdkJavaApp {
8795

8896
if (options.junit !== false) {
8997
[
90-
"org.junit.jupiter/junit-jupiter-api@^5",
91-
"org.junit.jupiter/junit-jupiter-engine@^5",
92-
"io.github.origin-energy/java-snapshot-testing-junit5@^4.0.6",
93-
"io.github.origin-energy/java-snapshot-testing-plugin-jackson@^4.0.6",
98+
"org.junit.jupiter/junit-jupiter-api@5.10.2",
99+
"org.junit.jupiter/junit-jupiter-engine@5.10.2",
100+
"io.github.origin-energy/[email protected].7",
101+
"io.github.origin-energy/[email protected].7",
94102
"org.slf4j/[email protected]",
95103
].forEach((d) => this.addTestDependency(d));
96104
this.testTask.exec("mvn test");
97105
}
98106

99-
this.addDependency("software.aws/pdk@^0");
107+
this.addDependency(`software.aws/pdk@${ProjectUtils.getPdkVersion()}`);
100108

101109
const srcDir = path.resolve(
102110
__dirname,

0 commit comments

Comments
 (0)