Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
kaililleby opened this issue Jul 14, 2014 · 3 comments
Milestone

Comments

@kaililleby
Copy link

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
Copy link
Collaborator

Duplicate of #70

@apatrida
Copy link

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
Copy link
Collaborator

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
Projects
None yet
Development

No branches or pull requests

3 participants