You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Previously, sam build does not show this warning message when building using Gradle, but somehow this message appears in the new Gradle version.
failed to return a version string using the '-v' option. The workflow is unable to check that the version of the JVM used is compatible with AWS Lambda.
Steps to reproduce:
Update the project gradle version to >= v8.9 (8.9 or 8.10).
Run sam build on existing SAM application project.
Observed result:
Got above error message while the build process is successfully executed.
Expected result:
Don't show above error message since the JVM version should be available from gradlew -v command.
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
After testing with older Gradle version (below v8.8), found out the gradle output for JVM has different label.
Gradle < v8.9 is using JVM label,
while Gradle >= v8.9 is using Launcher JVM or Daemon JVM label.
Gradle < v8.9
Use gradle v8.8 as example, current sam-cli integration test is using v8.4.
❯ ./gradlew --version
------------------------------------------------------------
Gradle 8.8
------------------------------------------------------------
Build time: 2024-05-31 21:46:56 UTC
Revision: 4bd1b3d3fc3f31db5a26eecb416a165b8cc36082
Kotlin: 1.9.22
Groovy: 3.0.21
Ant: Apache Ant(TM) version 1.10.13 compiled on January 4 2023
JVM: 21.0.4 (Amazon.com Inc. 21.0.4+7-LTS)
OS: Mac OS X 14.6.1 aarch64
Gradle >= v8.9
Use gradle v8.9 as example.
❯ ./gradlew -v
------------------------------------------------------------
Gradle 8.9
------------------------------------------------------------
Build time: 2024-07-11 14:37:41 UTC
Revision: d536ef36a19186ccc596d8817123e5445f30fef8
Kotlin: 1.9.23
Groovy: 3.0.21
Ant: Apache Ant(TM) version 1.10.13 compiled on January 4 2023
Launcher JVM: 21.0.4 (Amazon.com Inc. 21.0.4+7-LTS)
Daemon JVM: /Users/jeffry.angtoni/.sdkman/candidates/java/21.0.4-amzn (no JDK specified, using current Java home)
OS: Mac OS X 14.6.1 aarch64
Root Cause
Probably, we need to update the startswith validation from this line,
Description:
Previously,
sam build
does not show this warning message when building using Gradle, but somehow this message appears in the new Gradle version.Steps to reproduce:
sam build
on existing SAM application project.Observed result:
Got above error message while the build process is successfully executed.
Expected result:
Don't show above error message since the JVM version should be available from
gradlew -v
command.Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
After testing with older Gradle version (below v8.8), found out the gradle output for JVM has different label.
JVM
label,Launcher JVM
orDaemon JVM
label.Gradle < v8.9
Use gradle v8.8 as example, current sam-cli integration test is using v8.4.
Gradle >= v8.9
Use gradle v8.9 as example.
Root Cause
Probably, we need to update the
startswith
validation from this line,aws-lambda-builders/aws_lambda_builders/workflows/java_gradle/gradle_validator.py
Line 86 in be29a9f
sam --version
: 1.123.0Add --debug flag to command you are running
The text was updated successfully, but these errors were encountered: