Gradle equivalent for Maven -

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Gradle equivalent for Maven -

This post has NOT been accepted by the mailing list yet.

I am using gradle to build the fat Jar for a camel application. When i execute it, I get following error. I have added all required dependencies corresponding to this namespace handler.

Exception in thread "main" org.springframework.beans.factory.parsing.BeanDefinit
ionParsingException: Configuration problem: Unable to locate Spring NamespaceHan
dler for XML schema namespace []
Offending resource: class path resource [META-INF/spring/camel-context.xml]

        at org.springframework.beans.factory.parsing.FailFastProblemReporter.err
        at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderC
        at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderC

In maven , I used to get the same error but I applied the fix by adding following lines which are in Bold.

                                                                 <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
                                <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">


Is there a equivalent configuration in Gradle which I can put into my gradle task. Following gradle task creates my uber jar..

task fatJar(type: Jar) {
    baseName = + '-all'
    from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } } {
        exclude "META-INF/*.SF"
        exclude "META-INF/*.DSA"
        exclude "META-INF/*.RSA"

    with jar
    manifest {
        attributes 'Implementation-Title': 'Gradle Quickstart', 'Implementation-Version': version
        attributes 'Main-Class': 'com.groovy.ApplicationBoot'