gradle
gradle copied to clipboard
grade init built in Maven converter uses keywords in Kotlin scripts when creating version catalog
Current Behavior
When using gradle init to convert a Maven project to Gradle and dependencies contain Kotlin keywords they are used in the generated version catalog causing the build to fail due to incorrect syntax in the build.gradle.kts
file.
* Where:
Build file '/Users/xyz/abc/sample/build.gradle.kts' line: 27
* What went wrong:
Script compilation errors:
Line 27: api(libs.my.library.string.interface)
^ Name expected
Line 32: testImplementation(libs.org.jetbrains.kotlin.kotlin.test)
^ Expecting ')'
2 errors
Expected Behavior
If maven dependencies contain Kotlin keywords they are not used in the generated version catalog. i.e. interface
Context (optional)
No response
Steps to Reproduce
- Have a Java Maven project
- One of the POM dependency names should end
-interface
. i.e.:
<artifactId>string-interface</artifactId>
- Use
gradle init
- Chose to convert from Maven, chose Kotlin, say "no" to using new features
- Run ./gradlew in newly created Gradle project
Observe the error:
* Where:
Build file '/Users/xyz/abc/sample/build.gradle.kts' line: 27
* What went wrong:
Script compilation errors:
Line 27: api(libs.my.library.string.interface)
^ Name expected
Line 32: testImplementation(libs.org.jetbrains.kotlin.kotlin.test)
^ Expecting ')'
2 errors
Gradle version
8.6
Build scan URL (optional)
No response
Your Environment (optional)
No response
The issue is in the backlog of the relevant team and is prioritized by them.