Skip to content

Commit ea6e858

Browse files
ntarakad-awsdhasani23
authored andcommitted
feat(amazon q): adding support to accept java 17 projects (aws#5018)
* adding support to accept java 17 projects * confirmation of ui text received * fix minor text * fixing minor text comments * adding link to error message --------- Co-authored-by: David <[email protected]>
1 parent 7d82278 commit ea6e858

File tree

6 files changed

+15
-13
lines changed

6 files changed

+15
-13
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type" : "feature",
3+
"description" : "Code Transform: Enable support for Java 17 projects."
4+
}

plugins/amazonq/codetransform/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codemodernizer/CodeModernizerManager.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ class CodeModernizerManager(private val project: Project) : PersistentStateCompo
123123
private val supportedJavaMappings = mapOf(
124124
JavaSdkVersion.JDK_1_8 to setOf(JavaSdkVersion.JDK_17),
125125
JavaSdkVersion.JDK_11 to setOf(JavaSdkVersion.JDK_17),
126+
JavaSdkVersion.JDK_17 to setOf(JavaSdkVersion.JDK_17),
126127
)
127128
init {
128129
CodeModernizerSessionState.getInstance(project).setDefaults()

plugins/amazonq/codetransform/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codemodernizer/constants/CodeTransformChatItems.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ fun buildProjectValidChatContent() = CodeTransformChatMessageContent(
216216
)
217217
fun buildProjectInvalidChatContent(validationResult: ValidationResult): CodeTransformChatMessageContent {
218218
val errorMessage = when (validationResult.invalidTelemetryReason.category) {
219-
CodeTransformPreValidationError.NoPom -> message("codemodernizer.chat.message.validation.error.no_pom")
219+
CodeTransformPreValidationError.NoPom -> message("codemodernizer.chat.message.validation.error.no_pom", CODE_TRANSFORM_PREREQUISITES)
220220
CodeTransformPreValidationError.UnsupportedJavaVersion -> message("codemodernizer.chat.message.validation.error.unsupported_java_version")
221221
else -> message("codemodernizer.chat.message.validation.error.other")
222222
}

plugins/amazonq/mynah-ui/src/mynah-ui/ui/quickActions/generator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export class QuickActionGenerator {
3737
? [
3838
{
3939
command: '/transform',
40-
description: 'Transform your Java 8 or 11 Maven project to Java 17',
40+
description: 'Transform your Java project',
4141
},
4242
]
4343
: []),

plugins/amazonq/mynah-ui/src/mynah-ui/ui/tabs/generator.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,7 @@ What would you like to work on?`,
5454
],
5555
[
5656
'codetransform',
57-
`Welcome to Code Transformation!
58-
59-
I can help you upgrade your Java 8 and 11 codebases to Java 17.
60-
`,
57+
`Welcome to Code Transformation!`,
6158
],
6259
])
6360

plugins/core/resources/resources/software/aws/toolkits/resources/MessagesBundle.properties

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -645,9 +645,9 @@ codemodernizer.chat.message.upload_failed_url_expired=Sorry, I couldn't upload y
645645
codemodernizer.chat.message.validation.check_eligible_projects=I'm checking for open projects that are eligible for Code Transformation.
646646
codemodernizer.chat.message.validation.check_passed=I can upgrade your Java module. To start the transformation, I need some information from you. Choose the module you want to upgrade and the target code version to upgrade to. Then, choose **Confirm**.\n\nIf you do not see the module you want to transform, you might need to configure your project so that I can find it. Go to File and choose Project Structure. In the Projects tab, set the correct project JDK and language level. In the Modules tab, set the correct module JDK and language level.
647647
codemodernizer.chat.message.validation.error.more_info=For more information, see the [Amazon Q documentation]({0}).
648-
codemodernizer.chat.message.validation.error.no_pom=Sorry, I couldn't find a module that I can upgrade. I couldn't find a pom.xml file in any of your open projects. Currently, I can only upgrade Java 8 or Java 11 projects built on Maven.
649-
codemodernizer.chat.message.validation.error.other=Sorry, I couldn't find a module that I can upgrade. Currently, I can only upgrade Java 8 or Java 11 projects built on Maven. If you have a Java 8 or Java 11 module in your workspace, you might need to configure your project so that I can find it. Go to File and choose Project Structure. In the Projects tab, set the correct project JDK and the correct language level. In the Modules tab, set the correct module JDK and language level.
650-
codemodernizer.chat.message.validation.error.unsupported_java_version=Sorry, I couldn't find a module that I can upgrade. Currently, I can only upgrade Java 8 or Java 11 modules built on Maven. If you have a Java 8 or Java 11 module in your workspace, you might need to configure your project so that I can find it. Go to File and choose Project Structure. In the Projects tab, set the correct project JDK and the correct language level. In the Modules tab, set the correct module JDK and language level.
648+
codemodernizer.chat.message.validation.error.no_pom=I couldn't find a module that I can upgrade. Your Java project must be built on Maven and contain a pom.xml file. For more information, see the [Amazon Q documentation]({0}).
649+
codemodernizer.chat.message.validation.error.other=I couldn't find a module that I can upgrade. Currently, I support Java 8, Java 11, and Java 17 projects built on Maven. Make sure your project is open in the IDE. If you have a Java 8, Java 11, or Java 17 module in your workspace, you might need to configure your project so that I can find it. Go to File and choose Project Structure. In the Projects tab, set the correct project JDK and the correct language level. In the Modules tab, set the correct module JDK and language level.
650+
codemodernizer.chat.message.validation.error.unsupported_java_version=I couldn't find a module that I can upgrade. Currently, I support Java 8, Java 11, and Java 17 projects built on Maven. Make sure your project is open in the IDE. If you have a Java 8, Java 11, or Java 17 in your workspace, you might need to configure your project so that I can find it. Go to File and choose Project Structure. In the Projects tab, set the correct project JDK and the correct language level. In the Modules tab, set the correct module JDK and language level.
651651
codemodernizer.chat.message.validation.no_jdk=I couldn't build your project with your current JDK configuration. To update your JDK, go to File and choose Project Structure. In the Projects tab, set the correct project JDK in the SDK field. In the Modules tab, set the correct module JDK in the SDK field. In Maven Runner settings, set the correct JDK in the JRE field.
652652
codemodernizer.chat.prompt.label.dependency_current_version=Current version
653653
codemodernizer.chat.prompt.label.dependency_name=Dependency name
@@ -722,11 +722,11 @@ codemodernizer.notification.warn.download_failed_other.content=Amazon Q ran into
722722
codemodernizer.notification.warn.download_failed_ssl.content=Please make sure all your certificates for your proxy client have been set up correctly for your IDE.
723723
codemodernizer.notification.warn.download_failed_wildcard.content=Check your IDE proxy settings and remove any wildcard (*) references, and then try viewing the diff again.
724724
codemodernizer.notification.warn.expired_credentials.title=Your connection to Q has expired
725-
codemodernizer.notification.warn.invalid_project.description.reason.invalid_jdk_versions=None of your open modules are supported by Amazon Q Code Transformation. Currently, Amazon Q can only upgrade Java 8 or Java 11 projects built on Maven.
726-
codemodernizer.notification.warn.invalid_project.description.reason.missing_content_roots=None of your open modules are supported by Amazon Q Code Transformation. Currently, Amazon Q can only upgrade Java 8 or Java 11 projects built on Maven.
727-
codemodernizer.notification.warn.invalid_project.description.reason.no_valid_files=None of your open modules are supported by Amazon Q Code Transformation. Amazon Q could not find a pom.xml file in any of your open modules. Currently, Amazon Q can only upgrade Java 8 or Java 11 projects built on Maven.
725+
codemodernizer.notification.warn.invalid_project.description.reason.invalid_jdk_versions=None of your open modules are supported for code transformation with Amazon Q. Amazon Q can upgrade Java 8, Java 11, and Java 17 projects built on Maven.
726+
codemodernizer.notification.warn.invalid_project.description.reason.missing_content_roots=None of your open modules are supported for code transformation with Amazon Q. Amazon Q can upgrade Java 8, Java 11, and Java 17 projects built on Maven.
727+
codemodernizer.notification.warn.invalid_project.description.reason.no_valid_files=None of your open modules are supported for code transformation with Amazon Q. A pom.xml is required for transformation. Amazon Q can upgrade Java 8, Java 11, and Java 17 projects built on Maven.
728728
codemodernizer.notification.warn.invalid_project.description.reason.not_logged_in=Amazon Q cannot start the transformation as you are not logged in with Identity Center or Builder ID. Also ensure that you are not using IntelliJ version 232.8660.185 and that you are not developing on a remote host (uncommon).
729-
codemodernizer.notification.warn.invalid_project.description.reason.remote_backend=None of your open modules are supported by Amazon Q Code Transformation. Currently, Amazon Q can only upgrade Java 8 or Java 11 projects built on Maven, and cannot upgrade projects running on a remote host.
729+
codemodernizer.notification.warn.invalid_project.description.reason.remote_backend=None of your open modules are supported for code transformation with Amazon Q. Amazon Q cannot transform projects running on a remote host.
730730
codemodernizer.notification.warn.maven_failed.content=Amazon Q could not run the Maven clean install command to build your module.
731731
codemodernizer.notification.warn.maven_failed.title=Amazon Q Code Transform unable to zip dependencies
732732
codemodernizer.notification.warn.on_resume.unknown_status_response.content=We received data from Amazon Q in a format that the plugin cannot handle. You may need to update the plugin and then try again.

0 commit comments

Comments
 (0)