Skip to content

Support Spring shading and relocation #1489

@vlsi

Description

@vlsi

What feature do you want to see added?

It would be nice if there was a possibility to configure Spring shading and relocation.

There's META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports which can currently be handled with ServiceFileTransformer, however, it would be nice if out-of-the-box SpringTransfomer would handle it as well.

There's META-INF/spring-configuration-metadata.json which contains helper information for IDE, and we can probably ignore it for now, however, transforming and merging that file would be a plus.

Spring has several files which should be modified for proper relocation:

        "META-INF/spring-autoconfigure-metadata.properties",
        "META-INF/spring.factories",
        "META-INF/spring.handlers",
        "META-INF/spring.schemas",
        "META-INF/spring.tooling",

The files are in Properties format, however:

  1. schemas and tooling have path for the values
  2. The rest have class for the values
  3. factories has class for the values

Sometimes, the values are comma-separated, so merging should use comma-separated value.

I've implemented SpringFileTransformer which works for me, however, it would be nice if there was out-of-the-box one.
Even though shading Spring is awkward, there are cases when it is needed. See also:

Are you interested in contributing this feature?

I might contribute, however, I am not comfortable with writing Groovy code.

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