Skip to content

Shadow Jar for modular project with module-info #710

@palexdev

Description

@palexdev

Shadow Version

Version 7.0.0

Gradle Version

Version 7.2

Gradle Build Script(s)

jar {
    manifest {
        attributes(
                'Bundle-Name': project.name,
                'Bundle-Description': "...",
                'Bundle-SymbolicName': '...',
        )
    }
    enabled = false
    dependsOn(shadowJar)
}

shadowJar {
    mergeServiceFiles()
    archiveClassifier.set(null)
    configurations = [project.configurations.shadow]
}

I'm trying to build a shadow jar for my library that depends on another library, I'd like to ship my jar with the dependency already included.
The issue is that my project is a modular project, there's the library itself that is the "main" module and then there's a preview of the library which is the "demo" module
Both modules have their respective module-info.java, when I build the shadow jar the build fails because the "demo" module cannot find the required "main" module. In fact if I open the shadow jar there's no module info in the archive

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions