11import java.io.File
2+ import java.nio.file.Files
3+ import java.nio.file.attribute.PosixFilePermissions
24
35// ─── Helpers ──────────────────────────────────────────────────────────────────
46
@@ -216,6 +218,7 @@ ${modulesXml}
216218 <maven-jar-plugin.version>3.4.2</maven-jar-plugin.version>
217219 <maven-surefire-plugin.version>3.5.5</maven-surefire-plugin.version>
218220 <modernizer-maven-plugin.version>3.4.0</modernizer-maven-plugin.version>
221+ <versions-maven-plugin.version>2.18.0</versions-maven-plugin.version>
219222 </properties>
220223
221224 <dependencyManagement>
@@ -289,6 +292,35 @@ ${dmXml}
289292 </execution>
290293 </executions>
291294 </plugin>
295+ <plugin>
296+ <groupId>org.codehaus.mojo</groupId>
297+ <artifactId>versions-maven-plugin</artifactId>
298+ <version>\$ {versions-maven-plugin.version}</version>
299+ <configuration>
300+ <ruleSet>
301+ <ignoreVersions>
302+ <ignoreVersion>
303+ <type>regex</type>
304+ <version>(?i).*-(alpha|beta|m|rc)([-.]?\\ d+)?</version>
305+ </ignoreVersion>
306+ </ignoreVersions>
307+ <rules>
308+ <rule>
309+ <groupId>com.graphql-java</groupId>
310+ <artifactId>graphql-java-extended-scalars</artifactId>
311+ <ignoreVersions>
312+ <!-- ignore old versions starting with 2018, 2019, 2020, 2021, 2022, or 2023 that
313+ semantically are newer than current version scheme -->
314+ <ignoreVersion>
315+ <type>regex</type>
316+ <version>^20(1[8-9]|2[0-3]).*</version>
317+ </ignoreVersion>
318+ </ignoreVersions>
319+ </rule>
320+ </rules>
321+ </ruleSet>
322+ </configuration>
323+ </plugin>
292324 </plugins>
293325 </pluginManagement>
294326 <plugins>
@@ -306,6 +338,48 @@ writeFile(projectDir, 'parent/pom.xml', parentPom)
306338// Remove the placeholder pom.xml that the archetype engine wrote at the project root
307339new File (projectDir, ' pom.xml' ). delete()
308340
341+ // ─── Version-update helper scripts ────────────────────────────────────────────
342+ // Convenience wrappers around `mvnw versions:update-properties` so all property
343+ // versions can be bumped to their latest in one command. Written to the project
344+ // root for both Linux (LF, +x) and Windows (CRLF). Built from explicit line
345+ // lists so the line endings are correct regardless of this script's own endings.
346+
347+ writeFile(projectDir, ' mvn-update-properties-versions.sh' , [
348+ ' #!/bin/bash' ,
349+ ' # Updates property versions to the latest found' ,
350+ ' FILE=target/version-updates-applied.log' ,
351+ ' mkdir -p target' ,
352+ ' rm -f $FILE' ,
353+ ' echo "Writing output to file $FILE"' ,
354+ ' echo "Applying version updates specified as properties..."' ,
355+ ' echo "======================================== PROPERTIES" >> $FILE' ,
356+ ' ./mvnw versions:update-properties >> $FILE' ,
357+ ' ' ,
358+ ]. join(' \n ' ))
359+
360+ writeFile(projectDir, ' mvn-update-properties-versions.ps1' , [
361+ ' # Updates property versions to the latest found' ,
362+ ' $FILE = "target/version-updates-applied.log"' ,
363+ ' New-Item -ItemType Directory -Force -Path "target" | Out-Null' ,
364+ ' if (Test-Path $FILE) { Remove-Item -Force $FILE }' ,
365+ ' Write-Host "Writing output to file $FILE"' ,
366+ ' Write-Host "Applying version updates specified as properties..."' ,
367+ ' "======================================== PROPERTIES" | Out-File -FilePath $FILE -Append -Encoding utf8' ,
368+ ' & ./mvnw.cmd versions:update-properties | Out-File -FilePath $FILE -Append -Encoding utf8' ,
369+ ' ' ,
370+ ]. join(' \r\n ' ))
371+
372+ // Set the exec bit on the Linux script. POSIX filesystems only; on Windows
373+ // (non-POSIX) this throws UnsupportedOperationException and we fall back to the
374+ // best-effort Java executable flag (a no-op on Windows, but harmless).
375+ def shFile = new File (projectDir, ' mvn-update-properties-versions.sh' )
376+ try {
377+ Files . setPosixFilePermissions(shFile. toPath(),
378+ PosixFilePermissions . fromString(' rwxr-xr-x' ))
379+ } catch (UnsupportedOperationException ignored) {
380+ shFile. setExecutable(true , false )
381+ }
382+
309383// ─── common-domain ────────────────────────────────────────────────────────────
310384
311385writeFile(projectDir, ' common-domain/pom.xml' ,
0 commit comments