Skip to content

Commit 58aa18e

Browse files
committed
Add support for Groovy 5
1 parent dff7a5a commit 58aa18e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

libs/gretty/src/main/groovy/org/akhikhl/gretty/ServletContainerConfig.groovy

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ class ServletContainerConfig {
3232
boolean alteredDependencies = false
3333
File webXmlFile = new File(ProjectUtils.getWebAppDir(proj), 'WEB-INF/web.xml')
3434
if(webXmlFile.exists()) {
35+
String groovyVersion = GroovySystem.version
3536
def xmlSlurper = Class
36-
.forName('groovy.' + (GroovySystem.version.startsWith('4.') ? 'xml' : 'util') + '.XmlSlurper')
37+
.forName('groovy.' + (groovyVersion.startsWith('2.') || groovyVersion.startsWith('3.') ? 'util' : 'xml') + '.XmlSlurper')
3738
.getConstructor()
3839
.newInstance()
3940
def webXml = xmlSlurper.parse(webXmlFile)

0 commit comments

Comments
 (0)