Hi Dimitar,

>From Groovy 4, Groovy's "module" jars are fully-compliant with the
JPMS rule disallowing split packages. The Groovy 3 and 4 release notes
have more details.

But basically, for the example you are showing, AntBuilder is now in
the groovy.ant package, so if you add the appropriate import, you'll
be good to go. AntBuilder was in the groovy.util package in earlier
Groovy versions, and so didn't need the import. Mind you, there will
likely be numerous places where such changes are needed.

We haven't produced an updated version of those examples for Groovy 4.

Cheers, Paul.

On Tue, Apr 2, 2024 at 8:01 PM Dimitar Vassilev
<dimitar.vassi...@gmail.com> wrote:
>
> Hi all,
>
> After a bit of extensive bashing, I found some time to re-read Groovy in 
> Action 2nd edition.
> I've downloaded the source code from the publisher also and am wondering how 
> to make the most from the book provided I run Groovy 4.0.20/Mac 12.7.4
> Running groovysh from the console is fine, but it doesn't always print the 
> examples
> going into the groovy book source
>  GroovyInAction % groovy alltests.groovy
> org.codehaus.groovy.control.MultipleCompilationErrorsException: startup 
> failed:
> /Users/xxxx/GroovyInAction/alltests.groovy: 2: unable to resolve class 
> AntBuilder
>  @ line 2, column 15.
>        def ant = new AntBuilder()
>                  ^
>
> 1 error
> Thanks!

Reply via email to