GradleUp / shadow

Gradle plugin to create fat/uber JARs, apply file transforms, and relocate packages for applications and libraries. Gradle version of Maven's Shade plugin.
https://www.gradleup.com/shadow/
Apache License 2.0
3.71k stars 392 forks source link

Log4j2PluginsCacheFileTransformer not working correctly? #410

Closed meydominic closed 5 years ago

meydominic commented 6 years ago

Using 4.0.0 (4.0.1 not working with shadow-transformer from Boegl) of shadow with latest shadow-transformer from Sebastian Boegl works fine. Using latest Log4j (2.11.1).

Shadow Version

latest - 4.0.1

Gradle Version

latest - 4.10.2

Expected Behavior

fatJar should launch with Log4j2 config file. Running from within IDE (intelliJ) works fine

Actual Behavior

fatJar launches with error messages:

ERROR StatusLogger Unrecognized format specifier [d]
ERROR StatusLogger Unrecognized conversion specifier [d] starting at position 16 in conversion pattern.
ERROR StatusLogger Unrecognized format specifier [thread]

Gradle Build Script(s)

shadowJar {
    transform(Log4j2PluginsCacheFileTransformer)
    transform(ServiceFileTransformer) {
        path = 'META-INF/services'
        include 'org.eclipse.jetty.http.HttpFieldPreEncoder'
    }

    manifest{
        attributes 'Class-Path': 'libs/ext'
    }

    dependencies {
        // exclude because install4j provides its dependency
        exclude(dependency('install4j-runtime:.*'))
    }
}

Content of Shadow JAR (jar tf <jar file> - post link to GIST if too long)

https://gist.github.com/dominicE/be8936395b2881139dfbb7f8de8d59ee

johnrengelman commented 6 years ago

4.0.1 has a breaking API change for transformers per the change log (yeah I know that’s not good form, but there were features for the 4.0.0 release that were broken and couldn’t be fixed without the change)

johnrengelman commented 6 years ago

I’m not clear from this issue if you are using the built in log4jtranaformer that is included in shadow starting in 4.0.0

johnrengelman commented 5 years ago

Closing as this transformer is now embedded in Shadow and the external dependency is no longer needed.