User: rednesto Date: 06 Aug 24 18:54 Revision: 0dd3f3a5a7a42bc6c3638aeb1a6f215a37c8f6c9 Summary: Sanitize Artifact ID recommendation TeamCity URL: https://ci.mcdev.io/viewModification.html?tab=vcsModificationFiles&modId=9563&personal=false Index: src/main/kotlin/creator/custom/types/BuildSystemCoordinatesCreatorProperty.kt =================================================================== --- src/main/kotlin/creator/custom/types/BuildSystemCoordinatesCreatorProperty.kt (revision 9d28eaf79d9ade75d92e8b2d74406eb0b11fe94e) +++ src/main/kotlin/creator/custom/types/BuildSystemCoordinatesCreatorProperty.kt (revision 0dd3f3a5a7a42bc6c3638aeb1a6f215a37c8f6c9) @@ -89,7 +89,10 @@ graphProperty.dependsOn(projectNameProperty, false) { val newProjectName = projectNameProperty.get() if (newProjectName is String) { - coords.copy(artifactId = newProjectName) + val sanitizedArtifactId = newProjectName.lowercase() + .replace(Regex("\\W+"), "-") + .removeSuffix("-") + coords.copy(artifactId = sanitizedArtifactId) } else { coords }