pivotal-cf / java-cfenv

Apache License 2.0
95 stars 59 forks source link

com.cedarsoftware:json-io is not completely shaded #261

Closed n-shaw closed 2 months ago

n-shaw commented 6 months ago

Describe the bug

The shadowJar task in the java-cfenv-all build.gradle is relocating with a package name that is too specific. This can cause issues with customers who depend on json-io in their projects (directly or indirectly/transitively) when their apps are deployed/packaged with the buildpack uberjar.

Instead of com.cedarsoftware.util.io, it should simply be com.cedarsoftware. Otherwise, there will be about 20 json-io classes left in the original package, while the rest move under io.pivotal.cfenv.shaded.com.cedarsoftware.util.io.

shadowJar {
    archiveClassifier.set('')
    mergeServiceFiles()
    transform(PropertiesFileTransformer) {
        paths = ['META-INF/spring.factories']
        mergeStrategy = "append"
    }
    dependencies {
        exclude(dependency('org.springframework.boot::'))
        exclude(dependency('org.springframework::'))
    }
    relocate 'com.cedarsoftware.util.io', 'io.pivotal.cfenv.shaded.com.cedarsoftware.util.io'
}

The relocate step should say:

    relocate 'com.cedarsoftware', 'io.pivotal.cfenv.shaded.com.cedarsoftware'

Reproduction steps

  1. Download the java-cfenv uber jar.
  2. Extract the contents: `jar -xvf java-cfenv-3.1.5.jar
  3. Browse the folder structure. json-io_shadow_split

Expected behavior

All of the classes fromjson-io should be in the io.pivotal.cfenv.shaded.com.cedarsoftware namespace.

Additional context

No response

n-shaw commented 6 months ago

@anthonydahanne - Since it can take time for changes to get released, consumed, and then brought in to each customer's environment, I was hoping you could take a look at this issue at your earliest convenience. Thank you for your consideration.

anthonydahanne commented 2 months ago

Hello ! Can we close this issue? I believe all is well now between java-cfenv shading and json-io since this commit got merged in? Thanks!

n-shaw commented 2 months ago

Thanks, @anthonydahanne.