简体   繁体   中英

Duplicated Classes Output jar with Gradle

I'm using Gradle with IntelliJ. When I build my jar, it creates a jar with duplicated classe for the submodule "core". 3 classes. Here's my build.gradle of the whole project.

allprojects {
    apply plugin: 'java'
    apply plugin: 'eclipse'
    apply plugin: 'idea'

    group = 'be.isach'
    version = '1.2-RELEASE'

    compileJava.options.encoding = 'UTF-8'

    configurations {
        shaded
        compile.extendsFrom shaded
    }

    afterEvaluate{
        jar {
            dependsOn configurations.shaded
            from configurations.shaded.collect {
                it.isDirectory() ?
                        it :
                        zipTree(it)
            }
        }
    }
}

dependencies{
    subprojects.each{ p ->
        shaded(p) {
            transitive false
        }
    }
}

subprojects {
    repositories {
        mavenLocal()
        mavenCentral()
        ivy {
            url 'http://www.tcpr.ca/files/'
            layout 'pattern', {
                artifact '[module]/[module]-[revision].[ext]'
            }
        }
        maven {
            url 'https://hub.spigotmc.org/nexus/content/groups/public/'
        }
        maven {
            url 'https://oss.sonatype.org/content/groups/public/'
        }
        maven {
            url 'http://nexus.theyeticave.net/content/repositories/pub_releases'
        }
        maven {
            url 'http://repo.md-5.net/content/repositories/releases'
        }
        maven {
            url 'http://repo.howaner.de'
        }
        maven {
            url 'http://repo.dmulloy2.net/content/groups/public/'
        }
    }
}

Jar screenshot: Jar屏幕截图

I searched a lot on Google, but found nothing about this. I don't see what could be wrong with it.

修复它,只是JDGui过时了。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM