Original class/package name (3.0 and lower if applicable) New copied class/package name

(3.0 and above) Notes

Module: groovy

groovy.xml.QName groovy.namespace You need to migrate to using the new class at the same time as you migrate to affected modules using that class as a parameter in methods including groovy-ant and groovy-xml but only if you are using methods with QName parameters. You can continue to use the legacy class in your existing code or with the legacy versions of affected classes until Groovy 4.

Module: groovy-ant

groovy.util groovy.ant Add an import groovy.ant.AntBuilder to classes/scripts using AntBuilder or you will still be using the deprecated version.

Module: groovy-console

groovy.ui.ConsoleApplet N/A The java.applet API is deprecated. No replacement is planned for this Groovy class in Groovy 4.

groovy.inspect groovy.console groovyConsole is normally used as a command-line tool and its use in that form is unaffected. If you use any of the classes directly you can use the old versions until you migrate. You should not mix and match old and new classes.

groovy.inspect.swingui groovy.console.ui

groovy.ui groovy.console.ui

Module: groovy-groovysh

org.codehaus.groovy.tools.shell org.apache.groovy.groovysh groovysh is normally used as a command-line tool and its use in that form is unaffected. If you use any of the classes directly you can use the old versions until you migrate. You should not mix and match old and new classes.

Module: groovy-jmx

groovy.util.GroovyMBean groovy.jmx You need to add the import for GroovyMBean before Groovy 4. Feel free to use the old class in your own code but JmxBuilder only uses the new class. You should not mix the old and new classes.

Module: groovy-nio

org.codehaus.groovy.runtime.

NioGroovyMethods org.apache.groovy.nio.extensions.

NioExtensions In normal use, related extension methods will simply be automatically available from the new location.

org.codehaus.groovy.runtime.

WritablePath org.apache.groovy.nio.runtime We recommend that you reference WritablePath via its interfaces in which case you have nothing to do. If you must reference the class, we recommend changing imports and recompiling all affected classes. If this is difficult, you can use the old class (and directly use the related NioGroovyMethods methods) until you are ready to migrate. You should not mix and match old and new classes.

Module: groovy-swing

org.codehaus.groovy.binding org.apache.groovy.swing.binding You can continue to use the old classes if you use them in your existing code or from within legacy classes still using the old classes. SwingBuilder now uses the new classes.

groovy.model groovy.swing.model

groovy.inspect.swingui org.apache.groovy.swing.table

Module: groovy-test

org.codehaus.groovy.runtime.

ScriptTestAdapter org.apache.groovy.test The old class remains available for use in your own classes if already in use but won’t be recognized by Groovy 3’s JUnit-related test suite classes.

groovy.transform.

NotYetImplemented groovy.test.

NotYetImplemented Both point to the (moved but otherwise unchanged) AST transform class.

groovy.util groovy.test For classes like GroovyTestCase , you need to import groovy.test.GroovyTestCase to not get the deprecated version. You will need to do this before Groovy 4.

groovy.lang groovy.test

Module: groovy-xml

groovy.util groovy.xml For classes like XmlParser and XmlSlurper , you need to import groovy.xml.XmlParser and groovy.xml.XmlSlurper respectively to not get the deprecated versions. You will need to do this before Groovy 4. If you are using groovy.xml.XmlUtil.serialize on a groovy.util.slurpersupport.GPathResult , you will need to swap to using the deprecated methods in groovy.util.XmlUtil since groovy.xml.XmlUtil only handles the new classes.