mergeServiceFiles() doesnt seem to include META-INF/services/... in project src #71

Closed
kaililleby opened this Issue Jul 14, 2014 · 3 comments

Comments

Projects
None yet
3 participants
@kaililleby

i have a project containing a file src/main/resources/META-INF/services/io.dropwizard.logging.AppenderFactory

in build.gradle:
....
shadowJar {
mergeServiceFiles()
....
}
....

all the META-INF/services/io.dropwizard.logging.AppenderFactory files in the various dependent jars are merged as expected, but the content of my io.dropwizard.logging.AppenderFactory file is not included..

any ideas?

@johnrengelman

This comment has been minimized.

Show comment
Hide comment
@johnrengelman

johnrengelman Jul 14, 2014

Owner

Duplicate of #70

Owner

johnrengelman commented Jul 14, 2014

Duplicate of #70

@apatrida

This comment has been minimized.

Show comment
Hide comment
@apatrida

apatrida Jul 3, 2015

I'm not sure how this is fixed? I relocate things:

 shadowJar {
        mergeServiceFiles()
//            zip64 = true      -- this corrupts the JAR

        dependencies {
            include(dependency('org.jetbrains..*:.*:.*'))
            include(dependency('com.fasterxml.*:.*:.*'))
            include(dependency('com.google..*:.*:.*'))
            include(dependency('org.apache.httpcomponents:.*:.*'))
            include(dependency('joda-time:.*:.*'))
            include(dependency('org.jsoup:.*:.*'))
            include(dependency('org.jodd:.*:.*'))
            include(dependency('stax:.*:.*'))
            include(dependency('org.codehaus.*:.*:.*'))
            include(dependency('commons-.*:.*:.*'))
        }
        relocate("com.fasterxml", "shaded.com.fasterxml")
        relocate("org.codehaus", "shaded.org.codehaus")
        relocate("com.google", "shaded.com.google")
        relocate("org.joda", "shaded.org.joda")
        relocate("org.jsoup", "shaded.org.jsoup")
        relocate("jodd", "shaded.jodd")
        relocate("org.apache.commons", "shaded.org.apache.commons")
        relocate("org.apache.httpcomponents", "shaded.org.apache.httpcomponents")
    }

and I ended up with service files that did not change the names:

 testing: META-INF/services/com.fasterxml.jackson.core.JsonFactory   OK
    testing: META-INF/services/com.fasterxml.jackson.core.ObjectCodec   OK
    testing: META-INF/services/com.fasterxml.jackson.databind.Module   OK

nor the contents:

(example within one file is)

com.fasterxml.aalto.stax.EventFactoryImpl

and both of these should have changed yes?

apatrida commented Jul 3, 2015

I'm not sure how this is fixed? I relocate things:

 shadowJar {
        mergeServiceFiles()
//            zip64 = true      -- this corrupts the JAR

        dependencies {
            include(dependency('org.jetbrains..*:.*:.*'))
            include(dependency('com.fasterxml.*:.*:.*'))
            include(dependency('com.google..*:.*:.*'))
            include(dependency('org.apache.httpcomponents:.*:.*'))
            include(dependency('joda-time:.*:.*'))
            include(dependency('org.jsoup:.*:.*'))
            include(dependency('org.jodd:.*:.*'))
            include(dependency('stax:.*:.*'))
            include(dependency('org.codehaus.*:.*:.*'))
            include(dependency('commons-.*:.*:.*'))
        }
        relocate("com.fasterxml", "shaded.com.fasterxml")
        relocate("org.codehaus", "shaded.org.codehaus")
        relocate("com.google", "shaded.com.google")
        relocate("org.joda", "shaded.org.joda")
        relocate("org.jsoup", "shaded.org.jsoup")
        relocate("jodd", "shaded.jodd")
        relocate("org.apache.commons", "shaded.org.apache.commons")
        relocate("org.apache.httpcomponents", "shaded.org.apache.httpcomponents")
    }

and I ended up with service files that did not change the names:

 testing: META-INF/services/com.fasterxml.jackson.core.JsonFactory   OK
    testing: META-INF/services/com.fasterxml.jackson.core.ObjectCodec   OK
    testing: META-INF/services/com.fasterxml.jackson.databind.Module   OK

nor the contents:

(example within one file is)

com.fasterxml.aalto.stax.EventFactoryImpl

and both of these should have changed yes?

@johnrengelman

This comment has been minimized.

Show comment
Hide comment
@johnrengelman

johnrengelman Jul 4, 2015

Owner

what version of Shadow are you using?

Owner

johnrengelman commented Jul 4, 2015

what version of Shadow are you using?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment