Skip to content

java.lang.module.InvalidModuleDescriptorException: Empty providers set #171

@LarryNorth

Description

@LarryNorth

The module descriptor generated for artifact org.liquibase:liquibase-core:4.31.1 by task moduleDescriptorRecommendations produces an error in the transformed artifact's module-info.class. From the decompiled module-info.class:

provides liquibase.license.LicenseService with
;

At runtime this error occurs: java.lang.module.InvalidModuleDescriptorException: Empty providers set

It seems that this occurs because artifact org.liquibase:liquibase-core:4.31.1's META-INF/services/liquibase.license.LicenseService is an empty file. In a non-modular application, the Java ServiceLoader would correctly return zero providers

A workaround is to add ignoreServiceProvider("liquibase.license.LicenseService") to the module descriptor. Maybe either task moduleDescriptorRecommendations should generate an ignoreServiceProvider or plugin extra-java-module-info should not generate a module-info provides directive for such empty files.

This problem is demonstrated in project extra-java-module-info-empty-providers-set.

Metadata

Metadata

Assignees

Labels

a:bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions