Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cli): fix version detection for Java being a bit too optimistic about the package name #1995

Merged
merged 2 commits into from Aug 4, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion packages/cdktf-cli/lib/debug.ts
Expand Up @@ -253,9 +253,12 @@ async function getJavaPackageVersion(packageName: string) {
return undefined;
}

// We need to search for the package name AND a colon to not match a line like
// [INFO] com.hashicorp:cdktf-provider-aws:jar:9.0.9:compile
// when looking for the cdktf package (see Github issue #1994)
const versionLine = resolutionPart
.split(/\r\n|\r|\n/)
.find((line) => line.includes(javaPackageName));
.find((line) => line.includes(`${javaPackageName}:`));

if (!versionLine) {
logger.debug(
Expand Down