You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@groovy.apache.org by Warren Milburn <wa...@munki.net> on 2020/06/29 08:13:02 UTC

Java fails because groovy modules are exporting the same package to another module

I have a multi-module project that uses maven as its build system.  I’m using Adopt OpenJDK 11.0.7 with Groovy 3.0.4 and building with Maven 3.6.3.  The other suspect in this case is the module xml.resolver which is version 1.2.

 �

After much coaxing and cajoling, the project builds but when I try to run it up, it gives this error:

 �

Error occurred during initialization of boot layer

java.lang.module.ResolutionException: Modules org.codehaus.groovy.test and org.codehaus.groovy.xml export package groovy.util to module xml.resolver

  

  

Has anyone come across this yet?  Or have any clues as to how I can resolve it?

 �


Re: Java fails because groovy modules are exporting the same package to another module

Posted by wa...@munki.net.
Thanks Paul for your explanation.  I now have my project working.  
  

Kind regards, Warren Milburn

  

On 1 Jul 2020 06:20, Paul King <pa...@asert.com.au> wrote:  

> TL;DR version: Groovy 3 doesn't support using the multiple Groovy jars as
automatic modules. I'd recommend placing them on the classpath.

>

>  
>

>

> More details:

>

> Groovy prior to 3 had numerous jars with classes having common package
names, e.g. "groovy.util". Groovy 3 has repackaged all such offending classes
but retained deprecated original packages for backwards compatibility. If you
only use the newer versions of those classes, you could do extra work to
explicitly declare modules and export only the non-offending packages but we
don't currently do that for you. Groovy 4 has only the new package names and
so will be module friendly out of the box but no longer backwards compatible.

>

>  
>

>

> Cheers, Paul.

>

>  
>

>

>  
>

>

> On Mon, Jun 29, 2020 at 6:13 PM Warren Milburn
<[warren@munki.net](mailto:warren@munki.net)> wrote:  
>

>

>> I have a multi-module project that uses maven as its build system. I’m
using Adopt OpenJDK 11.0.7 with Groovy 3.0.4 and building with Maven 3.6.3.
The other suspect in this case is the module xml.resolver which is version
1.2. __ __

>>

>>  ____

>>

>> After much coaxing and cajoling, the project builds but when I try to run
it up, it gives this error: __ __

>>

>>  ____

>>

>> Error occurred during initialization of boot layer __ __

>>

>> java.lang.module.ResolutionException: Modules org.codehaus.groovy.test and
org.codehaus.groovy.xml export package groovy.util to module xml.resolver __
__

>>

>>  ____

>>

>> ____

>>

>> Has anyone come across this yet? Or have any clues as to how I can resolve
it? __ __

>>

>>  ____

  


Re: Java fails because groovy modules are exporting the same package to another module

Posted by Paul King <pa...@asert.com.au>.
TL;DR version: Groovy 3 doesn't support using the multiple Groovy jars as
automatic modules. I'd recommend placing them on the classpath.

More details:
Groovy prior to 3 had numerous jars with classes having common package
names, e.g. "groovy.util". Groovy 3 has repackaged all such offending
classes but retained deprecated original packages for backwards
compatibility. If you only use the newer versions of those classes, you
could do extra work to explicitly declare modules and export only the
non-offending packages but we don't currently do that for you. Groovy 4 has
only the new package names and so will be module friendly out of the box
but no longer backwards compatible.

Cheers, Paul.


On Mon, Jun 29, 2020 at 6:13 PM Warren Milburn <wa...@munki.net> wrote:

> I have a multi-module project that uses maven as its build system.  I’m
> using Adopt OpenJDK 11.0.7 with Groovy 3.0.4 and building with Maven
> 3.6.3.  The other suspect in this case is the module xml.resolver which is
> version 1.2.
>
>
>
> After much coaxing and cajoling, the project builds but when I try to run
> it up, it gives this error:
>
>
>
> Error occurred during initialization of boot layer
>
> java.lang.module.ResolutionException: Modules org.codehaus.groovy.test and
> org.codehaus.groovy.xml export package groovy.util to module xml.resolver
>
>
>
>
>
> Has anyone come across this yet?  Or have any clues as to how I can
> resolve it?
>
>
>