diff --git a/pkg/codegen/java/gen.go b/pkg/codegen/java/gen.go index 2c684b3117c..1d7650c55a7 100644 --- a/pkg/codegen/java/gen.go +++ b/pkg/codegen/java/gen.go @@ -13,6 +13,7 @@ import ( "strconv" "strings" + "github.com/blang/semver" "github.com/pulumi/pulumi/pkg/v3/codegen" "github.com/pulumi/pulumi/pkg/v3/codegen/schema" "github.com/pulumi/pulumi/sdk/v3/go/common/util/contract" @@ -20,6 +21,9 @@ import ( "github.com/pulumi/pulumi-java/pkg/codegen/java/names" ) +// This should be bumped as required at the point of release. +var DEFAULT_SDK_VERSION = semver.Version{Major: 0, Minor: 18, Patch: 0} + func packageName(packages map[string]string, name string) string { if pkg, ok := packages[name]; ok { return pkg @@ -2039,7 +2043,9 @@ func generateModuleContextMap(tool string, pkg *schema.Package) (map[string]*mod panic(fmt.Sprintf("Failed to cast `pkg.Language[\"java\"]`=%v to `PackageInfo`", raw)) } } - javaInfo = javaInfo.WithDefaultDependencies() + javaInfo = javaInfo. + WithDefaultDependencies(). + WithJavaSdkDependencyDefault(DEFAULT_SDK_VERSION) info = &javaInfo infos[def] = info }