gradle 无法更改配置“:编译”的依赖项,因为它已包含在依赖项解析中

时间:2021-05-24 07:35:11

标签: java gradle

version '1.0-SNAPSHOT'

apply plugin: 'java'

apply plugin: 'maven'

apply plugin: 'application'

group 'apns2'
version '1.0-SNAPSHOT'
description = """apns_aoetech"""
mainClassName = "com.aoetech.lailiao.apns.Main"
sourceCompatibility = 1.8//JDK的版本为1.7
targetCompatibility = 1.8
repositories {
    maven { url "http://maven.aliyun.com/nexus/content/groups/public/" }
    mavenCentral()
    maven { url "http://repo.maven.apache.org/maven2" }
}

tasks.withType(JavaCompile) {
    options.encoding = 'UTF-8'
}

jar {

    from {

        configurations.runtime.collect {
            it.isDirectory() ? it : zipTree(it)
        }

        configurations.compile.collect {
            it.isDirectory() ? it : zipTree(it)
        }
    }

    manifest {
        attributes 'Main-Class': 'com.aoetech.lailiao.apns.Main',
                'Class-Path': configurations.runtime.files.collect {"$it.name"}.join(' ')
    }

    exclude 'META-INF/*.RSA', 'META-INF/*.SF','META-INF/*.DSA'

}


dependencies {
    //compile 'org.apache.logging.log4j:log4j-api:2.5'
    //compile 'org.apache.logging.log4j:log4j-core:2.5'
    //slf4j Bridge to Log4j 2.x
    //compile 'org.apache.logging.log4j:log4j-slf4j-impl:2.5'
    compile fileTree(dir:'libs',include:['*.jar'])
    compile group: 'io.netty', name: 'netty-codec-http2', version: '4.1.24.Final'
    compile group: 'io.netty', name: 'netty-handler-proxy', version: '4.1.24.Final'
    compile group: 'io.netty', name: 'netty-resolver-dns', version: '4.1.24.Final'
    compile group: 'io.netty', name: 'netty-tcnative-boringssl-static', version: '2.0.8.Final'
    compile group: 'com.eatthepath', name: 'fast-uuid', version: '0.1'
    compile group: 'com.google.code.gson', name: 'gson', version: '2.8.4'
    compile 'org.slf4j:slf4j-api:1.7.25'
    compile 'ch.qos.logback:logback-core:1.1.7'
    compile 'ch.qos.logback:logback-classic:1.1.7'
    testCompile group: 'junit', name: 'junit', version: '4.12'
    testCompile group: 'pl.pragmatists', name: 'JUnitParams', version: '1.1.1'
    compile group: 'io.netty', name: 'netty-all', version: '4.1.24.Final'
    compile group: 'redis.clients', name: 'jedis', version: '2.8.2'
    // https://mvnrepository.com/artifact/org.json/json
    compile group: 'org.json', name: 'json', version: '20180130'
    // https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient
    compile group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.5'
    // https://mvnrepository.com/artifact/com.alibaba/fastjson
    compile group: 'com.alibaba', name: 'fastjson', version: '1.2.47'
    // https://mvnrepository.com/artifact/com.meizu.flyme/push-server-sdk
    compile group: 'com.meizu.flyme', name: 'push-server-sdk', version: '1.2.7.20180307_release'
    // https://mvnrepository.com/artifact/org.apache.commons/commons-lang3
    compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.9'
// https://mvnrepository.com/artifact/com.google.guava/guava
    compile group: 'com.google.guava', name: 'guava', version: '19.0'


}

我正在使用gradle构建一个java项目但是idea无法构建

错误提示

构建文件'C:\Users\admin\Desktop\work\yinzi\apns2-master\build.gradle'行:53

评估根项目“apns2”时出现问题。

<块引用>

配置':compile' 包含在依赖项解析中后,无法更改其依赖项。

  • 试试: 使用 --stacktrace 选项运行以获取堆栈跟踪。使用 --info 或 --debug 选项运行以获得更多日志输出。

0 个答案:

没有答案
相关问题