diff --git a/.changes/next-release/feature-7d7a7670-7076-4886-affe-0d784d4bbd27.json b/.changes/next-release/feature-7d7a7670-7076-4886-affe-0d784d4bbd27.json new file mode 100644 index 00000000000..af225359b7c --- /dev/null +++ b/.changes/next-release/feature-7d7a7670-7076-4886-affe-0d784d4bbd27.json @@ -0,0 +1,4 @@ +{ + "type" : "feature", + "description" : "Code Transform: Enable support for Java 17 projects." +} \ No newline at end of file diff --git a/plugins/amazonq/codetransform/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codemodernizer/CodeModernizerManager.kt b/plugins/amazonq/codetransform/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codemodernizer/CodeModernizerManager.kt index eddaa6a8788..16d799c2783 100644 --- a/plugins/amazonq/codetransform/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codemodernizer/CodeModernizerManager.kt +++ b/plugins/amazonq/codetransform/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codemodernizer/CodeModernizerManager.kt @@ -123,6 +123,7 @@ class CodeModernizerManager(private val project: Project) : PersistentStateCompo private val supportedJavaMappings = mapOf( JavaSdkVersion.JDK_1_8 to setOf(JavaSdkVersion.JDK_17), JavaSdkVersion.JDK_11 to setOf(JavaSdkVersion.JDK_17), + JavaSdkVersion.JDK_17 to setOf(JavaSdkVersion.JDK_17), ) init { CodeModernizerSessionState.getInstance(project).setDefaults() diff --git a/plugins/amazonq/codetransform/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codemodernizer/constants/CodeTransformChatItems.kt b/plugins/amazonq/codetransform/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codemodernizer/constants/CodeTransformChatItems.kt index 24494eb99a1..86f704caa8c 100644 --- a/plugins/amazonq/codetransform/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codemodernizer/constants/CodeTransformChatItems.kt +++ b/plugins/amazonq/codetransform/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codemodernizer/constants/CodeTransformChatItems.kt @@ -189,7 +189,7 @@ fun buildProjectValidChatContent() = CodeTransformChatMessageContent( ) fun buildProjectInvalidChatContent(validationResult: ValidationResult): CodeTransformChatMessageContent { val errorMessage = when (validationResult.invalidTelemetryReason.category) { - CodeTransformPreValidationError.NoPom -> message("codemodernizer.chat.message.validation.error.no_pom") + CodeTransformPreValidationError.NoPom -> message("codemodernizer.chat.message.validation.error.no_pom", CODE_TRANSFORM_PREREQUISITES) CodeTransformPreValidationError.UnsupportedJavaVersion -> message("codemodernizer.chat.message.validation.error.unsupported_java_version") else -> message("codemodernizer.chat.message.validation.error.other") } diff --git a/plugins/amazonq/mynah-ui/src/mynah-ui/ui/quickActions/generator.ts b/plugins/amazonq/mynah-ui/src/mynah-ui/ui/quickActions/generator.ts index c492feeda3d..1f62a45ce0d 100644 --- a/plugins/amazonq/mynah-ui/src/mynah-ui/ui/quickActions/generator.ts +++ b/plugins/amazonq/mynah-ui/src/mynah-ui/ui/quickActions/generator.ts @@ -37,7 +37,7 @@ export class QuickActionGenerator { ? [ { command: '/transform', - description: 'Transform your Java 8 or 11 Maven project to Java 17', + description: 'Transform your Java project', }, ] : []), diff --git a/plugins/amazonq/mynah-ui/src/mynah-ui/ui/tabs/generator.ts b/plugins/amazonq/mynah-ui/src/mynah-ui/ui/tabs/generator.ts index ea6e1e6d307..42711a25f06 100644 --- a/plugins/amazonq/mynah-ui/src/mynah-ui/ui/tabs/generator.ts +++ b/plugins/amazonq/mynah-ui/src/mynah-ui/ui/tabs/generator.ts @@ -54,10 +54,7 @@ What would you like to work on?`, ], [ 'codetransform', - `Welcome to Code Transformation! - -I can help you upgrade your Java 8 and 11 codebases to Java 17. -`, + `Welcome to Code Transformation!`, ], ]) diff --git a/plugins/core/resources/resources/software/aws/toolkits/resources/MessagesBundle.properties b/plugins/core/resources/resources/software/aws/toolkits/resources/MessagesBundle.properties index 595c6fe8381..9d7079a3732 100644 --- a/plugins/core/resources/resources/software/aws/toolkits/resources/MessagesBundle.properties +++ b/plugins/core/resources/resources/software/aws/toolkits/resources/MessagesBundle.properties @@ -632,9 +632,9 @@ codemodernizer.chat.message.upload_failed_url_expired=Sorry, I couldn't upload y codemodernizer.chat.message.validation.check_eligible_projects=I'm checking for open projects that are eligible for Code Transformation. 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. codemodernizer.chat.message.validation.error.more_info=For more information, see the [Amazon Q documentation]({0}). -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. -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. -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. +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}). +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. +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. 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. codemodernizer.chat.prompt.label.dependency_current_version=Current version codemodernizer.chat.prompt.label.dependency_name=Dependency name @@ -709,11 +709,11 @@ codemodernizer.notification.warn.download_failed_other.content=Amazon Q ran into 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. codemodernizer.notification.warn.download_failed_wildcard.content=Check your IDE proxy settings and remove any wildcard (*) references, and then try viewing the diff again. codemodernizer.notification.warn.expired_credentials.title=Your connection to Q has expired -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. -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. -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. +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. +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. +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. 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). -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. +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. codemodernizer.notification.warn.maven_failed.content=Amazon Q could not run the Maven clean install command to build your module. codemodernizer.notification.warn.maven_failed.title=Amazon Q Code Transform unable to zip dependencies 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.