Skip to content

LayerInstantiationException with java 9+ and multi-modules #123

Closed as not planned
@seanstory

Description

@seanstory

In Java 9+, we got Java Modules. It's required that each Java Module have a unique set of packages.

The gem-maven-plugin packages gemspecs in a specifications/ directory in your jars. This leads to errors like:

[ERROR] Error occurred during initialization of boot layer
[DEBUG] Error occurred during initialization of boot layer
[DEBUG] java.lang.LayerInstantiationException: Package specifications in both module example.provider and module example.consumer
[DEBUG] Closing the fork 1 after not saying Good Bye.

Related Stack Overflow post: https://stackoverflow.com/questions/53640794/java-modules-and-resources-in-identical-directories

The only workaround I've found for this is to mark the rubygems dependencies as <scope>provided</scope> to avoid having them packaged inside my resulting jars. But this is non-ideal.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions